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

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
30,951
Reaction score
7,463
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,951
Reaction score
7,463
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 Profile Posts

Trying to create a diagonal sprite, by following through GrandmaDeb's tutorial here.
(Basically, cutting up and resizing parts from the down and left version of the sprite.) :LZScheeze:


I've been reworking some old sketches, there's definitely a change on the artwork :kaopride:


Drawing a character who fight with his dog in battle is an interesting yet difficult affair. :D
Trying to get my good habits back again after this year... I need to go back to the gym, but Brazil is still in a bad situation of Covid-19, so I will try to work out at home! :D
I need to become a better battery.

Forum statistics

Threads
104,423
Messages
1,006,251
Members
135,946
Latest member
RPG_Girl
Top