Jump to content


Photo

Switch


This topic has been archived. This means that you cannot reply to this topic.
9 replies to this topic

#1 jrockwv

jrockwv

    Advanced Member

  • Members
  • 63 posts

Posted 28 March 2013 - 08:55 PM

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?

Attached Files



#2 Shaz

Shaz

    Advanced Member

  • Global Moderators
  • 14,391 posts

User's Awards

        

Posted 28 March 2013 - 09:02 PM

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.
Avatar by Nio Kasgami

18169c77d45bf093.jpg18169c77ee71a21e.png18169c77eb8a1676.png47e3eb338e149021.png47e3eb33011708d4.jpg47e3eb33c3fcdd85.jpg43b995025d32e369.jpg18169c77d1548695.jpg18169c77d05acf45.jpg43aa62e584d51b37.jpg18057e87da521186.jpg

Amaranth Games
http://www.amaranthia.com

#3 servantb7

servantb7

    Servantb7

  • Members
  • 234 posts

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.


"This is how we know what love is: Jesus Christ laid down his life for us. And we ought to lay down our lives for our brothers and sisters." 1 John 3:16

#4 jrockwv

jrockwv

    Advanced Member

  • Members
  • 63 posts

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 :(

Attached Files

  • Attached File  gate.png   350.59KB   7 downloads


#5 servantb7

servantb7

    Servantb7

  • Members
  • 234 posts

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?


"This is how we know what love is: Jesus Christ laid down his life for us. And we ought to lay down our lives for our brothers and sisters." 1 John 3:16

#6 jrockwv

jrockwv

    Advanced Member

  • Members
  • 63 posts

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.



#7 Celianna

Celianna

    VX/Ace tileset artist

  • Global Moderators
  • 6,653 posts

User's Awards

        

Posted 29 March 2013 - 01:11 PM

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.

new_logo_small_zpsae8f2402.png
A new dungeon-themed tileset in the works.


#8 Shaz

Shaz

    Advanced Member

  • Global Moderators
  • 14,391 posts

User's Awards

        

Posted 29 March 2013 - 03:51 PM

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.
Avatar by Nio Kasgami

18169c77d45bf093.jpg18169c77ee71a21e.png18169c77eb8a1676.png47e3eb338e149021.png47e3eb33011708d4.jpg47e3eb33c3fcdd85.jpg43b995025d32e369.jpg18169c77d1548695.jpg18169c77d05acf45.jpg43aa62e584d51b37.jpg18057e87da521186.jpg

Amaranth Games
http://www.amaranthia.com

#9 jrockwv

jrockwv

    Advanced Member

  • Members
  • 63 posts

Posted 04 April 2013 - 09:24 AM

Thanks guys i finally got it! ^^



#10 Celianna

Celianna

    VX/Ace tileset artist

  • Global Moderators
  • 6,653 posts

User's Awards

        

Posted 04 April 2013 - 04:15 PM

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.

new_logo_small_zpsae8f2402.png
A new dungeon-themed tileset in the works.