World of Banished

Conversations => Suggestions and Mod Ideas => Topic started by: Necrolex on September 14, 2025, 07:14:30 AM

Title: Mayor
Post by: Necrolex on September 14, 2025, 07:14:30 AM
Hi

If all buildings with professions need professionals, why doesn't City Hall have a Mayor?
Of course, we can imagine that WE are the Mayor of the city, but what do you think about the lack of one, even if just for role-playing purposes?
Could the Mayor profession be added to the game? And if so, could there be new City Halls with an entry for this new professional?
Maybe the new City Hall could provide some kind of happiness.

Does anyone know how to create a mod like this?
Title: Re: Mayor
Post by: RedKetchup on September 14, 2025, 10:48:54 AM
i guess it is possible, in RKEC i have a Lighthouse that act like a townhall, and i set up , i think, 1 worker on it, 1x Fireworker. so i think it is possible to be done.

when you put the Fireworker ON, the fire on top of the lighthouse start to burn.
Title: Re: Mayor
Post by: Necrolex on September 15, 2025, 04:33:41 PM
Hi!
My idea is to ask someone to help me make a Mod in which the city hall needs a Mayor to bring some kind of happiness to the banished people, just like the church needs a priest/cleric.
I believe this would be the most logical thing in the game.

I'm trying to get back to where I left off when I was learning how to do 3D modeling and a little bit of coding, but so much has happened that pulled me away from all of it, and now I need to relearn everything again.
Title: Re: Mayor
Post by: RedKetchup on September 16, 2025, 02:29:06 AM
i guess you need to add a new profession in a new file named: Profession.rsc in a new folder named Profession
and inside:
Profession mayor
{
StringTable _stringTable = "UI/yourownStringTable.rsc"; // use your own stringtable
SpriteSheet _spriteSheet = "UI/yourownSpriteSheet.rsc"; // and your own spritesheet

String _text = "ProfessionMayor";
String _toolTipText = "ProfessionMayorTip";
String _deathText = "ProfessionMayorDeath";

int _sortPriority = 3200; // placement where you want "Mayor" to appear in the profession tab
bool _transient = false;

RandomSelection _deathSelector
{
float _years = 10;
float _population = 500;
}
}

after, copy the townhall.rsc in a new folder Template:

i guess you need to add a line in the "ui" top section of Template.rsc
"workplace",

and add further down the Townhall.rsc file what it does:

WorkPlaceDescription workplace
{
Profession _profession = "Profession/Profession.rsc:Mayor";
Profession _pickupProfession = "Profession/Profession.rsc:Mayor";
}

should be 1 mayor for this building since the call "work" is already in place in the "ui" section at top, no need to change, it already stated down it has 1 worker by default.

then for the happiness feature you need to add the call for the happiness function in the "ui" fonction at top:
"happiness",

and further down , describe what it does:
HappinessDescription happiness
{
HappinessType _happinessType = Spirit; //type d'hapiness same as the church
bool _requireWorker = true; // it require a worker there to trigger the happiness benefit
int _idleRange = 5; // the number of tiles citizens will stand within and from the door.
}

but i am really not sure if there is a "dummy" for it in the townhall.fbx which is hidden from our view :P
and the repercussion it can produce.

you will have to make your own stringtable and your own spritesheet with your own icon.

In your resource file, at the root of your mod you will need to call those changes

ExternalList resource
{
External _resources
[

// Dialog and Game changes ----------------------------------------------------------------------------------

"ui/yourownStringTable.rsc",
"ui/yourownSpriteSheet.rsc.rsc",
"Profession/Profession.rsc",
"Template/Townhall.rsc:ui",
"Template/Townhall.rsc:workplace",
"Template/Townhall.rsc:hapiness",
]
}


i maybe forgot something, me too i m away from making mods, since already a dozen of years since RKEC ^^
i made it so you only call directly your changes and not process the entire townhall functions which can trigger some incompatibilites with other mods that have some changes to the townhall.rsc (like in RKEC i made some changes myself)

Let us know how it goes :)
Title: Re: Mayor
Post by: Necrolex on September 16, 2025, 06:40:23 AM
Hi!
Thanks for your response.
I used to be really good at understanding code. These days I'm a lot slower at understanding all the code, but I'll do my best.
Today I have to take my dad for a medical appointment, but I'll take a look at it calmly later.
Title: Re: Mayor
Post by: RedKetchup on September 17, 2025, 06:49:34 PM
Quote from: Necrolex on September 16, 2025, 06:40:23 AMHi!
Thanks for your response.
I used to be really good at understanding code. These days I'm a lot slower at understanding all the code, but I'll do my best.
Today I have to take my dad for a medical appointment, but I'll take a look at it calmly later.

Bah me , it has been 12 years i didnt made mods. so i forgot everything lol