I have an event that has a character 5 tiles away from the main character before battle starts. After the battle, I want them to be right behind the main character, and a different color sprite. What's happening right now is, battle ends, you see this sprite 5 tiles away for a second, then that gets erased and it appears right behind the main character as a different color. I want the change to happen without being seen. Is there a way to do this?
Need help making an event condition trigger after battle starts, but before it ends
RPG Maker MZ SupportWell, one easy solution could be just fading out the screen and doing it before the battle starts. Otherwise I would check your eventing. Maybe there's some weird wait somewhere that delays the execution. I have multiple spots in my game that does this kinda stuff after battle and they work just fine.
I have the switch that causes the move happening right after the battle processing line, no wait frames there. If I put it right before you see him move before the battle starts which isn't good. Setting a fadeout before battle then having a fadein after the battle is going to have to be good enough. It does make it a little annoying compared to other scripted event, since it fades out then shows the map again to do the battle begin effect (the zoom in on the map thing). But that doesn't show any of the event images, so don't see the moved sprite til after the battle, so it'll work.
You can try using a show picture instead of the regular screen fade. Just make a black square as big as your game window and fade that in. This should prevent the map from popping up during the battle intro.
I have not tested it, but from what I remember, regular events will pause their execution while the screen fades in.
You could try to make the effect happen by either using a second event for the "behind the player" sprite and activate the switch to make event appear at some point during the battle.
Another option would be to use a parallel process event to move the character, which is not subject to the "fade in pause" if I remember correctly.
Both of these methods will likely still be one frame late due to the order the game updates its entities, but this should hopefully not be noticeable.
Alternatively you could move the event during the battle process.
Most map related event commands are likely disabled during battle events, but you could use script commands to move the events anyways:
(You can probably look up more in the pinned RPG Maker MV/MZ Script Call List.)
You could try to make the effect happen by either using a second event for the "behind the player" sprite and activate the switch to make event appear at some point during the battle.
Another option would be to use a parallel process event to move the character, which is not subject to the "fade in pause" if I remember correctly.
Both of these methods will likely still be one frame late due to the order the game updates its entities, but this should hopefully not be noticeable.
Alternatively you could move the event during the battle process.
Most map related event commands are likely disabled during battle events, but you could use script commands to move the events anyways:
JavaScript:
let event = $gameMap.event(17); // Replace 17 with Event ID
event.locate(125, 54); // Move event to position x=125, y=54
event.setDirection(2); // Make the event look 2=down, 4=left, 6=right or 8=up
event.setImage("Spritesheet Name", 0); // Change the events image, replace 0 with the character index (0-7)
$gamePlayer.reserveTransfer(1, 2, 3, 4, 0); // Transfer the player to a new map:
// Replace: 1 = New Map ID, 2 = New X position, 3 = new Y position, 4 = New Face Direction,
// 0 = Fade Type (0 = black, 1 = white, 2 = none)
Original thread: https://forums.rpgmakerweb.com/threads/need-help-making-an-event-condition-trigger-after-battle-starts-but-before-it-ends.177020/