Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- So here is an explanation. I am trying to make a visual limb damage tracker, what this script is supposed to do is alter the value of the osmosis.limbdamage.leftarm(or head) variable and add 1 to it. So it starts off at 0 (that is what I have the value initialized to in a seperate script) and when I do light bruising it adds 1, and repeats that for moderate and critical bruising. In turn, I have another script that checks the value of the script and calls the gauge to a certain colour based on the value of the corresponding variable. I know there will be issues with this, it is far from complete, I am just trying to get simple functionality right now and can't figure out why this script isn't working. I am trigger off of:
- ^Your strikes cause (\w+) bruising on (\w+)'s (.+).$
- that does: addDamage(matches[4], matches[2])
- Now it is the addDamage function that is giving me the issues, it isn't increasing the value of its corresponding variable (I am checking it with lua osmosis.limbdamage.leftarm). I think the problem has to be in the script because everything else seems legit, I have osmosis.limbdamage called in my initialization script with: osmosis.limbdamage.leftarm = osmosis.limbdamage.leftarm or 0. So here is the function in question:
- function addDamage(limb, severity)
- if severity == "light" then
- if limb == "head" then
- osmosis.limbdamage.head = osmosis.limbdamage.head + 1
- elseif limb == "torso" then
- osmosis.limbdamage.torso = osmosis.limbdamage.torso + 1
- elseif limb == "left arm" then
- osmosis.limbdamage.leftarm = osmosis.limbdamage.leftarm + 1
- elseif limb == "right arm" then
- osmosis.limbdamage.rightarm = osmosis.limbdamage.rightarm + 1
- elseif limb == "left leg" then
- osmosis.limbdamage.leftleg = osmosis.limbdamage.leftleg + 1
- elseif limb == "right leg" then
- osmosis.limbdamage.rightleg = osmosis.limbdamage.rightleg + 1
- end
- elseif severity == "moderate" then
- if limb == "head" then
- osmosis.limbdamage.head = osmosis.limbdamage.head + 2
- elseif limb == "torso" then
- osmosis.limbdamage.torso = osmosis.limbdamage.torso + 2
- elseif limb == "left arm" then
- osmosis.limbdamage.leftarm = osmosis.limbdamage.leftarm + 2
- elseif limb == "right arm" then
- osmosis.limbdamage.rightarm = osmosis.limbdamage.rightarm + 2
- elseif limb == "left leg" then
- osmosis.limbdamage.leftleg = osmosis.limbdamage.leftleg + 2
- elseif limb == "right leg" then
- osmosis.limbdamage.rightleg = osmosis.limbdamage.rightleg + 2
- end
- elseif severity == "critical" then
- if limb == "head" then
- osmosis.limbdamage.head = osmosis.limbdamage.head + 3
- elseif limb == "torso" then
- osmosis.limbdamage.torso = osmosis.limbdamage.torso + 3
- elseif limb == "left arm" then
- osmosis.limbdamage.leftarm = osmosis.limbdamage.leftarm + 3
- elseif limb == "right arm" then
- osmosis.limbdamage.rightarm = osmosis.limbdamage.rightarm + 3
- elseif limb == "left leg" then
- osmosis.limbdamage.leftleg = osmosis.limbdamage.leftleg + 3
- elseif limb == "right leg" then
- osmosis.limbdamage.rightleg = osmosis.limbdamage.rightleg + 3
- end
- end
- end
- Once again, I know the actual combat application of this is flawed at best, but I am just trying to get this thing actually changing my gauges, I will fine tune it after that.
Advertisement
Add Comment
Please, Sign In to add comment