How to do a check on an event in another map

wickednick

Veteran
Veteran
Joined
Feb 19, 2016
Messages
65
Reaction score
3
First Language
Nick
Primarily Uses
So I need to figure out how to check if a self switch on a event in another map is on using script calls. I don't want to use switches to check for this because the particular thing I'm making is going to be a common part of the game and I might end up with needing to map hundreds of switches.
So whats going to happen is that when you open a door there is a chance of it making noise, you can reduce this by oiling the hinges. Now after entering through the now oiled door and going to the next map that door needs to also show it has oiled hinges. This is going to be a common thing so I don't want to use switches to check for this because its just going to get really hard to manage, so a script call is the best solution, but I'm not certain how to do this.
 

Hyouryuu-Na

Sapphire Sodium
Veteran
Joined
Jun 15, 2017
Messages
842
Reaction score
1,957
First Language
Not English
Primarily Uses
RMMV
$gameSelfSwitches.value([mapId, eventId, 'switch'])==true
You can exclude the ==true part though.
 

wickednick

Veteran
Veteran
Joined
Feb 19, 2016
Messages
65
Reaction score
3
First Language
Nick
Primarily Uses
So it would look something like

$gameSelfSwitches.value([2, 1, 'a'])==true
 

Hyouryuu-Na

Sapphire Sodium
Veteran
Joined
Jun 15, 2017
Messages
842
Reaction score
1,957
First Language
Not English
Primarily Uses
RMMV
Not 'a'. It's 'A'.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
30,918
Reaction score
7,450
First Language
German
Primarily Uses
RMMV
Just one added info:
This only works because switch data is stored outside all maps.

Other event data can't be accessed that way because only one map exists at any given time. That is why the maps reset on load - they're loaded from file, deleting the previous map data, and only the data that is not stored on the map itself is retained.
 

wickednick

Veteran
Veteran
Joined
Feb 19, 2016
Messages
65
Reaction score
3
First Language
Nick
Primarily Uses
So what data is stored outside of maps besides switches? I'm assuming variables also because that data seems to cross between maps.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
30,918
Reaction score
7,450
First Language
German
Primarily Uses
RMMV
only switches and variables.
you can see it on the name - anything datamap and gamemap is overwritten
 

Triangle45

Veteran
Veteran
Joined
Aug 26, 2020
Messages
81
Reaction score
22
First Language
Spanish
Primarily Uses
RMMV
Why don't you just use a switch that activates when the self switch of the previous map activates? The only info that can travel through maps are switches, variables and basically anything in the database.
 

wickednick

Veteran
Veteran
Joined
Feb 19, 2016
Messages
65
Reaction score
3
First Language
Nick
Primarily Uses
Because with the way this is going to work and that these types of events are going to be fairly common managing all those switches is going to get way to hard.
Using a script command may seem more complicated but it actually frees up a lot more room for me to use switches for other things that need them.
The solution provided works absolutely perfect and means I don't have to make a new switch for every event.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Its been almost 6 months since i've been here last and 5 years before that. the worst part is losing the game you were working on in a cpu fire.

Well time to go at it again.
my game is coming together im so happy
In this day and age, i might switch back to RMXP. I’ve lost faith in all the new plugins.
Wow it's been forever since I last logged in! I STILL want to make a game... I'll start it one day for sure!! It's a dream of mine.
This days I couldn't do anything... My mind is so confused and I couldn't work at all, I only wanted to play video games with my friends and that made all my projects delay a lot. Someone else feels this kind of thing sometimes? :/

Forum statistics

Threads
104,288
Messages
1,005,267
Members
135,799
Latest member
Hatsuya
Top