Testing all objects in same direction?
Hey I was wondering if it was possible to test if all objects were facing a certain direction. All the objects are on a static grid, so I've tried to do a bunch of selective choice events but none of them seem to be doing the trick. Is there an extension or something out there that can cure my woes? Or maybe I'm just missing a trick.
Re: Testing all objects in same direction?
If it doesn't let you select the object by using the objects direction, try this:
1:
Instead of changing the objects direction, change an alterable value between 0 and 31.
2:
Always: Set direction to the alterable value
3:
Search for all objects with the specific alterable value instead of the direction you want.
Re: Testing all objects in same direction?
Can you please be a little more specific about what you want.
Re: Testing all objects in same direction?
There's a grid of the same active object, whose direction gets changed pretty regularly. To solve the puzzle, they all need to be in the same direction. Currently, at least to my knowledge there's no way to do like an "all objects of x type are y" event.
The alternative value idea might work (if each active of the same type actually has its own alternate variables, which i don't think it does), but there's still no way to test to see all if they work. I tried using a counter and if it reached a certain level it finished, but multiple tiles are flipped over simulatiously and again no way to check that without more events and frustration, so I figured I'd ask here first before partaking on that challenge.
Re: Testing all objects in same direction?
Actually I just figured a way to get around it. Created an object on it when clicked, and when two overlapped they were destroyed. Effectively a giant direction counter :D
Thanks for the help though, you can lock this or whatever.
Re: Testing all objects in same direction?
If I understand you correctly, what you want is to know when every object of type A is facing in the same specific direction. When that is true, the puzzle is complete.
If that's correct then what you can do is instead of seeing if they are facing the correct direction, check to see if any are facing in the wrong direction.
You could do:
(have a global string to record if the puzzle is completed)
// first set the global string to true
* always
= set Global String IsPuzzleComplete to "true"
// then if any object is not facing in the correct direction set the global string to false
* Object A is not facing in direction X
= Set Global String IsPuzzleComplete to "false"
// if global string is still true by this event then they are all facing in the right direction and the puzzle is complete
* Global String IsPuzzleComplete = "true"
= Jump to puzzle complete screen or next puzzle or what ever
Haven't tried it but that should work depending on how you've got your game set up
TreeHugger