Variable meant to hold the player's Y value is much higher than it should be

I'm trying to keep track of the player's Y position as a variable on a map, using a parallel event. [Control Variables : #0003 PlayerY = Map Y of Player] is what I assume should set the variable to 0 if the player is on the very top tile of a map, and when the player moves a tile downwards, should set the variable to 1. For some reason, on a 9x30 map, PlayerY keeps being set to around 1400-something (after some experimenting, the number seems to increase by one every few seconds). I don't understand why this is happening.
Here's an image of the event I'm trying to use (green blob not accurate to the used sprite)
1707334056413.png

This isn't the first map I've had this issue on, though I haven't checked all of my maps for this issue at this point in time.
The variable must be getting used someplace else. Sounds like a parallel process if it's changing every few seconds.

You can use the Event Searcher tool on the MV edit bar, but that won't cover anything that's put into plugins or script calls.
There are a number of possibilities of what this could be.

The biggest possibility is that the variable is used somewhere else, especially if used by a plugin.

To test this, incrase the number of available variables and use the two new variables for the same test,
Preferably with IDs of above 100 if you don't already have that many variables.
If the effect goes away you would have to look where the other uses of the variable are.
Events are processed in series: first the non-parallel event (if one is running), then each active parallel event, one after the other. So by default, the setup in your screenshot should not receive interference from other events, because Control Variables & Conditional Branch commands do not require any interpreter wait time. (This does not necessarily apply if you have used anything like setTimeout or setInterval in a script call.)

More ideas:
  1. Make sure you only have 1 variable named PlayerY. Otherwise you might be checking the wrong variable in your branches.

  2. Double-check which event page is active. E.g. make sure that every page has a clearly different image. Maybe that event's self-switch A is not on, or maybe page 4 or 5 is taking priority.

  3. As others have mentioned, it might be a plugin. You can check this by turning off all plugins in the Plugin Manager: select all (e.g. Ctrl+A, or shift-click), then right-click -> Turn OFF. Remember to save your project to apply Plugin Manager changes before testing. Also, choose New Game from the title screen to avoid carrying over plugin stuff into your test run.

  4. The debug menu (F9 during playtest) can be used to check the value of variables. Does PlayerY keep ticking up on all maps, or just this one? Might help to figure out if it's a map-specific thing.
Thank you all for the advice. I decided to check to see what other events used the variable with the Event Search tool first. I saw only events that made sense in their respective maps, that is, until the very last one. A common event. One which I do not remember the usage of.
1707348517263.png

My best guess as to how this happened is that the PlayerY variable and/or the ChicaChallengeWon switch used to have a different name, and, after I reworked the associated minigame (which I'd actually asked for help with in one of my first posts here, funnily enough) I must have forgotten to scrap this common event. Removing this seems to have cleared up the issue as far as I can tell, as the Y variable has not become a ridiculous number so far in testing. Once more, thank you all for helping me with this.
You can solve this type of problem using RPG Maker's own "Event Searcher" menu:

65b270b4f5c6cece549e70cf_rpg-maker-mv-event-searcher-screenshot.webp
You can solve this type of problem using RPG Maker's own "Event Searcher" menu:
I've seen people get ninja'd countless times, but rarely do I see someone get ninja'd by nearly a whole week. Pays to read prior responses, my friend.
I've seen people get ninja'd countless times, but rarely do I see someone get ninja'd by nearly a whole week. Pays to read prior responses, my friend.
i'm sorry 🙁

Original thread: https://forums.rpgmakerweb.com/threads/variable-meant-to-hold-the-players-y-value-is-much-higher-than-it-should-be.165555/