Stable Foundations

by Dummiez

Your buildings and other structures now gain extra damage resistance, productivity, speed and efficiency when built over stone and concrete tiles! Can also be used to reinforce vehicles, robots and players as well as adjusting the additional foundation stats to your liking. Easily configurable/mod compatible.

Tweaks
22 hours ago
1.1 - 2.0
7.73K
Combat Armor Manufacturing Cheats

g ✅ For those wanting to use this with Space Exploration in 2.0

4 months ago

Go into Space Exploration's rar file, then "scripts", then "beacon.lua". Find the line

local beacon_prototypes = prototypes.get_entity_filtered{{filter="type", type="beacon"}}

And change "beacon" to "bacon"

And then you can have beacons and Stable Foundations all you want.

3 months ago
(updated 3 months ago)

Do note - this fully disables the beacon overload mechanic, and also still actually doesn't work since SE also makes all beacons have 0% effect (using the base game potency scaling) if there is more than one beacon affecting a machine. To keep beacon overload but make it so having a beacon and a foundation on a machine doesn't just nullify both, you can do the following instead:

For that same beacon.lua file in Space Exploration Dragonchampion mentioned, instead of changing the filter line, find the following for loop 3 or 4 lines below that filter one:

for name, prototype in pairs(beacon_prototypes) do
  mapping[name] = prototype.get_supply_area_distance()
end

Then, just put the mapping[name] line in the following if statement:

for name, prototype in pairs(beacon_prototypes) do
  if prototype.get_supply_area_distance() ~= 0 then
    mapping[name] = prototype.get_supply_area_distance()
  end
end

That will make beacon overload ignore any beacon that has 0 distribution range (so would only affect entities it physically overlaps), but still work for normal beacons. The hidden beacon this mod adds has 0 distribution range.

To disable two beacons nullifying each other effects, go to entity.lua in SE's protoypes\phase-3\ folder, and at the very bottom find the line

beacon.profile = {1, 0}

and change it to

beacon.profile = {1, 1}

Since we left beacon overload on via scripts, it doesn't matter that technically would make 2 beacons hit a thing for double effect, since that would overload the machine and shut it down. Will mean placing a beacon in range of a machine on foundation won't shut the foundation bonus off though.

Lastly, for SE in particular, it will add a collision layer to the hidden beacons, meaning you won't be able to upgrade buildings in place with foundation, without ripping that foundation out first. You can fix that by opening Stable Foundations, and adding the following lines to the list of attributes it adds when defining the beacon:

se_allow_in_space = true,
se_allow_productivity_in_space = true

Don't forget to add a comma to the line before, all but the last line between the {} brackets needs to end in a comma (its a table). That will make SE leave the beacons alone when it decides to either make space variants of buildings, or just make everything else not be able to be placed in space (and so collide with every other thing that cannot be placed in space).

13 days ago

which file in Stable Foundations and give approximate location for the code in said file please (im having trouble finding where to put the "se_allow_in_space = true,
se_allow_productivity_in_space = true" line

11 days ago

In data-final-fixes, at the bottom of the "local tile_beacon" section and all the declarations of the beacon's stats there, put those two lines at the bottom of the list. Around line 47/48 for me, but I am still using 1.3.1 of Stable Foundations so that might have moved a bit.

a day ago

Stable Foundations should now have beacon overload compatibilities fixed as of 1.5.1

a day ago

I've sent a bug report to SE to maybe enable an option for a mod to exclude a beacon from their Beacon Overload effect, or perhaps just ignore beacons with zero supply range like I listed earlier. If that goes through that means Stable Foundations, with the changes in 1.5.1, should just work with SE without any more end-user modifications needed!

Also, not sure if it was intended, but 1.5.1 still has a "-- TEMPORARY DEBUG: log the patched profiles for SE beacons" block in it. Given the TEMPORARY DEBUG part I imagine it might not be intentional for it to be hanging around still?

23 hours ago

Yeah I removed it in version 1.5.2, the 1.5.1 still has some issues with rebalance beacons but should be fixed when I push the update. Just holding off for now since I'm still running more tests

22 hours ago

Okay I also found out a funny behavior where beacons were overloading each other, should be fixed in 1.5.2

22 hours ago

Oh thank heavens I was just noticing that and trying to find why, guess I won't report it.

For Space Exploration, it also has some weird collision code where it generates extra variants of any building that can accept prod, to make a spaced version that can't (unless the building has the aforementioned se_allow_productivity_in_space = true) setting. Normally not an issue, but this mod iterating through and making all prototypes accept prod makes most things end up getting a spaced variant, and notably also makes the SE code wig out and make grounded variants of a lot of spaced buildings and spaced variants of grounded buildings and its a whole mess of like tripled up prototypes. Can especially break blueprints and some more complicated entities other mods add (was looking weird with elevated pipes, for instance, which are technically sorta furnaces in the back end so got hit by the effect additions).

I've been adding to the "Go through existing models and apply extra effects" section of the function to update allowed effects to just add that allow-prod setting to anything the mod adds prod to to avoid that, but it means some things will accept prod in space when they shouldn't. There might be something to do to either separate prod effect adding out and not apply it to everything like we do speed and efficiency, or maybe just add that effect if SE is enabled and accept the results (most Space recipes in SE don't accept prod anyways so it usually doesn't matter if the machines themselves do, it just would let chains be done in space with prod that shouldn't be).

Expanding the blacklist defaults could also be an option, I could try compiling a bigger SE specific list than just the engines if you want. (engines breaking from the effects was this same issue - the grounded and spaced variants didn't count as bulkheads like they normally do)

22 hours ago
(updated 21 hours ago)

If this mod is generating too many variants you could probably toggle the 'Building foundation bonus effects' and it will use the vanilla assigned effects and just whitelist the buildings you want from there

New response