1 |
finally sucessful change of units weapons...
|
1 |
finally sucessful change of units weapons...
|
2 |
all the pieces to complete remaining mods are now done..
|
2 |
all the pieces to complete remaining mods are now done..
|
3 |
posting this here to help people make there own mods
|
3 |
posting this here to help people make there own mods
|
4 |
\n
|
4 |
\n
|
5 |
[spoiler]
|
5 |
[spoiler]
|
|
|
6 |
\n
|
6 |
local targetNames = {
|
7 |
local targetNames = {
|
7 |
Mariner = true,
|
8 |
Mariner = true,
|
8 |
Hunter = true,
|
9 |
Hunter = true,
|
9 |
Mistral = true,
|
10 |
Mistral = true,
|
10 |
Corsair = true,
|
11 |
Corsair = true,
|
11 |
Siren = true,
|
12 |
Siren = true,
|
12 |
Envoy = true,
|
13 |
Envoy = true,
|
13 |
Cutter = true,
|
14 |
Cutter = true,
|
14 |
Zephyr = true,
|
15 |
Zephyr = true,
|
15 |
Seawolf = true,
|
16 |
Seawolf = true,
|
16 |
Shogun = true,
|
17 |
Shogun = true,
|
17 |
Reef = true,
|
18 |
Reef = true,
|
18 |
Scylla = true
|
19 |
Scylla = true
|
19 |
}
|
20 |
}
|
20 |
\n
|
21 |
\n
|
21 |
local newWeaponType = {
|
22 |
local newWeaponType = {
|
22 |
{
|
23 |
{
|
23 |
def = "newnewnew",
|
24 |
def = "newnewnew",
|
24 |
badTargetCategory = "FIXEDWING GUNSHIP",
|
25 |
badTargetCategory = "FIXEDWING GUNSHIP",
|
25 |
onlyTargetCategory = "SWIM FIXEDWING HOVER LAND SINK TURRET FLOAT SHIP GUNSHIP",
|
26 |
onlyTargetCategory = "SWIM FIXEDWING HOVER LAND SINK TURRET FLOAT SHIP GUNSHIP",
|
26 |
}
|
27 |
}
|
27 |
}
|
28 |
}
|
28 |
\n
|
29 |
\n
|
29 |
local newWeaponDef = {
|
30 |
local newWeaponDef = {
|
30 |
newnewnew = {
|
31 |
newnewnew = {
|
31 |
name = "Torpedo Missile",
|
32 |
name = "Torpedo Missile",
|
32 |
areaOfEffect = 32,
|
33 |
areaOfEffect = 32,
|
33 |
cegTag = "missiletrailyellow",
|
34 |
cegTag = "missiletrailyellow",
|
34 |
craterBoost = 1,
|
35 |
craterBoost = 1,
|
35 |
craterMult = 2,
|
36 |
craterMult = 2,
|
36 |
customparams = {
|
37 |
customparams = {
|
37 |
burst = Shared.BURST_RELIABLE,
|
38 |
burst = Shared.BURST_RELIABLE,
|
38 |
light_color = "1 0.6 0.2",
|
39 |
light_color = "1 0.6 0.2",
|
39 |
light_radius = 180,
|
40 |
light_radius = 180,
|
40 |
},
|
41 |
},
|
41 |
damage = {
|
42 |
damage = {
|
42 |
default = 130.01,
|
43 |
default = 130.01,
|
43 |
},
|
44 |
},
|
44 |
explosionGenerator = "custom:INGEBORG",
|
45 |
explosionGenerator = "custom:INGEBORG",
|
45 |
flightTime = 1.5,
|
46 |
flightTime = 1.5,
|
46 |
impulseBoost = 0,
|
47 |
impulseBoost = 0,
|
47 |
impulseFactor = 0.4,
|
48 |
impulseFactor = 0.4,
|
48 |
interceptedByShieldType = 1,
|
49 |
interceptedByShieldType = 1,
|
49 |
leadlimit = 1,
|
50 |
leadlimit = 1,
|
50 |
model = "wep_m_ajax.s3o",
|
51 |
model = "wep_m_ajax.s3o",
|
51 |
noSelfDamage = true,
|
52 |
noSelfDamage = true,
|
52 |
projectiles = 1,
|
53 |
projectiles = 1,
|
53 |
range = 232,
|
54 |
range = 232,
|
54 |
reloadtime = 2,
|
55 |
reloadtime = 2,
|
55 |
smokeTrail = true,
|
56 |
smokeTrail = true,
|
56 |
soundHit = "weapon/cannon/cannon_hit2",
|
57 |
soundHit = "weapon/cannon/cannon_hit2",
|
57 |
soundStart = "weapon/missile/missile_fire9",
|
58 |
soundStart = "weapon/missile/missile_fire9",
|
58 |
startVelocity = 140,
|
59 |
startVelocity = 140,
|
59 |
texture2 = "lightsmoketrail",
|
60 |
texture2 = "lightsmoketrail",
|
60 |
tolerance = 1000,
|
61 |
tolerance = 1000,
|
61 |
tracks = true,
|
62 |
tracks = true,
|
62 |
trajectoryHeight = 0.4,
|
63 |
trajectoryHeight = 0.4,
|
63 |
turnRate = 29000,
|
64 |
turnRate = 29000,
|
64 |
turret = true,
|
65 |
turret = true,
|
65 |
weaponAcceleration = 90,
|
66 |
weaponAcceleration = 90,
|
66 |
weaponType = "MissileLauncher",
|
67 |
weaponType = "MissileLauncher",
|
67 |
weaponVelocity = 220,
|
68 |
weaponVelocity = 220,
|
68 |
}
|
69 |
}
|
69 |
}
|
70 |
}
|
70 |
\n
|
71 |
\n
|
71 |
for name, ud in pairs(UnitDefs) do
|
72 |
for name, ud in pairs(UnitDefs) do
|
72 |
if targetNames[ud.name] and ud.speed and ud.speed > 0 then
|
73 |
if targetNames[ud.name] and ud.speed and ud.speed > 0 then
|
73 |
|
74 |
|
74 |
if not ud.weapondefs then
|
75 |
if not ud.weapondefs then
|
75 |
ud.weapondefs = {}
|
76 |
ud.weapondefs = {}
|
76 |
end
|
77 |
end
|
77 |
\n
|
78 |
\n
|
78 |
for defName, defData in pairs(newWeaponDef) do
|
79 |
for defName, defData in pairs(newWeaponDef) do
|
79 |
ud.weapondefs[defName] = defData
|
80 |
ud.weapondefs[defName] = defData
|
80 |
end
|
81 |
end
|
81 |
\n
|
82 |
\n
|
82 |
if not ud.weapons then
|
83 |
if not ud.weapons then
|
83 |
ud.weapons = {}
|
84 |
ud.weapons = {}
|
84 |
end
|
85 |
end
|
85 |
\n
|
86 |
\n
|
86 |
for _, weaponType in ipairs(newWeaponType) do
|
87 |
for _, weaponType in ipairs(newWeaponType) do
|
87 |
table.insert(ud.weapons, weaponType)
|
88 |
table.insert(ud.weapons, weaponType)
|
88 |
end
|
89 |
end
|
89 |
end
|
90 |
end
|
90 |
end
|
91 |
end
|
|
|
92 |
\n
|
91 |
\n
|
93 |
\n
|
92 |
[/spoiler]
|
94 |
[/spoiler]
|