How to do a check on an event in another map

wickednick

Veteran
Veteran
Joined
Feb 19, 2016
Messages
66
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
930
Reaction score
2,179
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
66
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
930
Reaction score
2,179
First Language
Not English
Primarily Uses
RMMV
Not 'a'. It's 'A'.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,236
Reaction score
7,617
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
66
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
31,236
Reaction score
7,617
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
86
Reaction score
24
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
66
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 Profile Posts

I made some sideview closets for MV!
You can find them in my MV resource thread.
People1.png & SF_People1.png added!!!!

Adventurer:
"Why your body looks like a bird?"

Stranger:
"Because I'm harpy"

Adventurer:
"Clap along if you feel like a room without a roof"

*Both dancing to Pharrell Williams song*
Stream will be live shortly with a make-up session of the Interactive Text Adventure! Feel free to drop by!

Forum statistics

Threads
105,506
Messages
1,014,263
Members
137,174
Latest member
jeversss
Top