Expression help: How to select path
Hi, new to the forum :)
This is making my head hurt!
I've already searched in here, in Nivram's site, even in Gamebuilder.info, there I downloaded the sample "Simpe following (delayed mouse paddle control sample)", which is nice, but didn't help me solve this.
What I need help with is this:
I have a dwarf and it has 3 possible movement paths,
In the stage there are 3 clickable boxes (two Wrong boxes and one Correct box).
So, if the player takes too long, there's an animation that will move the dwarf to the position of the correct box.
My thoughts were that this could be solved with an expression editor, something like:
Check Correct box's X position, if Correct box it's at position A, start movement 1 (which is path #1),
and if at position 2 animate using path 2
Or, create 3 conditions? like:
After 5 seconds:
If Correct Box is at position X1, start movement 1?
If Correct Box is at position X2, start movement 2?
If Correct Box is at position X3, start movement 3?
EDIT: Using the simple following example mentioned at the start of the thread, I tried deactivating it and only activating it after the time ran out, I thought it'd start running but no luck.
thanks!
Re: Expression help: How to select path
Managed to make it almost work using the sample code, deactivating and activating it, but even if I destroy it, and creating a new one, it still saves the Correct box position.
Well, it's an advance :)
Re: Expression help: How to select path
what you could try is have it go to whatever box the player clicks, then randomly call wether or not that box was the correct box.
like,
if: player selects box (and) random value = true,
box = correct box
or something like that
Re: Expression help: How to select path
Hi Izik and thanks a lot, I took a siesta and dreamt a solution! :)
1.- At the end of turn, create 3 objects, one for each box,
2.- See if any of them overlaps with the correct box
3.- If it overlaps, select according movement:
(if object #1 overlaps with Correct box, use movement #1,
if object #2 overlaps with Correct box, use movement #2
if object #3 overlaps with Correct box, use movement #3)
thanks!