Really weird bug - player sprite turns left... sometimes.

My game has developed a strange bug. When the player goes indoors, and then out again, the character sprite turns left. Just for a moment. And then control is returned as normal. The really weird thing is - it only happens sometimes?? So I'll playtest it by starting a new game, and there's a say, 50-50, or 1-in-3 chance that the bug will exhibit. When it does, it happens all the time. When it doesn't, it never happens. How strange is that? I don't even know how to begin fixing a bug that's not always there...

I only have one script installed currently - Yanfly's event chase - and it happened before that. I have a custom-evented time tracking and light changing system, so I use common events to track when the player goes indoors and out, so the light can change according to what time of day it is. My assumption is that it's something to do with that, but I've trawled through it and I can see nothing that would be causing it.

Any ideas? I'm stumped!
are you talking about transfers when "going inside/outside"?

The transfer player command has an option to set or retain the facing on transfer, and that setting can be different for each transfer event.

I suggest you check those options in your maps and test if changing them also changes this behaviour.
Yep - the facing settings are correct. This is why I'm weirded out that it happens sometimes, but not all the times. The character faces down and then suddenly turns left. It's so strange.
Yep - the facing settings are correct. This is why I'm weirded out that it happens sometimes, but not all the times. The character faces down and then suddenly turns left. It's so strange.
just for confirmation:

Do you mean that the transfer is set up to have the actor face down upon arrival and then he turns left on its own, or is it set up to face right but sometimes he looks down before getting the correct facing.

If the transfer point said "retain facing" we need to know wether the correct facing should be down or left, and wether the first facing is the correct one.

If we are to help you, you need to tell us what is the correct behaviour and what happens instead - the two cases I described here would have different reasons for happening, that is why we need you to tell us what is set in the transfer, not only that you believe it to be the correct setting.
It might be issues with hardware that is conflicting with RPG Maker. Please unplug all USB ports, restart your computer, and start plugging them back in, then play test and see if the problem persists.
The facing is set to retain. It faces the correct way for a fraction of a second, and then turns left.

There's nothing plugged into any USB ports. I'm on a laptop so I would definitely notice if I'd left something plugged in!
Do you have another computer? If you play the game on another computer, does the same thing happen?


Have you made any script mods that might be affecting this?
I do have another computer, well I have a netbook, I'll give it a go.
Havn't fiddled with the one script I have on it at all. As I say, it was doing this before I put the script in, so that isn't the issue.

Something else I've noticed is that when this bug hits, the "time" common event stops running too. So it doesn't cycle forward in time. It just stays at 8pm (which is the time it's set to start at).

How very strange.
The facing is set to retain. It faces the correct way for a fraction of a second, and then turns left.

There's nothing plugged into any USB ports. I'm on a laptop so I would definitely notice if I'd left something plugged in!
With that description, you either get an input after the transfer or there is an autorun with a move command "turn" or something like that.

If nothing is plugged in to the notebook (and you aren't accidentally touching the touchpad below the keayboard), then it's unlikely (but not impossible) to be an input problem. However the only way it could be an input problem would be if you have a background driver for special input devices like graphic tablets installed, even if they are not connected at this time.

More likely (especially with your later comment about a timer stopping) this is triggered by either an common event or a map event on parallel process or on autorun.

I suggest that you check all events on the map and the common events for those that have pages which meet those two conditions:

1) contain a move command for the player

2) are on autorun or parallel process

If you find those pages, then you'll have to check which one might be active at a time it shouldn't be active...
Also check to see if you have any weird scripts or common events that look at the terrain tag or region id on the player's tile, and see if the tile they're standing on when this happens has that region id painted, or that terrain tag set.

Original thread: https://forums.rpgmakerweb.com/threads/really-weird-bug-player-sprite-turns-left-sometimes.16012/