Complex object pushing puzzles

Alright, so take a look at this screenshot.


http://imgur.com/uMTlRrk


The goal of this room is to push the orbs in such a way that they'll cover the green buttons.  The orbs keep rolling until they hit a wall, so you need to get clever with how you push them.


The problem I'm getting is making it so whenever an orb passes or lands on a button, it will press it and turn on a switch.  The all 3 switches are on, the puzzle is complete.  I want to make it so any orb can activate any switch, but doing so from what I've researched requires an absurd amount of variables and conditional branches.  I can't help but feel that there needs to be a better way to do this.  Can anyone help?
I would use regions on the green buttons.  Then, assuming your ball events have action button trigger, and a move route that simply says Move Away from Player and ignore if can't move, I'd change the move away from player to be a script call that does the appropriate 'move away from player' if this._regionId() !== X where X is the region id you've used.


You might have to play a bit to get the switches working and stop it looping, but I'd start with an approach like that.
I would use regions on the green buttons.  Then, assuming your ball events have action button trigger, and a move route that simply says Move Away from Player and ignore if can't move, I'd change the move away from player to be a script call that does the appropriate 'move away from player' if this._regionId() !== X where X is the region id you've used.


You might have to play a bit to get the switches working and stop it looping, but I'd start with an approach like that.

Alright, so I made it so when an orb stops moving, it will run a conditional branch with a script saying "if this._regionId() !== X" with a simple text display within the branch to make sure it's working.  When it stop rolling however, the game crashes and it says "SyntaxError Unexpected token this".

Original thread: https://forums.rpgmakerweb.com/threads/complex-object-pushing-puzzles.56330/