I had a itch, I had to scratch (v2.6)
Posted: Thu Jun 08, 2023 7:06 am
BEWARE: This might result long, uninteresting and/or already covered elsewhere.
Thus, one thing I always disliked (in most rulesets), is that upon entering a hut,
on some occasions *BOOM* City happens. Me and the fc code greatly differ about
when and why a tile would qualify for being a decent spot to place a city.
Triggering the city foundation when entering a hut has always been considered
an unfortunate event for me, requiring turns and turns waiting growth,
disbanding, relocating... Maybe a tile or two away from the original hut spot.
My mission: avoid the foundation of a city in a random spot because a
curious explorer (whatever) entered a hut (Minor Tribe Village).
The idea: Settlers OR Migrants instead.
After some digging around , I found several threads (most if not all
authored/involving Nef) about 'hut enter' events and several approaches
centered on 'default.lua' alterations.
I settled (pun intended) on one version (the most 'generic and complete') and started hacking.
My hacks turn up working fine and instead of an instant city, one gets Settlers (25%) or Migrants (75%).
I was dubious about replacing <...>/default/default.lua with an altered version,
and attempts to integrate the relevant sections in <...>/ruleset/script.lua were miserably failing.
My understanding was that one should not tamper with <...>/default/default.lua and
instead do all the work in his <...>/ruleset/script.lua instead, but that is not going to end well.
When no <...>/ruleset/default.lua is found, then <...>/default/default.lua is sourced.
That is guaranteed to be there, else your installation is ... Flawed.
See? When your <...>/ruleset/script.lua has stuff that "would" belong in a default.lua,
you have a problem of precedence. Last one sourced, wins: .../default/default.lua!
However, seems that having <...>/ruleset/default.lua will stop the hunt
for <...>/default/default.lua (apparently). I ended up doing precisely this,
in other words, let the .../default/default.lua alone but have
my altered one present as .../ruleset/default.lua.
I am confused and need some advices/clarifications about how to correctly
implement this for an hypothetical (far into the future) modpack.
EDIT: For the records, the patch with modifications in attachment.
Thus, one thing I always disliked (in most rulesets), is that upon entering a hut,
on some occasions *BOOM* City happens. Me and the fc code greatly differ about
when and why a tile would qualify for being a decent spot to place a city.
Triggering the city foundation when entering a hut has always been considered
an unfortunate event for me, requiring turns and turns waiting growth,
disbanding, relocating... Maybe a tile or two away from the original hut spot.
My mission: avoid the foundation of a city in a random spot because a
curious explorer (whatever) entered a hut (Minor Tribe Village).
The idea: Settlers OR Migrants instead.
After some digging around , I found several threads (most if not all
authored/involving Nef) about 'hut enter' events and several approaches
centered on 'default.lua' alterations.
I settled (pun intended) on one version (the most 'generic and complete') and started hacking.
My hacks turn up working fine and instead of an instant city, one gets Settlers (25%) or Migrants (75%).
I was dubious about replacing <...>/default/default.lua with an altered version,
and attempts to integrate the relevant sections in <...>/ruleset/script.lua were miserably failing.
My understanding was that one should not tamper with <...>/default/default.lua and
instead do all the work in his <...>/ruleset/script.lua instead, but that is not going to end well.
When no <...>/ruleset/default.lua is found, then <...>/default/default.lua is sourced.
That is guaranteed to be there, else your installation is ... Flawed.
See? When your <...>/ruleset/script.lua has stuff that "would" belong in a default.lua,
you have a problem of precedence. Last one sourced, wins: .../default/default.lua!
However, seems that having <...>/ruleset/default.lua will stop the hunt
for <...>/default/default.lua (apparently). I ended up doing precisely this,
in other words, let the .../default/default.lua alone but have
my altered one present as .../ruleset/default.lua.
I am confused and need some advices/clarifications about how to correctly
implement this for an hypothetical (far into the future) modpack.
EDIT: For the records, the patch with modifications in attachment.