[Solved] Making random encounters

I want to add random encounters to the world, but not simply enemy encounters after x-amount of steps.
For example; I want to have the characters walk in region 1, and while they're there, there is a chance one of 5 encounters is triggered.

I thought I could do it like this;
When the characters walk through Region 1, a region tracker would play a Common Event. Schermopname (41).png

That common event would then pick a number between 1 and 30. If the picked number is 1, 5 or 7 etc. an event would play. Any other number and nothing would happen.Schermopname (42).png
Unfortunately its not working the way i want to. At first the region tracker event caused the common event to play constantly, since I have it run parallel. Otherwise it wouldn't play at all.
Now, after changing the name, it runs either not at all, or only when I enter the map after leaving a village. And then it only plays once and not again.

What I want is the common event to play when a character stands on a tile that is marked as Region 1.
The common event then runs a number once. If that number corresponds with an encounter, the encounter is played. If not, then nothing happens until the player moves to the next tile marked as Region 1.

I hope it makes sense. Does anyone know if this can be done within MZ itself, or do I need a plugin for this?
erase event will delete the autorun after the first time it reached a region 1.
and autorun is bad for this anyway because the player can't move while an autorun is active.

You'll need a parallel process, but with a wait to prevent it from firing sixty times a second.
For your case probably a wait(20) or wait (30)
(The number of waits needed depends on what you want the events to do, too few waits and it gets lag, too many waits and it doesn't react in time)
erase event will delete the autorun after the first time it reached a region 1.
and autorun is bad for this anyway because the player can't move while an autorun is active.

You'll need a parallel process, but with a wait to prevent it from firing sixty times a second.
For your case probably a wait(20) or wait (30)
(The number of waits needed depends on what you want the events to do, too few waits and it gets lag, too many waits and it doesn't react in time)
Hmm. So the setup I use should work, just put it to parallel and remove the Erase Event.
Where do I put the Wait? In the common event, or region tracker?

Disregard that. I got it to work. I put the Wait inside the common event and it seems to work how I want it to.
Thanks for the help!
1685387709152.png
1685387726652.png

Is there a point I missed?
Is there a point I missed?
yes
the random encounters are supposed to include non-combat encounters, that is not possible with the default that is limited to battles with troops
1685388277602.png

you can try this way, so you don't need to use erase event.

Edit: I tested it and i guess it works as you want to do
I want to add random encounters to the world, but not simply enemy encounters after x-amount of steps.
For example; I want to have the characters walk in region 1, and while they're there, there is a chance one of 5 encounters is triggered.

I thought I could do it like this;
When the characters walk through Region 1, a region tracker would play a Common Event.View attachment 263635

That common event would then pick a number between 1 and 30. If the picked number is 1, 5 or 7 etc. an event would play. Any other number and nothing would happen.View attachment 263636
Unfortunately its not working the way i want to. At first the region tracker event caused the common event to play constantly, since I have it run parallel. Otherwise it wouldn't play at all.
Now, after changing the name, it runs either not at all, or only when I enter the map after leaving a village. And then it only plays once and not again.

What I want is the common event to play when a character stands on a tile that is marked as Region 1.
The common event then runs a number once. If that number corresponds with an encounter, the encounter is played. If not, then nothing happens until the player moves to the next tile marked as Region 1.

I hope it makes sense. Does anyone know if this can be done within MZ itself, or do I need a plugin for this?

Can you give feedback if your problem is solved?
Can you give feedback if your problem is solved?
The OP said the problem was solved in post #3, yesterday, before you even wrote anything.

Aside from that...no one has any obligation to respond to other people's posts, whether they were helpful or not. You will often say something in a thread and not get any response to it.
The OP said the problem was solved in post #3, yesterday, before you even wrote anything.

Aside from that...no one has any obligation to respond to other people's posts, whether they were helpful or not. You will often say something in a thread and not get any response to it.
mb sorry.

Original thread: https://forums.rpgmakerweb.com/threads/solved-making-random-encounters.157909/