Back to List
Maintained by

SmokeDragon
Last updated 2 months ago
Created 8 months ago
download JSON metadata of great_lakes_factory
great_lakes_factory
PLAY THIS MOD
Maintained by

Last updated 2 months ago
Created 8 months ago
download JSON metadata of great_lakes_factory
getting closer but cant seem to get the holes to be huge.. will keep working on this..
if somone knows a better way to make coms create huge lakes on death then please let me know as it will help me..
i know if i directly modify weapon defs it is easy but i prefer for the moment to stick with tweakdefs if possible.
[Spoiler]
if somone knows a better way to make coms create huge lakes on death then please let me know as it will help me..
i know if i directly modify weapon defs it is easy but i prefer for the moment to stick with tweakdefs if possible.
[Spoiler]
local validUnitNames = {
dynrecon1 = true,
dynstrike1 = true,
dynsupport1 = true,
dynassault1 = true,
}
Spring.Echo("[LakeNuke] Crater test weapon script loaded")
local function DeepCopyTable(t)
if type(t) ~= "table" then return t end
local copy = {}
for k, v in pairs(t) do
copy[k] = DeepCopyTable(v)
end
return copy
end
local function MakeClonedWeaponDef()
local srcUnit = UnitDefs["jumpbomb"]
if not srcUnit or not srcUnit.weapondefs or not srcUnit.weapondefs.jumpbomb_death then
Spring.Echo("[LakeNuke] ERROR: Source weapon 'jumpbomb_death' not found!")
return nil
end
local cloned = DeepCopyTable(srcUnit.weapondefs.jumpbomb_death)
cloned.name = "Lake Make"
cloned.areaOfEffect = 4000
cloned.craterAreaOfEffect = 4000
cloned.craterBoost = 1000
cloned.craterMult = 1250
cloned.edgeEffectiveness = 1
cloned.explosionGenerator = "custom:NUKE_150"
cloned.explosionSpeed = 10000
cloned.impulseBoost = 10
cloned.impulseFactor = -10
cloned.soundHit = "explosion/ex_ultra1"
cloned.damage = { default = 9500 }
cloned.range = 300
cloned.reloadtime = 5
cloned.weaponType = "Cannon"
cloned.customParams = {
burst = "1",
lups_explodelife = 1.5,
smoothradius = "6000",
detachmentradius = "10000",
smoothmult = "1",
smoothexponent = "0.8",
movestructures = "1",
}
Spring.Echo("[LakeNuke] Created cloned weapon: Lake Make")
return cloned
end
local function SetWeaponDefForUnit(ud, unitName)
Spring.Echo("[LakeNuke] Assigning weapon to unit: " .. unitName)
local weaponDef = MakeClonedWeaponDef()
if not weaponDef then
Spring.Echo("[LakeNuke] Failed to assign weapon to: " .. unitName)
return
end
ud.weapondefs = ud.weapondefs or {}
ud.weapondefs.lakenuke = weaponDef
ud.weapons = ud.weapons or {}
table.insert(ud.weapons, {
def = "lakenuke",
onlyTargetCategory = [[LAND]],
})
Spring.Echo("[LakeNuke] Weapon attached to unit: " .. unitName)
end
for unitName, ud in pairs(UnitDefs) do
local isValid = validUnitNames[unitName]
local hasMetalCost = ud.metalcost and ud.metalcost > 0
local validSelfDestruct = not (ud.selfDestructCountdown and ud.selfDestructCountdown < 1)
Spring.Echo("[LakeNuke] Checking unit: " .. unitName)
Spring.Echo(" - isValid: " .. tostring(isValid))
Spring.Echo(" - hasMetalCost: " .. tostring(hasMetalCost))
Spring.Echo(" - validSelfDestruct: " .. tostring(validSelfDestruct))
if isValid and hasMetalCost and validSelfDestruct then
Spring.Echo("[LakeNuke] Unit is valid, applying changes: " .. unitName)
SetWeaponDefForUnit(ud, unitName)
ud.explodeas = "lakenuke"
ud.selfdestructas = "lakenuke"
ud.myGravity = 0.1
ud.customParams = ud.customParams or {}
ud.customParams.stats_show_death_explosion = true
Spring.Echo("[LakeNuke] Successfully modified: " .. unitName)
else
Spring.Echo("[LakeNuke] Skipping unit: " .. unitName)
end
end
Zero-K is a free real time strategy (RTS), that aims to be the
best open source multi-platform strategy game available :-)
