PDA

View Full Version : Reflection health functions are returning wrong values



Simbanoobie
09-16-2014, 10:06 PM
R_GetHealth is returning your max health regardless of current hp
R_GetMaxHealth is returning your current health
R_GetHealthPercent is returning the inverse % of your hp. (100% hp = returns 100, 90% hp = returns 111, 50% hp returns 200, etc).

((1/R_GetHealthPercent) * 10,000) returns the correct health percentage

Had no idea where exactly to post this but just figured I should post it so others are aware. Depending on the combat script, it could not eat properly/detect low hp properly and your player could die.

Clarity
09-16-2014, 11:46 PM
For future reference you should post bugs like this here: https://villavu.com/forum/project.php?projectid=9
Hope it gets fixed :)

Edit: Mayor's suggestion is better.

The Mayor
09-16-2014, 11:47 PM
R_GetHealth is returning your max health regardless of current hp
R_GetMaxHealth is returning your current health
R_GetHealthPercent is returning the inverse % of your hp. (100% hp = returns 100, 90% hp = returns 111, 50% hp returns 200, etc).

((1/R_GetHealthPercent) * 10,000) returns the correct health percentage

Had no idea where exactly to post this but just figured I should post it so others are aware. Depending on the combat script, it could not eat properly/detect low hp properly and your player could die.

Probably best to post this in the actual reflection thread (https://villavu.com/forum/showthread.php?t=107479). Reflection is actually being rewritten currently, but I'm not sure on the release date.

Fitta
09-17-2014, 11:25 AM
R_GetHealth is returning your max health regardless of current hp
R_GetMaxHealth is returning your current health
R_GetHealthPercent is returning the inverse % of your hp. (100% hp = returns 100, 90% hp = returns 111, 50% hp returns 200, etc).

((1/R_GetHealthPercent) * 10,000) returns the correct health percentage

Had no idea where exactly to post this but just figured I should post it so others are aware. Depending on the combat script, it could not eat properly/detect low hp properly and your player could die.

Use getCurrentHealth instead, and make your own function :)

Simbanoobie
09-17-2014, 07:13 PM
Use getCurrentHealth instead, and make your own function :)

Oh I did, I just wanted to make people aware. If a combat script was set to eat when below 50%, it would only eat if your hp was above 200%, and if you took enough damage you would die( for example ). If someone hit start script and walked away they could end up dead. Nothing worse than coming back to your screen to see yourself in lumby :P

Hoodz
09-17-2014, 08:00 PM
Oh I did, I just wanted to make people aware. If a combat script was set to eat when below 50%, it would only eat if your hp was above 200%, and if you took enough damage you would die( for example ). If someone hit start script and walked away they could end up dead. Nothing worse than coming back to your screen to see yourself in lumby :P

just use R_GetSkillLevel and R_GetMaxSkillLevel