I'm using script calls to change the sprite of an event on the fly, but there's a strange issue where the sprite change will be delayed by about a quarter of a second or so.
Is there a way to manually force a refresh of the events/scene manager so I can update on the same frame I change the image?
Isn't it because the image is being loaded?
Try using a preload manager.
If it's because the image is loading, then during the time you're waiting, the event will have NO image. It won't retain the current image after you've executed the change command, and switch over to the new one after it's finished loading. So you will see it disappear briefly when the command is run, and reappear when the loading is done.
Does the same thing happen when you use the event command rather than a script to change the graphic? This might be via the Move Route command, as I don't think there's a Change Event Graphic command in the main command list.
If it doesn't happen when you use the event command, then it's something unique to the way you're doing it via the script. In that case, take a look at rpg_objects.js and see what it does when that event command is executed. If you have to use a move route, then you'll find the code in Game_Character where all the move route commands are processed.
At a guess, you probably need to do a refresh on the event immediately after.
Which leads me to ask ... why are you using script calls, and not the Change Graphic from the Move Route commands?
oh - so it has the original image, then after you execute the command, it shows a different image that is not the one that was showing, and is not the one that should show? Yes, I think you've found the issue. I had to look at this for Archeia a while ago, and it was an extra variable that needed to be updated at the same time. Try updating the direction, the pattern, and the original pattern all at the same time. That may be all you need to do.