Help with health script
by Michael S · in Torque 3D Professional · 04/17/2012 (2:26 pm) · 4 replies
I am re-writing my health script to work with armor and stamina. I got everything besides stamina working, stamina is going to be the way to get your health up, besides leveling. So, say I want 1 stamina to maybe times the health by 2, or just add 40, how would I do that?
About the author
#2
04/17/2012 (3:51 pm)
Damage scaling for the easiest way. Otherwise you'll need to do some problematical datablock assigning trickery based upon the stamina factor that will raise your number of player datablocks (with all the possible different maxDamage properties) through the roof, and cause other potential issues.
#3
04/17/2012 (4:46 pm)
Ahh, I have some work cut out for me then :) will get to that though, thanks for all the help.
#4
I figured it out, nevermind :D
04/18/2012 (4:14 pm)
Okay, that surely helped out with my combat, however I am still working on the stamina, I got it done, however, I need to know if their is a command that can just stop a function from working, or how to just make a maxstamina.I figured it out, nevermind :D
Torque Owner Robert Fritzen
Phantom Games Development
I only state this because datablocks have a maxDamage coded into them, so what you'll need to do is accept incoming damage, and translate it into a damage based on your char's max HP reflected into the max.
For Example.
Lets say I have 200 HP, but my datablock is 100, and then I'm fed 50 points of damage. You would translate the 50 damage into 25 and send it to the player.
From there, just code a getMaxHP() function that uses your custom values and get the damage as a percent to get the current value.