| 1 |
iv been trying for a long time now.. many many days.. many many ways..
|
1 |
iv been trying for a long time now.. many many days.. many many ways..
|
| 2 |
\n
|
2 |
\n
|
| 3 |
the code runs with no errors.. im confused as to what the issue is =/
|
3 |
the code runs with no errors.. im confused as to what the issue is =/
|
| 4 |
\n
|
4 |
\n
|
| 5 |
is it not possible to give the coms a new explosion that deforms the map using only tweakdefs or unit tweaks?
|
5 |
is it not possible to give the coms a new explosion that deforms the map using only tweakdefs or unit tweaks?
|
| 6 |
\n
|
6 |
\n
|
| 7 |
it feels almost asif these are overwritten somehow after i change them
|
7 |
it feels almost asif these are overwritten somehow after i change them
|
| 8 |
\n
|
8 |
\n
|
| 9 |
[spoiler]
|
|
|
| 10 |
\n
|
|
|
| 11 |
{{{
|
|
|
| 12 |
\n
|
|
|
| 13 |
local oldEcho = Spring.Echo
|
|
|
| 14 |
\n
|
|
|
| 15 |
local function CopyTable(orig, deep)
|
|
|
| 16 |
if type(orig) ~= "table" then return orig end
|
|
|
| 17 |
local copy = {}
|
|
|
| 18 |
for k, v in pairs(orig) do
|
|
|
| 19 |
copy[k] = (deep and type(v) == "table") and CopyTable(v, true) or v
|
|
|
| 20 |
end
|
|
|
| 21 |
return copy
|
|
|
| 22 |
end
|
|
|
| 23 |
\n
|
|
|
| 24 |
local function EchoHijack(str)
|
|
|
| 25 |
oldEcho(str)
|
|
|
| 26 |
\n
|
9 |
\n
|
| 27 |
if WeaponDefs and UnitDefs and UnitDefs["seismic"] and UnitDefs["seismic"].weapondefs and UnitDefs["seismic"].weapondefs.seismic_weapon then
|
|
|
| 28 |
local src = UnitDefs["seismic"]
|
|
|
| 29 |
local craterWeapon = CopyTable(src.weapondefs.seismic_weapon, true)
|
|
|
| 30 |
craterWeapon.name = "lakenuke"
|
|
|
| 31 |
craterWeapon.areaOfEffect = 1000
|
|
|
| 32 |
craterWeapon.craterAreaOfEffect = 1500
|
|
|
| 33 |
craterWeapon.craterBoost = 20000
|
|
|
| 34 |
craterWeapon.craterMult = 20000
|
|
|
| 35 |
craterWeapon.edgeEffectiveness = 1
|
|
|
| 36 |
craterWeapon.explosionGenerator = "custom:FLASHNUKE480"
|
|
|
| 37 |
craterWeapon.weaponType = "Cannon"
|
|
|
| 38 |
craterWeapon.damage = { default = 5000 }
|
|
|
| 39 |
craterWeapon.noSelfDamage = true
|
|
|
| 40 |
craterWeapon.customParams = {
|
|
|
| 41 |
smoothradius = "8000",
|
|
|
| 42 |
detachmentradius = "12000",
|
|
|
| 43 |
smoothmult = "1",
|
|
|
| 44 |
smoothexponent = "0.8",
|
|
|
| 45 |
movestructures = "1",
|
|
|
| 46 |
}
|
|
|
| 47 |
\n
|
|
|
| 48 |
local valid = {
|
|
|
| 49 |
dynassault1 = true,
|
|
|
| 50 |
dynsupport1 = true,
|
|
|
| 51 |
dynstrike1 = true,
|
|
|
| 52 |
dynrecon1 = true,
|
|
|
| 53 |
}
|
|
|
| 54 |
\n
|
|
|
| 55 |
for name, ud in pairs(UnitDefs) do
|
|
|
| 56 |
if valid[name] then
|
|
|
| 57 |
ud.weapondefs = ud.weapondefs or {}
|
|
|
| 58 |
ud.weapondefs.lakenuke = craterWeapon
|
|
|
| 59 |
\n
|
|
|
| 60 |
ud.weapons = ud.weapons or {}
|
|
|
| 61 |
table.insert(ud.weapons, { def = "lakenuke", onlyTargetCategory = [[NONE]] })
|
|
|
| 62 |
\n
|
|
|
| 63 |
ud.explodeAs = "lakenuke"
|
|
|
| 64 |
ud.selfDestructAs = "lakenuke"
|
|
|
| 65 |
ud.myGravity = 0.1
|
|
|
| 66 |
\n
|
|
|
| 67 |
ud.customParams = ud.customParams or {}
|
|
|
| 68 |
ud.customParams.stats_show_death_explosion = true
|
|
|
| 69 |
\n
|
|
|
| 70 |
oldEcho("Added lakenuke explosion to unit: " .. name)
|
|
|
| 71 |
end
|
|
|
| 72 |
end
|
|
|
| 73 |
Spring.Echo = oldEcho
|
|
|
| 74 |
end
|
|
|
| 75 |
end
|
|
|
| 76 |
\n
|
|
|
| 77 |
Spring.Echo = EchoHijack
|
|
|
| 78 |
\n
|
|
|
| 79 |
}}}
|
|
|
| 80 |
[/spoiler]
|
|
|