- Joined
- Jun 8, 2015
- Messages
- 49
- Reaction score
- 1
- First Language
- English
- Primarily Uses
Hi everyone,
Here is what I am doing. I got my hero climbing in to a mine cart to ride it. The controls mechanics are simple, if I push the joystick in the direction of the rails once, the car will roll down the track by it self. if I press the cancel button, (Brakes) the car will stop. When the car hit a switch Tile, it need to go left or right (Depending what direction the switch is set) I am using yanfly's RegionEvents Plug-in with a common event to control the car. here is the Code in the event:
◆Script:$gamePlayer.updateEncounterCount()
◆If:Boat is driven
◆Loop
◆If:SwitchTouch is OFF
◆If:Button [Down] is pressed down
◆Set Movement Route:Player (Wait)
: :◇Move Down
◆
:Else
◆If:Button [Up] is pressed down
◆Set Movement Route:Player (Wait)
: :◇Move Up
◆
:End
◆
:End
◆
:Else
◆If:SwitchTouch is ON
◆Jump to Label:Stop_Here
◆Break Loop
◆
:Else
◆If:Button [Cancel] is pressed down
◆Jump to Label:Stop_Here
◆Break Loop
◆
:End
◆
:End
◆
:End
◆
:Repeat Above
◆
:End
◆Label:Stop_Here
I tried to do loop, but I am having trouble interacting with the Switch Event.
Switch Event Code here:
◆If:Boat is driven
◆Control Switches:#0138 SwitchTouch = ON
◆If:Player is facing Left
◆Set Movement Route:Player (Wait)
: :◇Move Up
◆
:Else
◆If:Player is facing Right
◆Set Movement Route:Player (Wait)
: :◇1 Step Backward
◆
:Else
◆If:Player is facing Down
◆Set Movement Route:Player (Wait)
: :◇Move Right
◆
:End
◆
:End
◆
:End
◆
:End
Any Ideas what I can do to make this work?
Here is what I am doing. I got my hero climbing in to a mine cart to ride it. The controls mechanics are simple, if I push the joystick in the direction of the rails once, the car will roll down the track by it self. if I press the cancel button, (Brakes) the car will stop. When the car hit a switch Tile, it need to go left or right (Depending what direction the switch is set) I am using yanfly's RegionEvents Plug-in with a common event to control the car. here is the Code in the event:
◆Script:$gamePlayer.updateEncounterCount()
◆If:Boat is driven
◆Loop
◆If:SwitchTouch is OFF
◆If:Button [Down] is pressed down
◆Set Movement Route:Player (Wait)
: :◇Move Down
◆
:Else
◆If:Button [Up] is pressed down
◆Set Movement Route:Player (Wait)
: :◇Move Up
◆
:End
◆
:End
◆
:Else
◆If:SwitchTouch is ON
◆Jump to Label:Stop_Here
◆Break Loop
◆
:Else
◆If:Button [Cancel] is pressed down
◆Jump to Label:Stop_Here
◆Break Loop
◆
:End
◆
:End
◆
:End
◆
:Repeat Above
◆
:End
◆Label:Stop_Here
I tried to do loop, but I am having trouble interacting with the Switch Event.
Switch Event Code here:
◆If:Boat is driven
◆Control Switches:#0138 SwitchTouch = ON
◆If:Player is facing Left
◆Set Movement Route:Player (Wait)
: :◇Move Up
◆
:Else
◆If:Player is facing Right
◆Set Movement Route:Player (Wait)
: :◇1 Step Backward
◆
:Else
◆If:Player is facing Down
◆Set Movement Route:Player (Wait)
: :◇Move Right
◆
:End
◆
:End
◆
:End
◆
:End
Any Ideas what I can do to make this work?












