Changing sprites after battle

I have a little problem which I have no idea why is happening (not really understanding the inner workings that well):

I use Yami's Battle Symphony script. It shows the stepping sprites on the right and enemies on the left. To make things a bit more realistic, I wanted the sprites to stop stepping and maybe look different when they are inflicted with movement restricting states. I used Shaz's State Commands script for that, and got it working well with the help of the lovely forum members. However, as I playtested battles with one of the few states that are not removed when battle ends, a weird thing (to me) happened:

An actor got the petrified state in the battle. The sprite changed to an unmoving grey one.

After the battle, on the map, the actor had a normal moving sprite (which I thought happens always).

In the next battle, the actor had the grey sprite again, since they were still petrified (this is ensured by events in turn 0 - if actor has this state, change graphic).

The actor got healed in the battle, sprite changed to the normal stepping one, and ended the battle as such, too.

However, back on the map, the actor suddenly had the petrified sprite, although the state was gone. This didn't change after several more battles, even though each troop has the Turn 0 check which changes them to normal if they don't have specific states. I tried adding a post battle event (using Hime's script) changing them to normal, but that didn't turn the actor back either.

Any ideas why this happened? Is it something in the engine's battle processing, or in Yami's script? Can something be done about it? It never happened with the immobilising states that are removed at battle end, even if the actor still had it at that end.

(I prefer on-the-map sprites to be normal walking ones, since I don't want to bother with changing the leader if they're petrified and so on.)
Hello,

Do you only change the sprite to a petrified version with an event command and in the same event?
If so, can you show that event?

However, back on the map, the actor suddenly had the petrified sprite, although the state was gone. This didn't change after several more battles, even though each troop has the Turn 0 check which changes them to normal if they don't have specific states. I tried adding a post battle event (using Hime's script) changing them to normal, but that didn't turn the actor back either.
Have you tried changing the sprite manually with an event on the map does it work?
The sprites change in common events linked to the state (the on_add command to change to petrified and on_remove to change back to normal, from Shaz's script). I'm not sure how much you need to see, but this is the common event (it has the loop that you helped me with):

sprite changing.jpg


I tried changing the sprite on map, first using the script from the above common event, that didn't do anything (but it works in battle), then just normal Change actor graphic event command, and that worked.
When you call the set_graphic command, it should be followed by a $game_player.refreshcall to update the player's sprite (you can see command_322code in Game_Interpreter).
So I think all you should put at the end of your common event:
Ruby:
$game_player.refresh
Cool, it seems to be working! I added it to the common event that changes the actor back to normal, and I'll leave it out in the add state common event, so that on the map the sprite remains movable.

I'm wondering why it worked in battle without the refresh command. Maybe something in Yami's battle script did it?
Cool, it seems to be working! I added it to the common event that changes the actor back to normal, and I'll leave it out in the add state common event, so that on the map the sprite remains movable.

I'm wondering why it worked in battle without the refresh command. Maybe something in Yami's battle script did it?
That's probably because the sprites check continuously when their associated game objects are modified. But the player (you on the map) and the followers (the people behind you) are not the actors themselves, they are instead a representation of them that needs to be updated "manually", hence the need to use refresh.

Original thread: https://forums.rpgmakerweb.com/threads/changing-sprites-after-battle.181917/