Solution: I googled my brains out and came up with a way to solve this!
<HP Cost: 10>
<After Eval>
$gameVariables.setValue(18, $gameVariables.value(18) + 10)
</After Eval>
I was super overthinking things. Omgosh.
--------------------------------------
Hello guys! I have a skill in my game that uses HP as its "cost" - it's like blood magic. What I'm trying to do is get the game to keep track of how much "blood" that actor has spent in every battle - which will later determine the strength of a summon.
Right now I am using Yanfly's Custom Skills plugin. I've got the skill to cost 3% of the actor's HP - easy. Now what I'm trying to do is add Pre- and Post-Damage functions, but I don't know any javascript T_T
Here's what I want:
<Before Eval>
Set variable 17 to actor 3's current HP
</Before Eval>
<After Eval>
Set variable 18 to actor 3's current HP (this would be after she spent 3% of her HP on the skill)
Subtract variable 18 from 17 and then ADD the result to variable 19 (this would show how much HP she spent in all, in its own variable for me to use later on)
</After Eval>
Example:
Variable 17: HP before skill
Variable 18: HP after skill
Variable 19: Total HP spent
Actor 3's HP is 100
Uses blood skill that drains 3% of her HP
Actor 3's HP is now 97
100 - 97 = 3
Variable 19 holds the value "3"
Later she does the same thing, and variable 19 now holds the value "6" and so on. Then I plan on using variable 19 in a damage formula for another skill she gains later in the game.
I've looked at the RMMV Script Calls list but could only find how to change HP, not set it to a variable. After googling, I found this: $gameVariables.setValue(1, "text"); but i don't think that doesn't what I want, necessarily, but can certainly be a start.
Can anyone help me out? =]
Edit: After more searching I found this script that could be for the subtraction:
$gameVariables.setValue(19, $gameVariables.value(17) - $gameVariables.value(18)) maybe? Haven't tried it cause I still need to figure how to get her HP numbers.
$gameVariables.setValue(17, actorHP) <-- dunno how do
<HP Cost: 10>
<After Eval>
$gameVariables.setValue(18, $gameVariables.value(18) + 10)
</After Eval>
I was super overthinking things. Omgosh.
--------------------------------------
Hello guys! I have a skill in my game that uses HP as its "cost" - it's like blood magic. What I'm trying to do is get the game to keep track of how much "blood" that actor has spent in every battle - which will later determine the strength of a summon.
Right now I am using Yanfly's Custom Skills plugin. I've got the skill to cost 3% of the actor's HP - easy. Now what I'm trying to do is add Pre- and Post-Damage functions, but I don't know any javascript T_T
Here's what I want:
<Before Eval>
Set variable 17 to actor 3's current HP
</Before Eval>
<After Eval>
Set variable 18 to actor 3's current HP (this would be after she spent 3% of her HP on the skill)
Subtract variable 18 from 17 and then ADD the result to variable 19 (this would show how much HP she spent in all, in its own variable for me to use later on)
</After Eval>
Example:
Variable 17: HP before skill
Variable 18: HP after skill
Variable 19: Total HP spent
Actor 3's HP is 100
Uses blood skill that drains 3% of her HP
Actor 3's HP is now 97
100 - 97 = 3
Variable 19 holds the value "3"
Later she does the same thing, and variable 19 now holds the value "6" and so on. Then I plan on using variable 19 in a damage formula for another skill she gains later in the game.
I've looked at the RMMV Script Calls list but could only find how to change HP, not set it to a variable. After googling, I found this: $gameVariables.setValue(1, "text"); but i don't think that doesn't what I want, necessarily, but can certainly be a start.
Can anyone help me out? =]
Edit: After more searching I found this script that could be for the subtraction:
$gameVariables.setValue(19, $gameVariables.value(17) - $gameVariables.value(18)) maybe? Haven't tried it cause I still need to figure how to get her HP numbers.
$gameVariables.setValue(17, actorHP) <-- dunno how do