as part of a mixture of a fun project and some 'serious' learning effort I'm writing yet another unit info. The main difference for me is that it is supposed to have more interactivity, i.e. a dedicated GUI, where one can not only browse information, but also display 'custom' selections. E.g. type an expression like 'Damage to Metal Ratio' and compare different units, etc.
I have relied heavily on existing code from pepeAmpere (mod stats 2 html, http://springfiles.com/spring/lua-scrip ... exporter-1) and I've had some looks in the past on the modinfo generation script from beherith and extended by abma and decay ( mod2html.py , http://imolarpg.dyndns.org/trac/balates ... od2html.py) plus checking the read/lua interface definitions in the spring code (e.g. https://github.com/spring/spring/blob/1 ... itDefs.cpp)
I can now read out most interesting things; I've written a widget that I load ingame, so that it's post-processed. This writes out a file, which I've formatted to be a python script that only defines dictionary items. A specific example looks like (the formatting comes from the fact that I process the lua script line per line and write the variables also line per line):
Code: Select all
armbanth = {
"gameMod" : "Balanced Annihilation V9.27",
"unitName" : "armbanth",
"unitID" : 30,
"humanName" : "Bantha",
"Description" : "Assault Mech",
"techLevel" : 6,
"metalCost" : 13537,
"energyCost" : 285812,
"buildTime" : 276057,
"hitpoints" : 62000,
"metalUpkeep" : 0,
"energyUpkeep" : 0,
"makesMetal" : "0",
"metalMake" : 0,
"energyMake" : 12,
"metalStorage" : 0,
"energyStorage" : 120,
"isBuilder" : False,
"isFactory" : False,
"buildSpeed" : 0,
"speed" : 49.5,
"acc" : 0.10,
"turnRate" : 1056,
"los" : 308.5,
"radarRange" : 0,
"sonarRange" : 0,
"flyAlt" : 0,
"idleAutoheal" : 12.5,
"radarRange" : 0,
"weapons" : {
"ImpulsionBlaster" : {
"weaponName" : "ImpulsionBlaster",
"weaponRange" : 465,
"weaponreload" : 0.69,
"weapondefDmg" :365,
"weaponlightDmg" : 365,
"weaponmediumDmg" : 365,
"weaponheavyDmg" : 365,
"weaponshipsDmg" : 365,
"weaponsubsDmg" : 5,
"weaponhoverDmg" : 365,
"weaponairDmg" : 365,
"weaponbaseDmg" : 365,
},
"DEEEEEEWWWMMM" : {
"weaponName" : "DEEEEEEWWWMMM",
"weaponRange" : 800,
"weaponreload" : 5,
"weapondefDmg" :4000,
"weaponlightDmg" : 4000,
"weaponmediumDmg" : 4000,
"weaponheavyDmg" : 4000,
"weaponshipsDmg" : 4000,
"weaponsubsDmg" : 5,
"weaponhoverDmg" : 4000,
"weaponairDmg" : 4000,
"weaponbaseDmg" : 4000,
},
"HeavyRockets" : {
"weaponName" : "HeavyRockets",
"weaponRange" : 800,
"weaponreload" : 2.75,
"weapondefDmg" :360,
"weaponlightDmg" : 360,
"weaponmediumDmg" : 360,
"weaponheavyDmg" : 360,
"weaponshipsDmg" : 360,
"weaponsubsDmg" : 5,
"weaponhoverDmg" : 360,
"weaponairDmg" : 360,
"weaponbaseDmg" : 360,
},
},
"armorClass" : "heavyunits",
"cloakCost" : 0}
how do I determine the correct pairing of damage a unit can deal against a certain other unit?
I guess it might have to do with the armorClass -- but this is "else" for basically most units. I can't find the place where a specific damage information is specified on the end of the damage recipient (victim, attacked unit, ...).
Any hints?
cheers,
christoph