- Joined
- Jul 26, 2016
- Messages
- 111
- Reaction score
- 8
- First Language
- English
- Primarily Uses
- RMMV
Hey all. Another YEP problem for you.
I'm creating a sword that gives its own Base Attack approximately +1% Attack for every 1% HP the player is missing.
I'm using the following note tag on the sword in question:
<Custom Parameters>
atk = 10 * (2 - (hp / maxhp))
</Custom Parameters>
As far as I can tell, this is valid JavaScript. In theory, if the player was at 2 out of 10 HP this should return 10 * 1.8, or 18 Attack. Instead, it returns NaN leading me to believe that there's something wrong with my use of "atk", "hp", or "maxhp".
I know that RPG Maker MV addresses max HP as "mhp" internally, while the Yanfly mod addresses it as "maxhp", and I've tried both and received the same result.
I'm creating a sword that gives its own Base Attack approximately +1% Attack for every 1% HP the player is missing.
I'm using the following note tag on the sword in question:
<Custom Parameters>
atk = 10 * (2 - (hp / maxhp))
</Custom Parameters>
As far as I can tell, this is valid JavaScript. In theory, if the player was at 2 out of 10 HP this should return 10 * 1.8, or 18 Attack. Instead, it returns NaN leading me to believe that there's something wrong with my use of "atk", "hp", or "maxhp".
I know that RPG Maker MV addresses max HP as "mhp" internally, while the Yanfly mod addresses it as "maxhp", and I've tried both and received the same result.
