musicalgenocide

Villager
Member
Joined
Jun 8, 2014
Messages
12
Reaction score
1
First Language
English
Primarily Uses
I am trying to make a common event that is called when the player is trying to open a locked door.

The idea is for the event that is locked to store the variables of the map ID and the event ID, then call the common event "Open Lock."

Control Variables: [0041:lock - map id] = Map IDControl Variables: [0042:lock - event id] = event_idCall Common Event: [Open Lock]The event would first check to make sure that the actor that has the lockpicking skill is in the front of the party...

@>Conditional Branch: Script: $game_party.members[0].id == 71 ...otherwise spitting out a generic "it's locked" message.

If the correct actor is in the lead, a script call would use the stored variables for map ID and event ID to change the self switch of the locked event to "D."

$game_self_switches[[[$game_variables[41]], [$game_variables[42]], "D"]] = trueThe locked event's self switch D would contain the loot if a chest, or simply a blank page if it was a door.

I have this all written in, but for some reason it's not working. I created an NPC to spit out the variables in text form to see if they were being set properly, and they were. This leads me to believe that I am not using the correct script call to set the self switch.

Any thoughts?
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,236
Reaction score
14,259
First Language
English
Primarily Uses
RMMV
I have split this out from the Script Call thread, because it's possibly going to require some screenshots and back and forth and really deserves its own thread

You've got a lot of brackets there that aren't necessary.

Also, if you're using a Script call to do the self switch, you don't even need to use variables.  So you can do away with those altogether, and just use the following in your script call:

$game_self_switches[[@map_id, @event_id, 'D']] = true
If that doesn't work, can you provide a screenshot of the following:

- your event where it's calling the common event

- the common event

- your event where it's calling the common event, but the tab with self switch D as a condition

Make sure you include the whole event window in those, because the triggers and conditions are important for us to see as well.
 

musicalgenocide

Villager
Member
Joined
Jun 8, 2014
Messages
12
Reaction score
1
First Language
English
Primarily Uses
Okay, that worked perfectly. I guess I was overthinking it - I figured since I was calling a common event, it wouldn't know the map ID and event ID, and I would have to put them into variables to get the common event to recognize it.

Thank you!
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,236
Reaction score
14,259
First Language
English
Primarily Uses
RMMV
Common events know where they're called from, and behave as if they are actually part of the calling event.  They're nice in that way :)
 

Latest Threads

Latest Posts

Latest Profile Posts

I just lost an hour plus of time to trying to modify the _battlefield sprite... when in reality MZ calls it _battleField ;_;

Even when debugging for the "undefined value", it looked exactly the same to my 20/60 eyesight.

I really prefer this_naming_convention rather than thisNamingConvention !!
hmm... I just solved one of the more annoying sideview battler problems in MV.. Passive States and Visual States can make it so when your character is in crisis HP, they don't go back to normal walk/wait when it's their turn. they stay in the crisis motion... neat.
Apparently all of LGBT reddit hates me. I posted a simple question and only got hate mail. What's the deal? The doompost was literally 6 months ago and I've changed my views since then and apologized.
MOD NOTE: See second response before replying to this. - Wavelength
Amazing. Simply amazing...

JRPG Browser - Playlist:

Forum statistics

Threads
109,100
Messages
1,042,045
Members
141,585
Latest member
CiderV
Top