How to use a switch?

Hi there, 

I haven't been using RPGMaker VX Ace for a few months and I have forgotten how to do simple things that I know a monkey could do lol.

But, anyway, I need help! 

So, all I want to do is have a character be in front of a bridge and pretty much say, "you shall not pass unless you got a key"

Then, my main character goes into a cave, retrieves a key, comes back and talks to that character again and he lets you go since you now have a key!

I just never got a real grip on variables and switches, so after not using rpg maker for a while I pretty much completely forgot 🙁

Thanks for your help!
I suggest you take a step back and read a few beginner tutorials. There's a pinned thread in the VX Ace Tutorials forum with links to basic tutorials.


For this, the event in front of the bridge needs two or three event pages, depending on whether you want the player to keep the key or not.


Page 1 will be just what you've got there - message saying they can't pass. Give that "same as characters" priority, so the player can't step on (and subsequently walk over) the event. And 'player touch' trigger.


Page 2 will be conditioned by Item [Key] Exists. Set to 'below characters' priority. Don't change the trigger (leave it to Action Button) if you want them to keep the key.


If you want the player to have to use the key (and remove it from inventory), set that page to 'player touch' as the trigger, and add event commands to turn on self switch A and remove the key from inventory. Then create a third page set to 'below characters' priority, 'action button' trigger, and 'self switch A is ON' as the condition.


OR you could make the event that gives you the key turn on a switch (not a self switch), and page 2 of the bridge event set to below player, action button, and conditioned by that switch. That will also let the player pass once they have the key, but will not remove the key from items.
Hey, thanks for that!

And yes I will definitely be looking at those tuts as I work through this! 🙂
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-use-a-switch.18728/