View Full Version : Weird Problem with OPE

06-27-2014, 12:34 PM
SOLVED: I've got it working now but I'm still not sure why it was doing what it was doing.

I'm having a really weird problem with the Object Position Event and was hoping somebody may have some ideas what could be wrong.

I'm creating a marble skill game. My goal is to have a few levels contained in one map so after you complete a maze it resets you to the next one. The first maze works perfectly, it even has some checkpoints that reset the ball to different points. Yet for some reason when I try to reset the ball to the second level the ball teleports to random places.

I'll try to explain the logic set-up.

First even though I'm using a ball as the playable character I'm still using the rider and checkpoints to count resets and progress between stages. So for example on the first maze there are two checkpoints right next to each other so that when the ball falls off the course, the player hits B and the rider resets to the second checkpoint. From that checkpoint an impulse goes to series of filters, these check the custom checkpoints I've created for the ball. When the ball triggers a custom checkpoint it ads 1 to a variable data source. That variable data source is checked by the filters and if a checkpoint has been triggered an OPE puts the ball at that checkpoint instead of it's original position at the start of the maze. This works as intended.

I tried to use the same idea for the second maze. After the first maze completes there is a pause as it calculates the time bonus. After the time bonus is calculated a player event sets the rider to the 3rd checkpoint (the next stage) without resetting physics. The checkpoint set-up here is exactly the same, two side by side so both are triggered together the first time but subsequent resets only the second is triggered. The first is used to reset the clock and game camera for the next stage, that only needs to happen once, the second checkpoint is activating the same filter set-up from the previous stage to determine where to set the ball with OPE. It's here that I'm having issues. No matter what I try this OPE moves the ball to random locations, not the coordinates I've given it. The OPE is using a vector object info to get coordinates, I've also tried manually inputing the coordinates, I've checked that there are no other active OPEs targeting the ball, I've even deleted and remade whole chunks of the logic but the ball still teleports to random locations after the first maze. I can't figure it out.

EDIT: I've been trying some more things. I've found that it's only that initial reset that is acting weird, if I press B the ball is set in the correct position.

SOLVED: Still don't know what was going on but I've rearranged some logic and its working now.