Hi Guys, I'm fairly new to LUA, the help files and other forum posts have helped me for all my previous hurdles, but I'm in need of a little help for my current project. I'm looking at tracking combat stats, damage done, healing done, damage taken, etc. I've got a fairly solid system going at the moment, but it uses a crapload of variables. I'd really like to get it all into tables but I just don't seem to be having any luck setting it up.
Each attack action shows up in this format which is easy enough to filter through to grab all the relevant names/numbers.
<(Combatant)><(Attack Name)> (Target) takes (Amount) damage!
(Taken from http://www.gammon.com.au/forum/?id=6036)
-----
I think a table structured like the one above would be exactly what i need, such as:
-----
Ideally i'd like to get the list of players to be dynamic, set via looking at a in-game party list, and then having a blank slate of stats for each party member.
Anyone up for giving me a hand on getting a small framework done?
Each attack action shows up in this format which is easy enough to filter through to grab all the relevant names/numbers.
<(Combatant)><(Attack Name)> (Target) takes (Amount) damage!
(Taken from http://www.gammon.com.au/forum/?id=6036)
-----
t = {
dwarf = { str = 22, dex = 23, wis = 18 },
human = { str = 20, dex = 20, wis = 20 },
elf = { str = 18, dex = 24, wis = 25 },
}
I think a table structured like the one above would be exactly what i need, such as:
-----
t = {
player1 = { damagedone = 111, damagehealed = 222, damagetaken = 333 },
player2 = { damagedone = 111, damagehealed = 222, damagetaken = 333 },
player3 = { damagedone = 111, damagehealed = 222, damagetaken = 333 },
}
Ideally i'd like to get the list of players to be dynamic, set via looking at a in-game party list, and then having a blank slate of stats for each party member.
Anyone up for giving me a hand on getting a small framework done?