MV Event Erases Itself Even When Random Condition Fails

Hi, everyone!

I’m trying to set up a system where some events (like obstacles) appear randomly each time I enter the map. If they "fail" the random roll, they should erase themselves.

Here’s how I set it up:
  • I created a separate event that sets a random variable between 1 and 2.
  • Then, in each obstacle event, I check:
    • If Randomizer == 2, the event erases itself.
    • else, it runs its usual behavior (moving around, interacting, etc.).
The problem:
Even when the randomizer variable is set to 1, the event will appear for a moment but still erase itself. It seems like it rerolls or erases again even when it shouldn't. What could I be doing wrong?

Spoiler: Screenshots
1752968198054.png
1752968237326.png
1752968334538.png
Your randomizer does not end, which means it changes between 1 and 2 every frame (sixty times per second), so it is likely that it first was on 1 and the other event visible, before switching to 2.

Additionally, chaining parallel events very often have timing problems, because an event needs time to react to other events changes.

The only way to guarantee this without delay is to have the randomizer in the same event as the spawns.
If that is not possible because the same result is needed for several events, then perhaps a wait on entering the map before fading in the map?

If you want to know more about the background behind the timing problems of chained events, see the "Bughunting" tutorial I linked in my signature
Your randomizer does not end, which means it changes between 1 and 2 every frame (sixty times per second), so it is likely that it first was on 1 and the other event visible, before switching to 2.

Additionally, chaining parallel events very often have timing problems, because an event needs time to react to other events changes.

The only way to guarantee this without delay is to have the randomizer in the same event as the spawns.
If that is not possible because the same result is needed for several events, then perhaps a wait on entering the map before fading in the map?

If you want to know more about the background behind the timing problems of chained events, see the "Bughunting" tutorial I linked in my signature
I didn't consider that! Thank you, I didn't know the randomizer would just keep randomizing so I just added an erase event after the randomizer and that seemed to be a simple fix to make things OK from my end for now.

I was thinking of just having a few events block the path for now but i'll keep the bughunting post bookmarked if I run into anything else too. Thank you very much!

Original thread: https://forums.rpgmakerweb.com/threads/event-erases-itself-even-when-random-condition-fails.179030/