- Joined
- Nov 11, 2018
- Messages
- 2
- Reaction score
- 1
- First Language
- English
- Primarily Uses
- RMMV
Hello,
I have an event that allows the party to restore all hp. I have rigged up the dialogue, a variable that holds the inn's price, all that, but there is one thing I am having trouble doing: setting the price. I would like the price to be the total missing hp of the party - however the formula to do so is giving me a lot of trouble. Using google I came up with the following formula: (spaced out for readability)
This is inserted into a Control Variables event command. However, when testing it out ingame, the price is consistently 0 no matter the health of my party. I can't figure out what I'm doing wrong.
Here's a screenshot of the event in case the script isn't enough:
Thank you!
Elsa
I have an event that allows the party to restore all hp. I have rigged up the dialogue, a variable that holds the inn's price, all that, but there is one thing I am having trouble doing: setting the price. I would like the price to be the total missing hp of the party - however the formula to do so is giving me a lot of trouble. Using google I came up with the following formula: (spaced out for readability)
Code:
$gameParty.members().forEach(function(m){
$gameVariables.setValue(5, $gameVariables.value(5) + (m.mhp - m.hp))
})
Here's a screenshot of the event in case the script isn't enough:
Thank you!
Elsa



