Can't figure how to make a switch work like other games I've played, for example:
There's a switch on the floor, when you step on it, it will have a move route so it changes appearance to a pressed switch, but when you move away it deactivates (move route again, changing appearance to an unpressed switch). The point of this is: you need to put a crate on the switch so it can remain pressed.
Saw some tutorials but they don't have the option to deactivate when you move away from the switch, and that would make a game more interesting.
Any help is well appreciated :kiss:
Switch event has 3 pages. All set to Below Player. Also set all to THROUGH (I THINK this is needed in order for the crate event to be able to be pushed onto it - I have a feeling events don't look at the priority of other events - they just look at the THROUGH).
To make things easy, go to the Region layer and paint the tile the switch is on with one of the region blocks. Note the id (I'll use 50 as an example)
Page 1 has switch in "off" position (not stepped on), and trigger is Player Touch.
Event command is simply Control Self Switches A = ON
Page 2 has switch in "on" position (stepped on), and trigger is Parallel Process. Condition is Self Switch A
Event commands should look like this:
Conditional Branch: Script: $game_player.region_id != 50 Control Self Switches A = OFFBranch EndWait 10 FramesPage 3 has no graphic and no commands and Action Button trigger. Condition is Switch [????]: Box in PlaceNow on your box/crate event, have 2 pages.
Both pages will have the crate image, make sure you check the Direction Fix button.
First page will have these commands:
Set Move Route (This Event): Move Away From Player (Wait for completion)Conditional Branch: Script: $game_map.events[@event_id].region_id == 50 Control Switches [????]: Box in Place ONBranch EndThe second page will be conditioned by that switch as well and will have no event commands.This means once the box has been moved onto the switch, it can't be moved off again.
At the point where you turn that switch on, you would also do whatever else you need when the box is over the switch - open a door, whatever. In fact you'd probably want to do that too in the switch event when the player steps on it, and undo it in the second page when the player steps off again.
What's with the script?
Can't understand everything else after that without knowing where the script came from and why a script :dizzy:
Yea.. another problem would be, I don't use variables or get location info options because I don't understand what they are for.
Any other answer easier to understand?
If you don't understand variables, then it's time to take a look through the beginner tutorials on the site. Do a search for Variables Guide and it should bring up a tutorial 🙂
I made it work when the player steps on it, but it seems the barrel can't touch the switch even if its set to the above character's priority.. will check the variables guide then make a new post in here in case I have a question, which is most likely to happen :blush: