| 1 |
i dont understand why its giving me weapon name errors =/
|
1 |
i dont understand why its giving me weapon name errors =/
|
| 2 |
\n
|
2 |
\n
|
| 3 |
}
}
}
|
3 |
{
{
{
|
| 4 |
\n
|
4 |
\n
|
| 5 |
Defs-Parser: [pcall] error 2 ("[string "gamedata/defs.lua"]:38: [string "gamedata/defs.lua"]:26: error = 2, gamedata/weaponDefs.lua, error = 2, gamedata/weapondefs_post.lua, [string "gamedata/weapondefs_post.lua"]:462: attempt to index field 'name' (a nil value)
|
5 |
Defs-Parser: [pcall] error 2 ("[string "gamedata/defs.lua"]:38: [string "gamedata/defs.lua"]:26: error = 2, gamedata/weaponDefs.lua, error = 2, gamedata/weapondefs_post.lua, [string "gamedata/weapondefs_post.lua"]:462: attempt to index field 'name' (a nil value)
|
| 6 |
\n
|
6 |
\n
|
| 7 |
{
{
{
|
7 |
}
}
}
|
| 8 |
\n
|
8 |
\n
|
| 9 |
[spoiler]
|
9 |
[spoiler]
|
| 10 |
\n
|
10 |
\n
|
| 11 |
{{{
|
11 |
{{{
|
| 12 |
\n
|
12 |
\n
|
| 13 |
CopyTable = Spring and Spring.Utilities and Spring.Utilities.CopyTable
|
13 |
CopyTable = Spring and Spring.Utilities and Spring.Utilities.CopyTable
|
| 14 |
if not CopyTable then
|
14 |
if not CopyTable then
|
| 15 |
function CopyTable(tbl, deep)
|
15 |
function CopyTable(tbl, deep)
|
| 16 |
if type(tbl) ~= "table" then return tbl end
|
16 |
if type(tbl) ~= "table" then return tbl end
|
| 17 |
local copy = {}
|
17 |
local copy = {}
|
| 18 |
for k,v in pairs(tbl) do
|
18 |
for k,v in pairs(tbl) do
|
| 19 |
if deep and type(v) == "table" then
|
19 |
if deep and type(v) == "table" then
|
| 20 |
copy[k] = CopyTable(v, true)
|
20 |
copy[k] = CopyTable(v, true)
|
| 21 |
else
|
21 |
else
|
| 22 |
copy[k] = v
|
22 |
copy[k] = v
|
| 23 |
end
|
23 |
end
|
| 24 |
end
|
24 |
end
|
| 25 |
return copy
|
25 |
return copy
|
| 26 |
end
|
26 |
end
|
| 27 |
end
|
27 |
end
|
| 28 |
\n
|
28 |
\n
|
| 29 |
local function MergeTable(target, source)
|
29 |
local function MergeTable(target, source)
|
| 30 |
for k, v in pairs(source) do
|
30 |
for k, v in pairs(source) do
|
| 31 |
if type(v) == "table" then
|
31 |
if type(v) == "table" then
|
| 32 |
if type(target[k]) ~= "table" then
|
32 |
if type(target[k]) ~= "table" then
|
| 33 |
target[k] = {}
|
33 |
target[k] = {}
|
| 34 |
end
|
34 |
end
|
| 35 |
MergeTable(target[k], v)
|
35 |
MergeTable(target[k], v)
|
| 36 |
else
|
36 |
else
|
| 37 |
target[k] = v
|
37 |
target[k] = v
|
| 38 |
end
|
38 |
end
|
| 39 |
end
|
39 |
end
|
| 40 |
\n
|
40 |
\n
|
| 41 |
if target.weaponDefs then
|
41 |
if target.weaponDefs then
|
| 42 |
for wn, wd in pairs(target.weaponDefs) do
|
42 |
for wn, wd in pairs(target.weaponDefs) do
|
| 43 |
wd.name = wd.name or wn
|
43 |
wd.name = wd.name or wn
|
| 44 |
end
|
44 |
end
|
| 45 |
end
|
45 |
end
|
| 46 |
end
|
46 |
end
|
| 47 |
\n
|
47 |
\n
|
| 48 |
for name, changes in pairs(tweaks) do
|
48 |
for name, changes in pairs(tweaks) do
|
| 49 |
local u = UnitDefs[name]
|
49 |
local u = UnitDefs[name]
|
| 50 |
if u then
|
50 |
if u then
|
| 51 |
MergeTable(u, changes)
|
51 |
MergeTable(u, changes)
|
| 52 |
end
|
52 |
end
|
| 53 |
end
|
53 |
end
|
| 54 |
\n
|
54 |
\n
|
| 55 |
local exclude = {dynstrike1=true,dynrecon1=true,dynassault1=true,dynsupport1=true,athena=true,funnelweb=true,striderhub=true,staticmex=true,energywind=true}
|
55 |
local exclude = {dynstrike1=true,dynrecon1=true,dynassault1=true,dynsupport1=true,athena=true,funnelweb=true,striderhub=true,staticmex=true,energywind=true}
|
| 56 |
local include = {dynstrike1=true,dynrecon1=true,dynassault1=true,dynsupport1=true}
|
56 |
local include = {dynstrike1=true,dynrecon1=true,dynassault1=true,dynsupport1=true}
|
| 57 |
local buildList = { "staticantinuke","staticmex","energywind","staticstorage","energypylon",
|
57 |
local buildList = { "staticantinuke","staticmex","energywind","staticstorage","energypylon",
|
| 58 |
"staticcon","staticrearm","turretlaser","turretmissile","turretriot",
|
58 |
"staticcon","staticrearm","turretlaser","turretmissile","turretriot",
|
| 59 |
"turretemp","turretheavylaser","turretaaclose","turretaalaser","turretimpulse",
|
59 |
"turretemp","turretheavylaser","turretaaclose","turretaalaser","turretimpulse",
|
| 60 |
"turrettorp","staticshield","staticradar","staticjammer","factorycloak",
|
60 |
"turrettorp","staticshield","staticradar","staticjammer","factorycloak",
|
| 61 |
"factoryshield","factoryveh","factoryhover","factorygunship","factoryplane",
|
61 |
"factoryshield","factoryveh","factoryhover","factorygunship","factoryplane",
|
| 62 |
"factoryspider","factoryjump","factorytank","factoryamph","factoryship",
|
62 |
"factoryspider","factoryjump","factorytank","factoryamph","factoryship",
|
| 63 |
"athena","plateamph","platecloak","plategunship","platehover","platejump",
|
63 |
"athena","plateamph","platecloak","plategunship","platehover","platejump",
|
| 64 |
"plateplane","plateshield","plateship","platespider","platetank","plateveh",
|
64 |
"plateplane","plateshield","plateship","platespider","platetank","plateveh",
|
| 65 |
}
|
65 |
}
|
| 66 |
\n
|
66 |
\n
|
| 67 |
for _, ud in pairs(UnitDefs) do
|
67 |
for _, ud in pairs(UnitDefs) do
|
| 68 |
if ud.metalCost then
|
68 |
if ud.metalCost then
|
| 69 |
ud.metalCost = math.floor(ud.metalCost * 0.5)
|
69 |
ud.metalCost = math.floor(ud.metalCost * 0.5)
|
| 70 |
end
|
70 |
end
|
| 71 |
if ud.metalCost and ud.metalCost < 500 and ud.name and not exclude[ud.name] then
|
71 |
if ud.metalCost and ud.metalCost < 500 and ud.name and not exclude[ud.name] then
|
| 72 |
ud.corpse = nil
|
72 |
ud.corpse = nil
|
| 73 |
ud.featureDefs = nil
|
73 |
ud.featureDefs = nil
|
| 74 |
end
|
74 |
end
|
| 75 |
if ud.name and include[ud.name] then
|
75 |
if ud.name and include[ud.name] then
|
| 76 |
ud.buildoptions = buildList
|
76 |
ud.buildoptions = buildList
|
| 77 |
end
|
77 |
end
|
| 78 |
end
|
78 |
end
|
| 79 |
\n
|
79 |
\n
|
| 80 |
local storageUnits = { "plateamph","platecloak","plategunship","platehover","platejump","plateplane","plateshield","plateship","platespider","platetank","plateveh","factorycloak","factoryshield","factoryveh","factoryhover","factorygunship","factoryplane","factoryspider","factoryjump","factorytank","factoryamph","factoryship","staticstorage" }
|
80 |
local storageUnits = { "plateamph","platecloak","plategunship","platehover","platejump","plateplane","plateshield","plateship","platespider","platetank","plateveh","factorycloak","factoryshield","factoryveh","factoryhover","factorygunship","factoryplane","factoryspider","factoryjump","factorytank","factoryamph","factoryship","staticstorage" }
|
| 81 |
for _, name in ipairs(storageUnits) do
|
81 |
for _, name in ipairs(storageUnits) do
|
| 82 |
local u = UnitDefs[name]
|
82 |
local u = UnitDefs[name]
|
| 83 |
if u then
|
83 |
if u then
|
| 84 |
u.energystorage = 8000
|
84 |
u.energystorage = 8000
|
| 85 |
u.metalstorage = 8000
|
85 |
u.metalstorage = 8000
|
| 86 |
end
|
86 |
end
|
| 87 |
end
|
87 |
end
|
| 88 |
\n
|
88 |
\n
|
| 89 |
local constructors = { "cloakcon","shieldcon","vehcon","hovercon","gunshipcon","planecon","spidercon","jumpcon","tankcon","amphcon","shipcon","dynrecon1","dynstrike1","dynsupport1","dynassault1" }
|
89 |
local constructors = { "cloakcon","shieldcon","vehcon","hovercon","gunshipcon","planecon","spidercon","jumpcon","tankcon","amphcon","shipcon","dynrecon1","dynstrike1","dynsupport1","dynassault1" }
|
| 90 |
for _, name in ipairs(constructors) do
|
90 |
for _, name in ipairs(constructors) do
|
| 91 |
local u = UnitDefs[name]
|
91 |
local u = UnitDefs[name]
|
| 92 |
if u then
|
92 |
if u then
|
| 93 |
u.buildoptions = buildList
|
93 |
u.buildoptions = buildList
|
| 94 |
end
|
94 |
end
|
| 95 |
end
|
95 |
end
|
| 96 |
\n
|
96 |
\n
|
| 97 |
local cloakers = { "energyfusion","energygeo","energyheavygeo","energysingu" }
|
97 |
local cloakers = { "energyfusion","energygeo","energyheavygeo","energysingu" }
|
| 98 |
for _, name in ipairs(cloakers) do
|
98 |
for _, name in ipairs(cloakers) do
|
| 99 |
local u = UnitDefs[name]
|
99 |
local u = UnitDefs[name]
|
| 100 |
if u then
|
100 |
if u then
|
| 101 |
u.canCloak = true
|
101 |
u.canCloak = true
|
| 102 |
u.cloakCost = 0
|
102 |
u.cloakCost = 0
|
| 103 |
u.cloakCostMoving = 0
|
103 |
u.cloakCostMoving = 0
|
| 104 |
u.initCloaked = true
|
104 |
u.initCloaked = true
|
| 105 |
u.minCloakDistance = 200
|
105 |
u.minCloakDistance = 200
|
| 106 |
end
|
106 |
end
|
| 107 |
end
|
107 |
end
|
| 108 |
\n
|
108 |
\n
|
| 109 |
}}}
|
109 |
}}}
|
| 110 |
\n
|
110 |
\n
|
| 111 |
[/spoiler]
|
111 |
[/spoiler]
|