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?
Posted 28 March 2013 - 09:02 PM
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:
Graphic: switch is off (top row, middle column)
Set Move Route (this event) - play SE, turn left, wait 4 frames, turn right, turn switch ON
Graphic: switch is on (third row, middle column)
Conditions: switch (the one that was turned on by the move route above) is ON
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.
Posted 28 March 2013 - 09:03 PM
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.
Posted 29 March 2013 - 08:16 AM
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
Posted 29 March 2013 - 08:37 AM
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?
Posted 29 March 2013 - 11:11 AM
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.
Posted 29 March 2013 - 01:11 PM
I recommend the Variables Guide if you want to see more examples of using event pages and conditions together, and how they work.
Posted 29 March 2013 - 03:51 PM
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.