- Joined
- Feb 4, 2015
- Messages
- 212
- Reaction score
- 41
- First Language
- English
- Primarily Uses
Hello, everybody. Just a quick question:
I've been trying to set a variable (in a common event) to a certain percentage (in this case, 10%) of one's maximum HP, then use a conditional branch to check if their current HP is less than the variable. After trying to use the classic 'divide health by max health and multiply by 100', I realized that RPG Maker cannot handle decimal values, and that the variable value will always remain at 0 as a result.
For further information: the goal in my game is not to reduce the opponent's health to 0 per se, but reduce their health enough and knock them down, where you can 'pin' them. The guard option was replaced by a 'pin' command, which sets off a common event. Said common event counts to 1, then checks the opponent's current and max HP to check if the opponent's current HP is less than 50% of their max HP. If the condition is met, it counts to 2, then checks if the opponent's health is less than 10% of their max HP. From there, if that condition is met once more, a three count will be made, and the battle is ended.
I've been trying to set a variable (in a common event) to a certain percentage (in this case, 10%) of one's maximum HP, then use a conditional branch to check if their current HP is less than the variable. After trying to use the classic 'divide health by max health and multiply by 100', I realized that RPG Maker cannot handle decimal values, and that the variable value will always remain at 0 as a result.
For further information: the goal in my game is not to reduce the opponent's health to 0 per se, but reduce their health enough and knock them down, where you can 'pin' them. The guard option was replaced by a 'pin' command, which sets off a common event. Said common event counts to 1, then checks the opponent's current and max HP to check if the opponent's current HP is less than 50% of their max HP. If the condition is met, it counts to 2, then checks if the opponent's health is less than 10% of their max HP. From there, if that condition is met once more, a three count will be made, and the battle is ended.