Help with event encounters system

jonthefox

Veteran
Veteran
Joined
Jan 3, 2015
Messages
1,432
Reaction score
594
Primarily Uses
So, I thought I had this all figured out, but having trouble with something...

Currently, I have each event set to erase / exit event processing if you win the battle and just stay on the map if you escape.   This works great because I wanted the dungeon to reset after the player left, to prevent Inn Abuse, to allow players to go back to re-do low-level dungeons later on in the game for the fun of it, etc..   So far, so good.

Here's my problem though.  I noticed that even if a player walks to the 2nd floor of the dungeon, when he goes back up the stairs to the 1st floor, all of the enemies have respawned.  Part of why I went with evented encounters instead of random encounters was to avoid this very issue:  my game has only a very limited touch of surrealism, so I don't want to use the "give the player a magic portal to take the party back to town" after every dungeon; I want players to have to walk back out of the dungeon the good old fashioned way, I just don't want them to have to re-clear all of the low-level monsters on the way out. 

Obviously, one way I could deal with this problem would be to give a switch for every single encounter in the game...but that seems way too much work and a poor way to do it.  Any other ideas?  I feel there's some super obvious way to handle this, but I'm unable to see it.

Thanks in advance.
 
Last edited by a moderator:

Oddball

Veteran
Veteran
Joined
Sep 4, 2014
Messages
1,923
Reaction score
534
First Language
English
Primarily Uses
N/A
Instead of using "erase event" use self-switches. this will erase them forever, and you don't have to make a switch for every encounter in the game

If you have multiples, just copy and paste

erase event's purpose is so events will respawn when the map is reentered
 
Last edited by a moderator:

jonthefox

Veteran
Veteran
Joined
Jan 3, 2015
Messages
1,432
Reaction score
594
Primarily Uses
Thanks - I thought of that, but I want the player to be able to go back to this dungeon after they leave and have the events respawn.

Is there a way to make the encounters not respawn until after the player has exited the dungeon?
 

seita

Donn_M
Veteran
Joined
Feb 6, 2013
Messages
2,254
Reaction score
611
First Language
English
Primarily Uses
The simplest way is to set each of them to self switch A after they've been defeated, then reset the self switches once the player exits the dungeon. Since they're walking, just have the exit event reset the self switches for the whole dungeon.

Just use the following script call to reset the self switches to false. replace map_id with the ID of the map, and event_id with the ID of the event.

$game_self_switches[[map_id, event_id, 'A']] = false

You'll have to set the self switch and the new page for each event, but at least for the resetting portion it's all in the exit event.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
Alternatively, have the battle throw a general switch e.g. Dungeon #3 fights to ON.  That switch conditions the second page with nothing on it.  The exit event turns that switch OFF.  Then you don't have to mess around finding all the map ids and each individjual event id, which is a lengthy process.  30 seconds does it.
 

jonthefox

Veteran
Veteran
Joined
Jan 3, 2015
Messages
1,432
Reaction score
594
Primarily Uses
Yeah I just realized it's still a lot of work to set every event's self-switch off.

With that general battle switch, I still have to make a switch for every event right?  Meh, there has to be an easier way...

Is there a way to say in a single line, "set the self-switch on map X, of any event GREATER THAN Y, to off" ?

-EDIT- ok wait, just thought of something...Isn't there a way on the 2nd page of all the events, to put some conditional that will set the self-switch to OFF when the player has exited the dungeon?   going to experiment with this...
 
Last edited by a moderator:

seita

Donn_M
Veteran
Joined
Feb 6, 2013
Messages
2,254
Reaction score
611
First Language
English
Primarily Uses
Again, the hardest part is just to put in the self switch and the second page. You can always copy and paste the pages between events, so it should be that much easier.

As for looking up each ID, a very easy way is to go into any event and open up the "Set Move Route" command. The dropdown lists all of the events with their IDs. Now, if you haven't been naming any of your events, this will be useless. If you have been naming them, then you've got a full list of all the events in the map and you can just jot them down in notepad and paste those script calls into the exit dungeon event.

There are faster ways, such as making sure all the monster events are in order event-ID wise and using a loop to go through them and setting their self switches off, but that would mean you had this planned from the beginning.

It's nice to find a perfect system, but oftentimes optimizing a system takes longer than doing it the simple way. I suggest just biting the bullet and doing it this way (unless someone has a much faster way).
 

estriole

Veteran
Veteran
Joined
Jun 27, 2012
Messages
1,309
Reaction score
531
First Language
indonesian
You could use script that can reset all map event selfswitch. But I forgot where I've seen that script. And since I'm not in my laptop with ace I cannot script it my own.
 

jonthefox

Veteran
Veteran
Joined
Jan 3, 2015
Messages
1,432
Reaction score
594
Primarily Uses
Ah, I'll search for it.  Until then, I've found the easiest way is to just make a regular switch for each encounter, and then set these switches to off when leaving the dungeon (since it's easy to select a 'batch' or range of regular switches).  I don't really follow how to make the self-switches script easy...I don't normally name my events, but even if I did, it's tedious and discouraging to think i'd have to add a line of code for every encounter. 
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,624
Reaction score
5,104
First Language
English
Primarily Uses
RMVXA
Yeah I just realized it's still a lot of work to set every event's self-switch off.

...

Is there a way to say in a single line, "set the self-switch on map X, of any event GREATER THAN Y, to off" ?
Yeah.  Just run a loop.

for i in 28..56$game_self_switches[[7, i, 'A']] = falseendThat will set Self Switch A OFF for every event between (and including) 28 and 56 on Map #7.

And if you don't have them neatly organized you can use:

for i in [28, 32, 36, 51, 55, 56]$game_self_switches[[7, i, 'A']] = falseendThat will set Self Switch A OFF for those six events on Map #7.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
I've moved this thread to VX Ace Support. Please be sure to post your threads in the correct forum next time. Thank you.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,049
Members
137,570
Latest member
fgfhdfg
Top