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
929
Reaction score
2,180
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
929
Reaction score
2,180
First Language
Not English
Primarily Uses
RMMV
Not 'a'. It's 'A'.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,240
Reaction score
7,619
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,240
Reaction score
7,619
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 Posts

Latest Profile Posts

Tomorrow is Thanksgiving, and I'm so excited! I've been exploring MZ a little, and I just downloaded Effekseer to make new animations. I have experience in 3D animation software, so I'll be pretty good at the whole "particle" thing. My first game on MZ will be Fantasy Force--starring a griffin, a dragon, and a pegasus fighting against the Dragon of Darkness.
currently listening to Driftwood Gaming streaming some MZ dev time and it's delightful! had no idea they were this entertaining, love it
In quarantine, will be tested soon. This year is really something... special.
I was at another orientation yesterday and I realized I'll be working with an old friend! We met at the local water park a few years back and it was so nice to see her again! We had a chat, and next week when I officially start, I'll see if maybe we can trade our Zoom IDs so we can talk!
I made some sideview closets for MV!
You can find them in my MV resource thread.

Forum statistics

Threads
105,512
Messages
1,014,337
Members
137,198
Latest member
mmc1980
Top