Find path to object that has a certain instance variable val

Get help using Construct 2

Post » Fri Jul 25, 2014 5:10 am

Hello guys,

I've set up a little test where sheep collect material and bring it to the headquarters:

scrnsht_02.jpg


The material mountains are all the same object that have different values set for the instance variable material_number. This variable determines which animation is used and it also gives its value to the sheep's instance variable collecting_material_number when the sheep is dropped onto the mountain. When the sheep reaches the HQ, +1 is added to the appropriate material value (which is stored in an array).

Now the problem is that, when having reached the HQ, the sheep finds its path to the mountain in the middle, but not to the mountain which it first was dropped onto.

scrnsht_01.jpg


I'm looking for an event like

Find path to a mountain that has a certain value set at its instance variable, e.g. 2

I would appreciate any kind of help. Thank you.
You do not have the required permissions to view the files attached to this post.
B
13
S
2
Posts: 21
Reputation: 721

Post » Fri Jul 25, 2014 8:39 am

add a subevent:
system pick pick by comparison: object=mountain mountain.material number = sheep.collectign material number
and put the last two actions in that subevent..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Fri Jul 25, 2014 7:39 pm

Wow, this software is awesome. And so are you. Thanks a lot!

scrnsht_03.jpg
You do not have the required permissions to view the files attached to this post.
B
13
S
2
Posts: 21
Reputation: 721

Post » Fri Jul 25, 2014 10:27 pm

That works? I think you need Move along path in a separate 'On Path Found type' event..
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Sat Jul 26, 2014 10:18 pm

I thought so too, but it works, yes.
B
13
S
2
Posts: 21
Reputation: 721

Post » Sat Jul 26, 2014 10:27 pm

Careful.. it could be a timing thing. I would follow recommended practice..
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596


Return to How do I....?

Who is online

Users browsing this forum: 25games and 6 guests