How do I reset all of the events and switches and variables in a map WITHOUT transfering maps?

Sausage_Boi

Game Dev. "Artist."
Veteran
Joined
Sep 10, 2014
Messages
1,733
Reaction score
681
First Language
Americanese
Primarily Uses
RMVXA
Is there a quick, easy way to reset a whole map without transferring the player to another map and back? I am at a loss as to how to perform this. Any help is greatly appreciated.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Because switches and variables are global and not tied to a map, no, unless you have an event on that map that initializes them when the map loads.

$game_map.setup(@map_id)would reload the current map, moving all the events back to where they were previously, while keeping the player in the same spot. This means you will be able to see some events disappear or snap to a different location.
But no, it would not reset variables/switches to what they were when you first entered the map.
 

Sausage_Boi

Game Dev. "Artist."
Veteran
Joined
Sep 10, 2014
Messages
1,733
Reaction score
681
First Language
Americanese
Primarily Uses
RMVXA
So I would have to manually event the switches and variables resetting? Are self-switches global?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
no, self switches, as indicated by the name (and that fact that when you use a Control Self Switches command you don't get to choose a map or event) are private to the event.


You would need to have an event set to parallel process on the map you wanted to reset, that would initialise the values of all the switches and variables you want to reset, as well as a Script event command that would loop through every event on the map and turn off all the self switches. You need to do it in a script call because you can't change one event's self switch from another event using event commands.
 

Zoltor

Veteran
Veteran
Joined
Jan 18, 2014
Messages
1,550
Reaction score
211
First Language
English
Primarily Uses
I Created a random map generater, and what I'm going to do, is devote a entire batch of normal switches to whatever may show up on the maps, and every time I'm go to the next floor, I reset all the switches by the batch all with a single command, so that's what I would do. In your case, you can use any kind of event to just rest such.

It takes some planning ahead, but It's nice, and clean.
 
Last edited by a moderator:

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

Latest Threads

Latest Profile Posts

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'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:

Forum statistics

Threads
105,854
Messages
1,017,004
Members
137,562
Latest member
tamedeathman
Top