Reset Encounter

Hey guys and gals its been a while and i come back with a question yet again 😀

So I, even after fine tuning, dislike how random encounters work but i like the general concept of getting jumped without warning.
I thought about it for a while and then thought of how "cthulhu saves the world" handles random encounters and I like it.
For those who dont know how it works: You have X amount of encounters per Area and after reaching
that amount it turns off the encounters.

I got this set up easy peasy:
Code:
Page 1
IF: Encounter > X
    Change Encounter: Disable
    Text
        Area Cleared!
    Control Self Switch: A = ON
End
Trigger Set to Parallel

Page 2
Erase Event


After X fights it disables the Encounters just the way i intend it to.
This helps limit the fights per area so you can eventually explore the area in peace.
I want to now use this on all maps (excluding world map)
Problem is how do i restart them if i leave and come back xD

I tried setting Change Encounter: Enable before the Conditional Branch but that seems to somehow disable Encounters all together??
Its probably easy but i seem to struggle with the easy stuff xD
You would have to use a unique switch on every map and then create a second event that erases itself immediately, or on page 2 (enabled only by that switch being turned on), disables the switch, causing It to then revert back to page 1, which would then erase Itself.
Tried but failed 😛
This isn't a very difficult fix, but first, I want to ask you, how did you foresee this working out, exactly? At what point is Self Switch A disabled?

If you need help, feel free to add me on discord and we'll tackle this together. Zerothedarklord#8459
At what point is Self Switch A disabled?
Oh darn you are right.
I can think of a few improvements. Your event set to parallel process would run continually while on the map, checking 60 times a second whether to disable encounters, until it's done. Using a self switch means when you leave the map and come back, there will be no more encounters.

I'd suggest something like this instead:

Event 1 - set to parallel process
Control Variables: Encounters = 0
Change Encounters: Enabled
Erase Event


Event 2 - set to parallel process, and conditioned by Variable Encounter >= X
Change Encounters: Disabled
Show Text: Area Cleared!
Erase Event


The differences:
You're not using any switches or self switches, so you don't need to 'reset' events when you come back to the map.
You're setting the variable back to 0 which is the equivalent of setting self switch A off again in your example.
The second event only gets activated when the variable reaches the right amount, so it's not a parallel process that's doing a conditional branch for the entire time you're on that map. This makes it less resource-intensive.


If you want to have a parallel process running the entire time like you have in your example, you should at least add a Wait X Frames as the first statement. You do not need to check that variable 60 times a second to see if an encounter has been triggered.
Thanks guys. I got it setup and working!

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/reset-encounter.129698/