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,298
Reaction score
14,275
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,298
Reaction score
14,275
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 haven't been on here in forever wow(missed my forum birthday T-T). Anyways, I'm dabbling in BGMs, here's something I'm actually willing to share.

Binge-watched 6 episodes of the Erased anime... And that means I've watched half of it?! Sigh...
I'm bad at base-building games (looking at other players created an aesthetically beautiful base compared to me), but IDK why I keep playing the game and seek more of it.
Pyra and Mythra in smash ultimate are way too OP. They're basically Smash 4 Bayonetta 2.0, and not in a good way. Very toxic and unfair. At least they're hot tho.

Forum statistics

Threads
109,197
Messages
1,042,970
Members
141,700
Latest member
skybola188
Top