Question: why wont buffs show up for my worker?

TLDR version: want to stuff the entirity of the farmer into the worker, delete the farmer as a class for my kingdom.

succes so far:
got my worker to do workery-things. and farm. as long as A farmer exists, because otherwise the make-a-farmplot button is greyed out.

how: changing parts of my workers description, and making a new abillity file which is basicly a worker. but has the farming AI pack.

problems:

  • how to make the button not greyed out if i dont have a farmer.
  • why dont the unlockable abillities from the farmer shop up?


entire mod
https://github.com/Thahat/nordlingmod/tree/master/jobs/worker

@max99x is there something special about the worker so that abillities wont show up? or am i doing/missing something stupid?

also, how to stop the greying out of the farm-plot-button?

same issue here
i believe it has to do with jobs built from scratch (ir it’s us)

I’m pretty sure the button being grayed out is purely a UI thing. Look at the “start menu” or something like that UI code, you’ll see that the workshops for each crafter type only light up if a check shows that that there are some of that profession in your town. I think the farming and trapping zones buttons are the same thing, so you can just edit the .js file to always enable those buttons (if your kingdom is the right type).

Paul’s right about the button. You can mixinto start_menu.json, under create_farm to remove or replace the required_job value.

For the perks, there’s an explicit check against stonehearth:jobs:worker in citizen_character_sheet.js, line 443, but if your worker job has a different URI, that should be fine.

1 Like

Well now at least I know my fight will be with start_menu. Json, thanks for the location too, I’ll keep you posted :slight_smile:

i might be looking in the wrong location, where is it supposed to live? @start_menu.json?

stonehearth/ui/game/start_menu/start_menu.js

1 Like

ah, guessed as much (.js, not .json max :stuck_out_tongue: )
edit: can those just use normal style mixins/overwrites etc? (normal in this case being just like jsons?)

i see

      create_farm : function () {
         App.stonehearthClient.createFarm();
      },

in menu functions and all that tells the game is “hey there is this button, see?” .i think?

but in start_menu.js i see no way to tell the game “you know those farmers? yeah just ignore their existance and just give me the damn button”

is there no json that controlles that stuff anywhere? or should i then start looking in citizen_character_sheet.js?

afbeelding

1 Like

Sorry.
stonehearth/data/ui/start_menu.json

1 Like

now that i can read, thanks a ton max!

/data/ui/start_menu.json worked perfectly, the option for the field now shows up, so ive got everying working as it should except for one thing:
citizen_character_sheet.js

ive made a copy of the file, and have ahot loading manifest overwrite the current .js file when my nordlings are chosen,

and if i get you correctly

      //show each class that this person has ever been
      var jobs = this.get('model.stonehearth:job.job_controllers');
      radiant.each(jobs, function(alias, data) {
         if (alias != 'stonehearth:jobs:worker') {
            var div = self.$("[uri='" + alias + "']");

            //For each, figure out which perks should be unlocked
            self._unlockPerksToLevel(div, data.last_gained_lv)

            $(div).show();
         }
      });

is the piece of code that, for no reason i can think of tells the game: DONT SHOW THE WORKERS SKILLS

so what i tried was ripping out the IF part.

      //show each class that this person has ever been
      var jobs = this.get('model.stonehearth:job.job_controllers');
      radiant.each(jobs, function(alias, data) {
        {
            var div = self.$("[uri='" + alias + "']");

            //For each, figure out which perks should be unlocked
            self._unlockPerksToLevel(div, data.last_gained_lv)

            $(div).show();
         }
      });

but that seems to not have worked because skills are still not showing up, am i missing something here or am i better of just turning that check for worker into a check for the mythical non existant sasquatch?

You also need to remove the { and } of that if

  //show each class that this person has ever been
  var jobs = this.get('model.stonehearth:job.job_controllers');
  radiant.each(jobs, function(alias, data) {
        var div = self.$("[uri='" + alias + "']");

        //For each, figure out which perks should be unlocked
        self._unlockPerksToLevel(div, data.last_gained_lv)

        $(div).show();
  });

Aside from that, this is a change that should go to the main game itself…

ill give it a try! (mythical sasquatch aproach oddly enough did not work, pointing it at NOT nordlingmod:THISCLASSSDOESNOTEXIST did not work :confused:

as a change, not a mod you mean?

As in, a dev should add this change to the main game

1 Like

Seconded, @OwlGo had fought with it earlier and it drove him mad because it did not make any sense XD

EDIT:
still no abillities, even with your code @BrunoSupremo

What is your worker description with the perks?

https://github.com/Thahat/nordlingmod

for if you want to check my work
and yes i added levels, gaining xp, i pointed at the farmers existing skills and changed the links to the pictures to direct links so they did not have to be in the same folder

EDIT
worker description:
nordlings_worker_description.txt (2.7 KB)

edited previouw message with the perks

but the important bit is

"level_data": {
      "1": {
         "perks": [
            {
               "type": "apply_buff",
               "name": "i18n(stonehearth:jobs.farmer.farmer_description.level_1_data.perk_000_name)",
               "id": "farmer_speed_up_1",
               "icon": "/stonehearth/jobs/farmer/images/speed_up.png",
               "buff_name": "stonehearth:buffs:farmer:speed_1",
               "description": "i18n(stonehearth:jobs.farmer.farmer_description.level_1_data.perk_000_description)",
               "level": 1,
               "demote_fn": "remove_buff"
            }
         ]
      },
      "2": {
         "perks": [
            {
               "name": "i18n(stonehearth:jobs.farmer.farmer_description.level_2_data.perk_000_name)",
               "id": "farmer_job_opportunities",
               "icon": "/stonehearth/jobs/farmer/images/farmerLv2.png)",
               "description": "i18n(stonehearth:jobs.farmer.farmer_description.level_2_data.perk_000_description)",
               "level": 2
            }
         ]
      },
      "3": {
         "perks": [
            {
               "name": "i18n(stonehearth:jobs.farmer.farmer_description.level_3_data.perk_000_name)",
               "id": "farmer_harvest_increase",
               "icon": "/stonehearth/jobs/farmer/images/farmerLv3.png)",
               "description": "i18n(stonehearth:jobs.farmer.farmer_description.level_3_data.perk_000_description)",
               "level": 3
            }
         ]
      },
      "5": {
         "perks": [
            {
               "name": "i18n(stonehearth:jobs.farmer.farmer_description.level_5_data.perk_000_name)",
               "id": "farmer_unlock_trees",
               "icon": "/stonehearth/jobs/farmer/images/farmerLv5.png)",
               "description": "i18n(stonehearth:jobs.farmer.farmer_description.level_5_data.perk_000_description)",
               "level": 5
            }
         ]
      },
      "6": {
         "title": "i18n(stonehearth:jobs.farmer.farmer_description.level_6_data.title)"
      }
   }
}