How do I make a function inherit context from condition?

Get help using Construct 2

Post » Sun Jul 24, 2016 10:48 pm

Hey there, new here. actually I've been playing around with construct 2 for something like 2 weeks now but I'm hooked big time.

I have this issue, you see, I want to call a function that picks a random tile object that I have and sends another object (via Pathfinder) to its X, Y. Nothing revolutionary. You see, I want to make the Function keep in mind the context of the instance of the object I want to find a path for (instance of object Pather), but it ignores the Picked Instance Condition (that calls the Function) and juts sends all of the instances of said object down the path. It looks something of the sort:

On Call Function (Wander): Pather: Find path to Tile.X, Tile.Y
Pick Random instance of Tile: Pather: Move along Path

and then I call the function with

Pick Instance by Evaluate *something*: Function (Wander)


but it doesn't pick the instance of the evaluate condition, but instead does the function for all instances of the object (Pather)... A bit of redundancy in my describtion, I apologize but I really want to get the message across. Thanks!
B
18
S
3
Posts: 65
Reputation: 994

Post » Sun Jul 24, 2016 11:05 pm

Send the UID of the object to the function, then use Pick by UID to pick it first.
ImageImageImage
B
71
S
22
G
242
Posts: 3,734
Reputation: 134,994

Post » Sun Jul 24, 2016 11:09 pm

Hey Thanks....erm, how do I go about doing that?
B
18
S
3
Posts: 65
Reputation: 994

Post » Mon Jul 25, 2016 12:28 am

ImageImageImage
B
71
S
22
G
242
Posts: 3,734
Reputation: 134,994

Post » Mon Jul 25, 2016 6:55 am

Hey, thanks a million!
B
18
S
3
Posts: 65
Reputation: 994


Return to How do I....?

Who is online

Users browsing this forum: batto and 21 guests