World of Banished

MODS Garage => Mod Talk => Topic started by: seanth on April 24, 2018, 01:07:31 PM

Title: Will mods allow complex job defaults?
Post by: seanth 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?
Title: Re: Will mods allow complex job defaults?
Post by: RedKetchup on April 24, 2018, 02:58:34 PM
i dont think they can.... @Discrepancy  would be the best to test and talk about it.
Title: Re: Will mods allow complex job defaults?
Post by: Discrepancy 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.
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)

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.
Title: Re: Will mods allow complex job defaults?
Post by: tangent 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:


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`.


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.
Title: Re: Will mods allow complex job defaults?
Post by: Tom Sawyer 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).
Title: Re: Will mods allow complex job defaults?
Post by: tangent 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
Title: Re: Will mods allow complex job defaults?
Post by: RedKetchup on November 16, 2018, 04:05:14 AM
there is many things that are hidden from us. with time we called those : game mechanics ^^