Archived

This topic is now archived and is closed to further replies.

  • 0
jrockwv

Switch

Question

Ok so i'm trying to make a switch that will make a gate unlock. However when i create an event for the switch, using below graphic, in game it doesn't show. Also i can't figure out the right script for the gate beside of the switch to open after the swithc has been turned and to close if the player hits the switch again. Anyone know how to do this?

post-10627-0-27846200-1364522118_thumb.p

Share this post


Link to post
Share on other sites

9 answers to this question

Create a quick event for a chest, then change the graphic and remove the unwanted stuff (you don't get an item from a chest).

Generally, if you want the switch to turn on and off, and affect something else in the game, you need to do it like this:

TAB 1

Graphic: switch is off (top row, middle column)

Conditions: none

Event Commands:

Set Move Route (this event) - play SE, turn left, wait 4 frames, turn right, turn switch ON

TAB 2

Graphic: switch is on (third row, middle column)

Conditions: switch (the one that was turned on by the move route above) is ON

Event Commands:

Set Move Route (this event) - play SE, turn left, wait 4 frames, turn up, turn switch OFF (the same switch that's used in the condition and on the other move route)

Now if you want something ELSE to depend on this switch, like a door that opens when the switch is on and closes when it's off, create a new event for it, with two event tabs. Tab 1 will have no conditions and the closed door graphic, and tab 2 will have the same switch as a condition and the open door graphic. It will also have event commands for whatever you want to happen when the player interacts with it after turning the switch on.

Share this post


Link to post
Share on other sites

The reason your graphic is not showing up is because you have the "self-switch" condition checked. That means that event page will not run (or appear) unless that self switch is already on. As for how to create what you want, Shaz's explanation should be what you need.

Share this post


Link to post
Share on other sites

Awesome. Thanks. I got the switch working. However i seem to have hit another road block. I can't seem to get my gate to work. I can still walk through it without hitting the switch. An i don't know why, but i can't get the event to make it open intead of the player doing it :(

post-10627-0-57723300-1364562976_thumb.p

Share this post


Link to post
Share on other sites

You have it set up so that switch 5 (move gate up/down) is turned on by touching the gate, not by pulling the lever. You should have switch 5 turned on when you use the action button on the lever. (If I'm correctly understanding what you're trying to do). What are your conditions for Page 2 of the gate?

Share this post


Link to post
Share on other sites

i was wanting it setup so that you can go back and forth between open and close via the lever. For the second page i had a blank graphic being the open gate then control switch 5=of and then self switch b=off so i thought that might switch it back to the front page.

Share this post


Link to post
Share on other sites

You must need a condition for the second event page (it's on the left side). If it has none, that one will be the first page to run, thereby giving you the illusion the gate is always open. In this case, you must set it to Self Switch B is ON (since you're turning it on in the first event page). Though I'm not quite sure why you're using B, is A already in use?

I recommend the Variables Guide if you want to see more examples of using event pages and conditions together, and how they work.

Share this post


Link to post
Share on other sites

Yep, don't use a self switch.

Your switch event should be set up just as I said above. Your gate event will have the closed gate sprite on tab 1 with no conditions and no event rules. On tab 2 it will have the open gate sprite, check the THROUGH box (see if you can walk through it without doing this, and if you can't, check that box), and will have the switch you turn on/off with the other event as a condition. If you're transferring the player when they walk through the gate, you will have the Transfer event command on the second tab. But if you're just letting them walk through to the other side, you don't need any event commands.

Share this post


Link to post
Share on other sites

Thanks guys i finally got it! ^^

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

  • Recently Browsing   0 members

    No registered users viewing this page.