Hello, it's me again. I'm feeling reticent about asking so many questions but I've spent the whole day trying to make two skills work and at this point, I have no clue how.
So, the skills I want are supposed to "steal" stats from one ally and then give those stats to another ally.
The first skill is supposed to store the targeted ally's ID and then run a common event. The skill has the following notetags:
The code that is relevant for this skill's purpose is the part in the "Before Eval" notetag but I've included all of it just in case something else may be causing issues as well. I've checked if the actorID is actually getting stored in the variable during testing and it seems to be working correctly, so I don't think the issue is here.
The next part is the common event that is run by this skill. I've tried a dozen different methods, most of which didn't even come close to working but I've settled on two methods that seem to me as being close to correct. Those are as follows:
In this method, B_Reuse1 is the name of Variable 21 where the Actor ID is stored.
And finally the second skill that is supposed to transfer the stored stat to another ally. It has the following notetags:
I strongly suspect the issue happens during the CE, but after reading through many tangentially related threads as well as running the code through a few javascript code checkers to make sure I didn't make a simple syntax error, I'm at a point where I have no idea how to get this to work. Any and all help would be greatly appreciated!
So, the skills I want are supposed to "steal" stats from one ally and then give those stats to another ally.
The first skill is supposed to store the targeted ally's ID and then run a common event. The skill has the following notetags:
JavaScript:
<Instant Cast>
<Custom Requirement>
if $gameSwitches.setValue(2, true) {
value = false;
} else {
value = true;
}
</Custom Requirement>
<Custom Execution>
$gameSwitches.setValue(2, true);
</Custom Execution>
<Before Eval>
var targetId = target.actorId();
$gameVariables.setValue(21, targetId);
</Before Eval>
The code that is relevant for this skill's purpose is the part in the "Before Eval" notetag but I've included all of it just in case something else may be causing issues as well. I've checked if the actorID is actually getting stored in the variable during testing and it seems to be working correctly, so I don't think the issue is here.
The next part is the common event that is run by this skill. I've tried a dozen different methods, most of which didn't even come close to working but I've settled on two methods that seem to me as being close to correct. Those are as follows:
In this method, B_Reuse1 is the name of Variable 21 where the Actor ID is stored.
And finally the second skill that is supposed to transfer the stored stat to another ally. It has the following notetags:
JavaScript:
<Instant Cast>
<Custom Show Eval>
if ($gameSwitches.value(2)) {
visible = true;
} else {
visible = false;
}
</Custom Show Eval>
<Custom Execution>
$gameSwitches.setValue(2, false);
</Custom Execution>
<After Eval>
var value = $gameVariables.value(5);
target.addParam(0, value);
target.gainHp(value);
</After Eval>
I strongly suspect the issue happens during the CE, but after reading through many tangentially related threads as well as running the code through a few javascript code checkers to make sure I didn't make a simple syntax error, I'm at a point where I have no idea how to get this to work. Any and all help would be greatly appreciated!