Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

[SOLVED] Moving Object onto Switch

I know how to write an even to move on object event onto the floor switch event. But I don't know how to write the switch event to activate and open a door when the object even is on top of it. Can anyone help? Greatly appreciated.
 
To do this, you'll want to create a new Parallel Process event. In that event, assign variables to the object's Map X and Map Y. Then use a Conditional Branch and check if the variables are equal to the switch's coordinates. If they are, turn on a switch; else, turn off the switch.

Now in the switch event, you can create a new page where the switch is down (with the Condition that the aforementioned switch is on). You can open the door and add other commands here, which will only activate when the object is on the switch.

Good luck with it!

EDIT: FireRaven typed up a good example of commands below, so you can see that if you're still confused.
 
It seems Regi was just a bit too early for me to post this, but you can use this event as an example of what to use:

Code:
Control Variables 0001: Object Event Map X
Control Variables 0002: Object Event Map Y
Condition Branch: Variable 0001 == Switch X (find this number on the event grid)
  Condition Branch: Variable 0002 == Switch Y (same as above, just Y value)
     @>: Control Switches 0001 = ON
  End
End
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top