Author Topic: Will mods allow complex job defaults?  (Read 613 times)

0 Members and 1 Guest are viewing this topic.

Offline seanth

  • Laborer
  • **
  • Posts: 11
Will mods allow complex job defaults?
« on: April 24, 2018, 01:07:31 PM »
I'm using Banished in a modelling class and we were mapping building types onto Maslow's Hierarchy of Needs as a way to understand job importance in the game and how it applies to human sustainability. Doing that led to some ideas about how jobs could cascade based on importance.

Right now, if a Tailor has nothing to do, their behavior will default to a Laborer. Does the modkit allow for more complex job paths that would, for example:

If a Tailor has nothing to do, it acts like a Gatherer
If a Gatherer has nothing to do, it acts like a Laborer

That's just a simple example, but I think you get the idea and can imagine how all the job types could interlink and cascade.

So? Possible?

Online RedKetchup

  • Champion
  • Banished Expert
  • *****
  • Posts: 9925
  • Country: ca
Re: Will mods allow complex job defaults?
« Reply #1 on: April 24, 2018, 02:58:34 PM »
i dont think they can.... @Discrepancy  would be the best to test and talk about it.
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

Offline Discrepancy

  • Modders
  • Architect
  • *****
  • Posts: 934
  • Country: au
Re: Will mods allow complex job defaults?
« Reply #2 on: April 29, 2018, 02:45:30 AM »
Unfortunately no we can't to that extent.

All we can do is change the default worker from laborer to something else like a farmer, and that would make every citizen automatically and permanently until otherwise assigned to another task as a farmer. So it's really not worth doing unless someone really wants this? tasks like clearing land, supplying building sites and emptying some workplaces would still require a laborer workforce anyway.
Code: [Select]
Game\Profession\Profession.rsc:resource

ProfessionList resource
{
Profession _default = "farmer";    // changed from laborer
Profession _builder = "builder";
Profession _child = "child";
Profession _student = "student";
}

https://i.imgur.com/R2XRA3M.jpg
Will mods allow complex job defaults?


As all of the citizens AI functions are hidden from us we cannot see how their idling places are chosen, or what they do if they have nothing to do at their workplace.

Offline tangent

  • Laborer
  • **
  • Posts: 23
  • Country: us
Re: Will mods allow complex job defaults?
« Reply #3 on: November 16, 2018, 02:22:23 AM »
So, I'm gonna go on a limb here and say 'maybe'.

The object that Discrepancy pointed out definitely sets defaults for the standard templates that the citizen resource can be assigned to:

Code: [Select]
ProfessionList resource
{
Profession _default = "laborer";
Profession _builder = "builder";
Profession _child = "child";
Profession _student = "student";
}

BUT there's a boolean value passed to each class/profession that seems to indicate that it can be used as a fallback, specifically `bool _transient = true`.

Code: [Select]
Profession laborer : "base"
{
String _text = "ProfessionLaborer";
String _toolTipText = "ProfessionLaborerTip";
String _deathText = "ProfessionLaborerDeath";

int _sortPriority = 100;
bool _transient = true;

RandomSelection _deathSelector
{
float _years = 50;
float _population = 100;
}
}

If I were guessing, I'd say that the _sortPriority has 2 purposes:

1 - to order jobs within the Professions GUI (since the values map 1:1 there. e.g. laborer has a sortPriority of 100, and is the first slot. Builder has a sortPriority of 200, and is the 2nd slot, etc)

2- to indicate what jobs to use when their current profession has no work. So since laborer has a sortPriority of 100 and returns true for _transient, if a farmer doesn't have a field to work, they'll become 'transient', and draw from an array of 'transient' jobs, picking the highest priority available.

I'd test by setting the builder profession's _transient value to 'true', then see if a farmer without work will construct a building before doing laborer tasks.

EDIT: Tested. This is not the case. I set the entire village to 'farmers' and placed a house and resource destruction. They all performed laborer actions, but no the builder ones. That doesn't necessarily mean that trickle down is impossible, I may have just flipped the significance of the priority (so the lowest priority is selected, meaning laborer). Either that or only 1 class can be assigned as the transient one.
« Last Edit: November 16, 2018, 02:34:12 AM by tangent »

Offline Tom Sawyer

  • Modders
  • Architect
  • *****
  • Posts: 956
  • Country: is
Re: Will mods allow complex job defaults?
« Reply #4 on: November 16, 2018, 02:48:49 AM »
Welcome to Banished modding @tangent! :)

_sortPriority defines only the order in profession lists of the UI. It has no influence on a "fall back profession" which is always laborer (default).

Offline tangent

  • Laborer
  • **
  • Posts: 23
  • Country: us
Re: Will mods allow complex job defaults?
« Reply #5 on: November 16, 2018, 03:42:13 AM »
so I've learned  ::)

There's always the transient value, but it seems that you can only assign 1 profession to be transient

Online RedKetchup

  • Champion
  • Banished Expert
  • *****
  • Posts: 9925
  • Country: ca
Re: Will mods allow complex job defaults?
« Reply #6 on: November 16, 2018, 04:05:14 AM »
there is many things that are hidden from us. with time we called those : game mechanics ^^
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .