Original Source
- Original title: MV OnDeathEval weirdness
- Original author: EpicGJG
- Original date: May 19, 2024
- Source thread: https://forums.rpgmakerweb.com/threads/ondeatheval-weirdness.168837/
- Source forum path: Game Development Engines > RPG Maker Javascript Plugins > Javascript/Plugin Support
Summary
I am trying to make a state that kills an actor or battler, and then switches which team they are on in following battles (only works on some enemies/actors). This includes having an enemy equivalent to some of the actors in the game. Notable plugins include YEP_BuffsStatesCore and WAY_CustomOnDeathEval. What I'm trying to accomplish is a state using the StateCounter function which, when the state counter reaches 10, kills the affected actor or battler, running a common event with some dialogue specific to what actor or battler died and then...
Archived First Post
Notable plugins include YEP_BuffsStatesCore and WAY_CustomOnDeathEval.
What I'm trying to accomplish is a state using the StateCounter function which, when the state counter reaches 10, kills the affected actor or battler, running a common event with some dialogue specific to what actor or battler died and then either spawning an enemy event or adding them to the party respectively.
Here's the state note:
<Custom Apply Effect>
target.addStateCounter(8, 1);
$gameVariables.setValue(1, target.actorId());
if ($gameVariables.value(1) >= 1) {
if (target.getStateCounter(8) >= 10) {
$gameVariables.setValue(3, 8);
$gameTemp.reserveCommonEvent($gameVariables.value(1));
}
}
else if (target.getStateCounter(8) >= 10) {
$gameVariables.setValue(3, 8);
}
</Custom Apply Effect>
The skill which applies the state has the damage formula:
b.addState(8); if (b.getStateCounter(8) >= 10) {b.die()}; a.atk * 0.5
The enemies which are susceptible to this state all have the notetag:
<Custom On Death Eval>
$gameVariables.setValue(2, [a number specific to each enemy to ID who died]);
$gameTemp.reserveCommonEvent(8);
</Custom On Death Eval>
My problem is that enemies killed by the state aren't triggering the common event. Actors killed by state level 10 will successfully trigger it and subsequently determine whether or not they should be switching teams, and enemies killed before reaching state level 10 are successfully triggering event 8, calling which enemy has died, and declaring that they are not state affected based on variable 3.
For whatever reason, killing an enemy via reaching state level 10 will not trigger any common events I try. They just die and nothing else happens.
I'm a novice at coding and can't figure out why this specific scenario doesn't work. The best guess I have is the order of operations is wrong somehow.
Downloads / Referenced Files
Log in, then follow the RPG Maker Developers Group to see these download links.
Log in to downloadCreator Claims / Removal
If you are the original creator and want this listing reassigned, edited, or removed, join BMMPlay and contact the moderators with proof that matches the original RPG Maker Web profile, linked GitHub, itch.io page, or another public creator identity.
Replies (0)
No replies yet.
Topic Summary
Loading summary...