Enable se_allow_in_space on another mod's building

Place to get help with not working mods / modding interface.
Post Reply
gogglebot
Manual Inserter
Manual Inserter
Posts: 2
Joined: Thu Aug 13, 2020 5:48 pm
Contact:

Enable se_allow_in_space on another mod's building

Post by gogglebot »

Howdy, I'd like to make a small compatibility mod to enable (set = to true) on some buildings added by another mod. I believe I can check that a mod is installed by doing

Code: Select all

if (mods or script.active_mods) ["UndergroundTanks"] then {}
but after that I'm lost.

The buildings are all extra fluid tanks added by UndergroundTanks.

As the title says Id like to just modify these buildings to enable them to work in Space Exploration's space surfaces, which I believe is done with the `se_allow_in_space` attribute.

Thank you!

Bilka
Factorio Staff
Factorio Staff
Posts: 3139
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Enable se_allow_in_space on another mod's building

Post by Bilka »

As far as I'm aware, the flag is applied in data stage, so this code should work:

Code: Select all

if mods["UndergroundTanks"] then
  data.raw["storage-tank"]["6x6-underground-tank"].se_allow_in_space = true
  data.raw["storage-tank"]["5x5-underground-tank"].se_allow_in_space = true
  data.raw["storage-tank"]["4x4-underground-tank"].se_allow_in_space = true
end
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

Post Reply

Return to “Modding help”