World of Banished

MODS Garage => Mod Talk => Topic started by: littbarski on July 02, 2025, 09:58:04 AM

Title: understand the resource files *.rsc (example: disasters)
Post by: littbarski on July 02, 2025, 09:58:04 AM
hello,

I know nothing about programming and resource files, normally :). But at least I have learned how the mod toolkit works. So I thought about disabling perhaps some disasters (animal disease) while letting others happen (fire).

I will not ask each single step, but only want to understand how the parts or "chapters" of rsc files work.

When I have a file cropfield.rsc that has a part like this:

   
// declare types that will be used
    Description _descriptions
    [
        "ui",
        "map",
        "zone",
        "toolbar",
        "createdrag",
        "decal",
        "work",
        "disease",
        "particle",
        "highlight",
        "statusicon",
        "tracker",   
        "autopickup",       
        "statemachine",
        "cleararea",
        "destroy",
        "workplace",       
        "cropfield",
    ]

and then this:

DiseaseDescription disease
{
    int _startMonth = 3;
    int _endMonth = 7;
    float _spawnIntervalInMonths = 0.25;
    float _lowSpawnChance = 200;
    float _highSpawnChance = 150;

    float _killIntervalInMonths = 0.03;
    float _spreadIntervalInMonths = 0.125;
    int _spreadRadius = 20;

    float _diseaseLengthInMonths = 8;
}

To disable the disease, would it be better to delete the "disease" line in the first code, or delete the content of the second code so that I get this?

DiseaseDescription disease
{
}

My guess would be to leave the "disease" line as it is, but delete it as in the last code example, because probably Banished "looks" for the
DiseaseDescription disease and if it is empty just makes no disease?

If so, I could decide which animal or plant disease we like or not (after playing finally some more Banished...) and then turn it on/off. The fire is a nice effect (and reminds me to Caesar games). The Tornado would need to be turned off in the climate rsc files (in each of them as it seems). But here I really first want to understand how the rsc files work, so if Banished understands if I make such a part empty.
Title: Re: understand the resource files *.rsc (example: disasters)
Post by: RedKetchup on July 02, 2025, 01:02:53 PM
delete the line at the top
         "disease",


the
// declare types that will be used
    Description _descriptions

is calling which functions it must read further down so if you delete the "disease" function, it wont read the paragraph where it describe what it should do
Title: Re: understand the resource files *.rsc (example: disasters)
Post by: littbarski on July 02, 2025, 01:55:05 PM
ok thank you, I was not sure, because I know little about those file structures.
If it is the same (or better) effect to just delete this line at the beginning's list, this makes it much easier to turn it off, when needed, for example with a // before the disease line.

With the tornado it is a bit different, there is no such function/type to disable, so you have to put a float years that suits the personal need for tornados :). I would put 1000 years...

And about the fire (or also the tornado?): the following means that the fire in general (beside the house settings) does not start? (vanilla setting at the beginning of common.rsc)
// chance to randomly start
RandomSelection _fireChance
{
float _years = 0;
float _population = 0;
}

I would assume so, because later e.g. in the wood houses, we have a value (like 20) and I would guess the wood house setting then overwrites the general setting at the beginning. Same for the float _spreadChance
I think the fire is an "ok disaster" and it could be set to break out from time to time but not spread.

Sorry for my beginners' questions without actually being a modder or publishing mods, but I am really very far away from being sure about what I am doing and I don't want to destroy other players's games with some suboptimal mod. But I try to ask as much detail as possible so that other players / modders can build their own mod, like in the example of the cow movement, there was really an improvement with the settings that I posted in the other thread (again, it is a personal thing which value for the cow and other animal movement you choose).
Title: Re: understand the resource files *.rsc (example: disasters)
Post by: RedKetchup on July 02, 2025, 07:21:06 PM
oh yeah you can just do //