Stellaris

Stellaris

See it-Say it-SORTED
Benedictus  [ontwikkelaar] 24 mei 2024 om 16:21
Add Automatic Sorting to your own Mod(s)
Automatic Sorting in your own Mod(s)

Mod authors can put building position directly into their own mod-code. Using "position_priority"
If a building has self-contained positioning rules, when sorted by this mod, they will apply.
A fairly simple method to set that sort position would be the following code.

Use an inline_script within your "building" code, and where you normally would place a "category = research" you would instead write.
my_mods_building_name = { inline_script = { script = "build_sorted" level="2" cat="research" type="worker" }
...\Stellaris\mod\<name_of_your_mod>\common\inline_scripts\build_sorted.txt
position_priority = @[ ] # Put THIS inside @[ ] above pos_$cat$ + $level$*5 + pos_$type$ category = $cat$
and a variables file

...\Stellaris\mod\<name_of_your_mod>\common\scripted_variables\bene_sort.txt
# CATEGORIES # category = government @pos_army = 125 @pos_government = 150 @pos_pop_assembly = 175 @pos_amenity = 200 @pos_research = 225 @pos_manufacturing = 250 @pos_resource = 275 @pos_unity = 300 @pos_trade = 325 # TYPES (sub-categories) @pos_first = 0 # @pos_capital = 0 @pos_housing = 0 @pos_boost = 1 #boosted resources @pos_static = 2 #Static resources @pos_worker = 3 #pop jobs

NOTE: With Steam formatting, apparently it will NOT DISPLAY the following pos_$cat$ + $level$*5 + pos_$type$ when I place it inside of @[ ]. But in your code it must be there.
Laatst bewerkt door Benedictus; 24 mei 2024 om 16:22