Stellaris

Stellaris

Planetary Mega Engineering
Found a fix for disappearing deposits when making ecumenopolis
as the title says, I've found a fix for the disppearing deposits. stellaris already has a system for this, using the functions
save_deposits
and
restore_saved_deposits
. these functions call to
02_machine_age_effects.txt
at
common\scripted_effects\02_machine_age_effects.txt
. the fix is simple but tedious to do all at once. you need to make an if statement under the
save_deposits
function, saying that if the planet has deposit x, give it the planet flag deposit_x. then under
restore_saved_deposits
, add an if statement saying that if the planet has the planet_flag deposit_x, add deposit x to the planet then remove the flag. an example is:
if = { limit = { has_deposit = pme_d_cybernetics_uplink_facility } set_planet_flag = pme_d_cybernetics_uplink_facility }
for setting the flag under
save_deposits
, and
if = { limit = { has_planet_flag = pme_d_cybernetics_uplink_facility } add_deposit = pme_d_cybernetics_uplink_facility remove_planet_flag = pme_d_cybernetics_uplink_facility }
for restoring the deposit and removing the flag under
restore_saved_deposits
. this works because when the ecumenopolis (or other planet change that wipes deposits) is done the order of events should be, and almost always is: 1. save deposits, 2. clear deposits, 3. restore saved, 4. set needed flags, 5. change planet class.

Here's a pastebin to the fix. The entirety of the
02_machine_age_effects.txt
file is in there, with the only modifications being the changes for these deposits, so pasting the whole thing over a copy of the file should make it work properly
(side note: I apparently can't comment because I don't own the game myself technically, I'm borrowing it from another account lol)
https://pastebin.com/exFRQpJr
最后由 Ste/\m_Pnk42 编辑于; 1 月 1 日 上午 4:37
< >
正在显示第 1 - 5 条,共 5 条留言
Ste/\m_Pnk42 1 月 9 日 上午 9:13 
I've made this into its own mod since the dev is seemingly on break and can't add it, here you go:
https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?edit=true&id=3403998133
(still going through auto-review like all workshop items do, so it might be a few hours before it's visible)
最后由 Ste/\m_Pnk42 编辑于; 1 月 9 日 上午 9:13
Talhydras 1 月 29 日 上午 6:23 
Thanks so much for posting this. That's incredibly helpful!
Derelict Dawn  [开发者] 6 月 9 日 下午 6:05 
I looked into this workaround. I follow a rule for my mod where I never overwrite base game files for compatibility reasons. So unfortunately, unless I create a custom version of the arcology project, this isn't viable as a fix, at least as far as I can tell.
Ste/\m_Pnk42 8 月 13 日 下午 8:25 
it would be a fairly jank fix, but you could make a set of planetary decisions for this. the first one would set a flag on the planet for each mega-project it currently has, and the second one would give it each project for each flag it has.

The only issue I can see is the AI not knowing to use it properly, although it's probably possible to write a set of ai weights so that it always wants to click the first decision if it has a deposit but not the matching flag, but never clicks the first decision otherwise. meanwhile the second decision could have the AI insta click it if it ever has a flag for a project but not the deposit, and never click it otherwise.

Like I said this solution would be janky and probably require an annoyingly large amount of code writting.
Derelict Dawn  [开发者] 8 月 15 日 下午 5:47 
引用自 Ste/\m_Pnk42
it would be a fairly jank fix, but you could make a set of planetary decisions for this. the first one would set a flag on the planet for each mega-project it currently has, and the second one would give it each project for each flag it has.

The only issue I can see is the AI not knowing to use it properly, although it's probably possible to write a set of ai weights so that it always wants to click the first decision if it has a deposit but not the matching flag, but never clicks the first decision otherwise. meanwhile the second decision could have the AI insta click it if it ever has a flag for a project but not the deposit, and never click it otherwise.

Like I said this solution would be janky and probably require an annoyingly large amount of code writting.

I'll look into this as I have time, thanks.
< >
正在显示第 1 - 5 条,共 5 条留言
每页显示数: 1530 50