I would like my map to have t1 powergens buildable underwater. Now I found a mod that makes every building buildable under water:
- Code: Select all
do
local OldModBlueprints = ModBlueprints
function ModBlueprints(all_bps)
OldModBlueprints(all_bps)
for id,bp in all_bps.Unit do
if table.find(bp.Categories, "INDIRECTFIRE") then
elseif table.find(bp.Categories, "DIRECTFIRE") then
elseif table.find(bp.Categories, "FACTORY") then
elseif table.find(bp.Categories, "ANTIAIR") then
elseif table.find(bp.Categories, "ANTINAVY") then
elseif table.find(bp.Categories, "INTELLIGENCE") then
elseif table.find(bp.Categories, "ANTIMISSILE") then
if table.find(bp.Categories, "SILO") then
bp.Physics.BuildOnLayerCaps.LAYER_Seabed = true
if bp.Wreckage then
bp.Wreckage.WreckageLayers.Seabed = true
end
end
elseif table.find(bp.Categories, "ANTIMISSILE") then
elseif table.find(bp.Categories, "AIRSTAGINGPLATFORM") then
elseif table.find(bp.Categories, "STRUCTURE") then
bp.Physics.BuildOnLayerCaps.LAYER_Seabed = true
if bp.Wreckage then
bp.Wreckage.WreckageLayers.Seabed = true
end
end
end
end
end
This would then be in mods/<modname>/hook/lua/system/Blueprints.lua
My question is, how could I do something similar, but integrated in the map, so no mod needs to be activated. I guess I would have to import something to my map_name_script.lua, but I don't have a clue what. Is it even possible to change unit blueprints at map start?