I see this in the unitdefs in CA, and I wonder what's going on exactly. The core reason why I'm asking is I'd like to adjust/control the damage like what this tidbit of script implies, but I basically don't want to be limited to planes and subs. An example is that I'd like a shot to do more damage to a "mech" than it would a "tank."
I wonder how I can control this, because I don't see default, planes or subs as the Category (the stuff like LAND and FIXEDWING in the CA scripts) and I'm wondering how the engine knows exactly what a plane and sub is. Are these hardcoded parts of the engine and I'll just have to make do, or is there an easy way for me to assign different damages to category's like tanks and mechs, and how would I exactly assign my tanks and mechs to these roles so it'll all work in the end?
As seen in the file, CA's armordefs.lua automatically assigns units to the PLANES armor category based on the canFly tag and the ELSE category if they don't have another armorcat, all other categories are manually defined.
If for whatever reason you don't want to use armordefs.lua, you can simply place a file named armor.txt in the root of the mod archive, for instance:
In my unit def, I then set the attack values in a way so I could easily see if it was doing what I wanted it to. Here's an example:
Code:
damage = { default = 9999999, Mech = 1,
},
So if the unit got killed in one blow, I'd know it didn't work. Well, it didn't work. I then tried the armordefs.lua but that didn't work either and I have a feeling I just did it wrong. So I'm more interested in getting the .txt to work, just because it seems simpler, and I'm okay with simple. I like simple.
You should really embrace lua if you want to go far with Spring modding. Armor.txt in particular is an historical peculiarity which should never have happened.
(The only thing possibly wrong here, is that armourDefs may expect a named map, because trepan didn't bother to ask a modder how armor.txt worked when he converted it to lua. I guess i should really test that before posting this. I'll go test it now.)
Last edited by FLOZi on 20 Mar 2010, 01:50, edited 1 time in total.
for categoryName, categoryTable in pairs(armorDefs) do local t = {} for _, unitName in pairs(categoryTable) do t[unitName] = 1 end armorDefs[categoryName] = t end
Quick question, is it possible for a unit to belong to two different armor types? Sort of like the Categories, say a unit has "Tank" and "Mech" armor, what would happen? Would it take both the Tank and Mech damage values, or just the Tank or Mech damage values, depending on what the weapon is? I'm asking this mostly out of curiousity, I may or may not use it.
I'm pretty sure this has been apparent to those who've helped me, but I have no background in all of this. No coding background, no idea how programs or any that works. I don't know anything about lua, other than what I could figure out in unit defs and animation scripts. What may seem obvious to you guys would go right by me unnoticed. I appreciate the help.
Users browsing this forum: No registered users and 1 guest
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum