1 |
confirmed the issue is dynamic weapons overiding weapons changes after my scripts.. even with echo hijacks i could not get it to work.. i did get it to work on a duck but i could already modify that.. so full mods is the only known way.
|
1 |
confirmed the issue is dynamic weapons overiding weapons changes after my scripts.. even with echo hijacks i could not get it to work.. i did get it to work on a duck but i could already modify that.. so full mods is the only known way.
|
|
|
2 |
\n
|
|
|
3 |
[spoiler]
|
|
|
4 |
{{{
|
|
|
5 |
local oldEcho = Spring.Echo
|
|
|
6 |
\n
|
|
|
7 |
local function CopyTable(orig, deep)
|
|
|
8 |
if type(orig) ~= "table" then return orig end
|
|
|
9 |
local copy = {}
|
|
|
10 |
for k, v in pairs(orig) do
|
|
|
11 |
copy[k] = (deep and type(v) == "table") and CopyTable(v, true) or v
|
|
|
12 |
end
|
|
|
13 |
return copy
|
|
|
14 |
end
|
|
|
15 |
\n
|
|
|
16 |
local function EchoHijack(str)
|
|
|
17 |
oldEcho(str)
|
|
|
18 |
\n
|
|
|
19 |
if WeaponDefs and UnitDefs and UnitDefs["seismic"] and UnitDefs["seismic"].weapondefs and UnitDefs["seismic"].weapondefs.seismic_weapon then
|
|
|
20 |
local src = UnitDefs["seismic"]
|
|
|
21 |
local craterWeapon = CopyTable(src.weapondefs.seismic_weapon, true)
|
|
|
22 |
craterWeapon.name = "lakenuke"
|
|
|
23 |
craterWeapon.areaOfEffect = 1000
|
|
|
24 |
craterWeapon.craterAreaOfEffect = 1500
|
|
|
25 |
craterWeapon.craterBoost = 20000
|
|
|
26 |
craterWeapon.craterMult = 20000
|
|
|
27 |
craterWeapon.edgeEffectiveness = 1
|
|
|
28 |
craterWeapon.explosionGenerator = "custom:FLASHNUKE480"
|
|
|
29 |
craterWeapon.weaponType = "Cannon"
|
|
|
30 |
craterWeapon.damage = { default = 5000 }
|
|
|
31 |
craterWeapon.noSelfDamage = true
|
|
|
32 |
craterWeapon.customParams = {
|
|
|
33 |
smoothradius = "8000",
|
|
|
34 |
detachmentradius = "12000",
|
|
|
35 |
smoothmult = "1",
|
|
|
36 |
smoothexponent = "0.8",
|
|
|
37 |
movestructures = "1",
|
|
|
38 |
}
|
|
|
39 |
\n
|
|
|
40 |
local valid = {
|
|
|
41 |
dynassault1 = true,
|
|
|
42 |
dynsupport1 = true,
|
|
|
43 |
dynstrike1 = true,
|
|
|
44 |
dynrecon1 = true,
|
|
|
45 |
}
|
|
|
46 |
\n
|
|
|
47 |
for name, ud in pairs(UnitDefs) do
|
|
|
48 |
if valid[name] then
|
|
|
49 |
ud.weapondefs = ud.weapondefs or {}
|
|
|
50 |
ud.weapondefs.lakenuke = craterWeapon
|
|
|
51 |
\n
|
|
|
52 |
ud.weapons = ud.weapons or {}
|
|
|
53 |
table.insert(ud.weapons, { def = "lakenuke", onlyTargetCategory = [[NONE]] })
|
|
|
54 |
\n
|
|
|
55 |
ud.explodeAs = "lakenuke"
|
|
|
56 |
ud.selfDestructAs = "lakenuke"
|
|
|
57 |
ud.myGravity = 0.1
|
|
|
58 |
\n
|
|
|
59 |
ud.customParams = ud.customParams or {}
|
|
|
60 |
ud.customParams.stats_show_death_explosion = true
|
|
|
61 |
\n
|
|
|
62 |
oldEcho("Added lakenuke explosion to unit: " .. name)
|
|
|
63 |
end
|
|
|
64 |
end
|
|
|
65 |
Spring.Echo = oldEcho
|
|
|
66 |
end
|
|
|
67 |
end
|
|
|
68 |
\n
|
|
|
69 |
Spring.Echo = EchoHijack
|
|
|
70 |
}}}
|
|
|
71 |
[/spoiler]
|