I'll sum up what's the problem here from my point of view. The wiki gives the following information about defining the armordefs.lua:
You get told prior to Spring v95 the armordefs were defined this way:
Code: Select all
if not(Game) or not(Game.version) then
for categoryName, categoryTable in pairs(armorDefs) do
local t = {}
for _, unitName in pairs(categoryTable) do
t[unitName] = 1
end
armorDefs[categoryName] = t
end
end
return armorDefs
Code: Select all
local armorDefs = {
tanks = {
"supertank",
"megatank",
},
infantry = {
"dude",
},
}
Code: Select all
...
damage = {
infantry = 60,
tanks = 5,
},
...
Disregarding that I don't think the armor categories by itself are in any way kludgy or messy - what a new user bascially is told here is that Spring's armor system is dysfunctional as it sometimes simply doesn't apply the correct damage values. I'd like to have a confirmation if this is true or not because I still vaguely remember smoth doing some LUA magic and that must have been like 10 years ago. So from my point of view I'd say that this issue was fixed with the syntax change in v95 at the latest. Yet still I tried to look this up and I found a little bit here and there but what I saw wasn't really about fixing a broken feature but rather changing the way the armor definition works i.e. the discussions mostly were about writing a LUA replacement for the armordefs that would look up all the unit definitions and get a customparameter from there so that you would define the armor class in the unit definition file instead of having this seperate armordefs file you write the unitnames into manually. I also had a look at the recent Evo and Zero K githubs and while especially what was done for Evo might simply scare off any newbie ( ), the Zero K way of using armordefs also didn't "fix" anything but it was rather about applying modifiers like 1.5 x damage against shields that are automatically applied...Spring armor categories are kludgy and messy because they are extremely inefficient. There are a lot of inconsistencies. In some cases, only the first category listed will be obeyed. At other times in that same list, all will be obeyed.
In other words, do not rely on categories too heavily, because you will end up quite frustrated with the results.
You should look at smoth's armor system code. Evo uses it rather extensively.
So to sum this up I think that in contrast to what's said in the Wiki, the armordefs feature is not dysfunct and LUA implementations don't fix the feature itself but rather implement a different way situational damage differences are applied. It would be great to have some official statement considering the functionality though so the Wiki can be fixed and won't confuse anyone else again in the future.
As a final note - I think I also found another outdated Wiki entry considering the LUA access to the armor table:
Code: Select all
table Game.armorTypes (bidirectional)
example: {
[1] = amphibious, [2] = anniddm, [3] = antibomber,
[4] = antifighter, [5] = antiraider, [6] = atl,
[7] = blackhydra, [8] = bombers, [9] = commanders,
[10] = crawlingbombs, ...
["amphibious"] = 1, ["anniddm"] = 2, ["antibomber"] = 3
["antifighter"] = 4, ["antiraider"] = 5, ["atl"] = 6
["blackhydra"] = 7, ["bombers"] = 8, ["commanders"] = 9
["crawlingbombs"]= 10, ...
}