MZ Escape via Item (SV Issues)

Hello! Recently made a 100% escape chance item. Two issues came up (this is in SV/Sideview).
  1. The ESCAPE animation (if based off an item) is really awful. I would like it to instead reflect the regular escape command anim. Would it referring to a common event's effect make that possible? Ive no idea how, alas. It would ideally make the chances 100% (unless in a battle specified as unescapable). If in a boss battle Id have it pop a message window saying "Can't Escape!" with the error SFX played.

  2. In SV still, when using escape via an item, the game freezes after the animation is performed (aka when the party members are offscreen). The error log window shows nothing (except the usual "missing pixi.js.map" non-issue).

[ About Point #2 ] Just to make sure, Ive tested by copying my game project + deleted ALL plugins from the list. So none were in effect. Regardless, nothing changed. For the escape item, Ive set it to ALL ALLIES or else one ally remains in battle (testing with 2 party members). Thanks in advance.
I'm assuming you used Special Effect: Escape to implement this? I'm assuming you haven't run into an issue where you get Game Over after escaping (which can happen if escape isn't done properly).

If you want it to exactly follow the default Escape command, but always succeed, the script call would be:

JavaScript:
BattleManager._preemptive = true;
BattleManager.processEscape()

The processEscape command goes through the regular "chance to escape" routine, but the _preemptive flag overrides the chance to 100%. You'd need to put this in a Common Event instead of using Special Effect: Escape. Since it's a common event, that means you can easily check if it's a battle flagged as inescapable, using the following script call in a Conditional Branch:

JavaScript:
BattleManager.canEscape()
Correct, it was using the <SE: Escape> trait in the item's effect tab.

Interesting... So when youve got the drop on the enemies, you get a free escape? Makes sense, I really didnt think of that! It seems to work. After a lot of tests fine-tuning things, I had to put a 1-frame pause between the animation call and the escape effect or else it all played simultaneously. Now it doesnt seem to break the game either, so ty for that.

That said, during their escape, they stay facing the enemies (instead of turning around) and dont run either. Their sprites remain static and move backward!
So when youve got the drop on the enemies, you get a free escape?
Yes, as long as you use it immediately. If you wait until the next turn, it's not free anymore.
That said, during their escape, they stay facing the enemies (instead of turning around) and dont run either. Their sprites remain static and move backward!
Hmm. Maybe something like this could work…? I haven't tested. Put it in a .js file and add it as a plugin near the bottom of the list.

JavaScript:
(function(old) {
    Sprite_Actor.prototype.retreat = function() {
        old.call(this);
        this.scale.x = -1;
    };
})(Sprite_Actor.prototype.retreat);
This makes them turn around (yay) but their feet dont move (stucked on 1 of their 3 escape sprites as they move offscreen). Im still amazed you (and many others) can come up with so much on the fly.
Hmmm, I tested it just for fun and with that script I think it's cycling frames but the escape and fade to black happens so fast that you barely see it. Also, I received the escape related messages ('Started to escape') in the map scene. So yeah I guess something in the methods isn't stopping ending the battle at that point before everything is resolved.

Are you using VisuStella for action sequences? I'd just add an action sequence to the item where I move all the alive party members and then use abort battle (that goes to the escape branch too I think). And if you need add +1 to the $gameSystem._escapeCount
Though it seems like abort battle doesn't work in action sequences, but you can make the item turn on a switch and use base troop event with moment switch is ON to do the same. And then just put in the plugin settings to turn the switch OFF when battles end. LOL.
Thats strange. No, I even go out of my way to avoid anything Yanfly / V.Stella. Youre right that it all happens so fast, but if you do a regular escape (not via item) even then you see their sprites cycling proper.

EDIT: Oh God... I just tested the regular flee command and the plugin makes it happen horizontally flipped (walking backward).
So that implies that there's already logic to flip them, but that logic was missed i your common event… meaning, my added code to flip them reversed the built-in logic…
Ive made some more tests—with my project copied and all other plugins wiped (except Solar_Flare's).

  1. If the plugin is ON: Escape Command makes the PC walk backward (facing the enemies) but their running sprites are animated. Escaping via the common event + item has the characters turn around correctly, but they have their sprites frozen to 1 frame.


  2. If the plugin is OFF: Escape command works as intended. Escaping via the common event + item has the characters walking backward (facing the enemies) with their sprite frozen to 1 frame.
Bump!
Try using that plugin and the escape item common event has:

Script:
$gameParty.performEscape();
SoundManager.playEscape();
BattleManager._escaped = true;

Wait: 60 frames

Script:
BattleManager.processAbort();

Or you can change the plugin a bit to increase the retreat move time:
Sprite_Actor.prototype.retreat = function() {
this.scale.x = -1;
this.startMove(300, 0, 60);
};

PS. Just to make sure, the rpg maker mz character generator has the same frame for escape for all frames I think, so unless you've changed the escape frames, you'll see it "frozen", even if the motion is looping by default.
Since Ive made my own sprites from scratch, I do expect them to move in both cases (regular-escape and item-escape). Also made them taller than most! Okay so I tested your answer and it basically caused a split-second mirroring and BOTH cases to be reversed. But they were animated... So I tried disabling the plugin, and now its perfect.

Animated in both cases—both facing offscreen! I cannot explain the whys or hows, but regardless, thank you both. <3

Sorry for the late answer.

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/escape-via-item-sv-issues.182622/