How do I make 2 of same objects interact

Get help using Construct 2

Post » Sun Aug 03, 2014 1:24 pm

I got 2 objects "wolf"

I want them to fight each other, but as you can expect, it's not possible using events like:

Wolf has LoS on Wof -> Wolf attack wolf

So i made a familiy and put them into it, then i rewrote it in:

Wolf has Los on WolfFamily -> Wolf attack WolfFamily

But no results, the wolf "sees himself" as the target and tries to reach himself by walking on a default angle, all the time


How can i solve this? Maybe i can add a condition that "excludes" himself (because it sees himself as a potential target)? Is there some condition like "wolf =/ Self"?
B
65
S
22
G
4
Posts: 358
Reputation: 6,555

Post » Sun Aug 03, 2014 1:36 pm

Try comparing their UID and making sure they're different. Seeing if they're different instances of the same object and then interacting between each other.

https://www.scirra.com/manual/130/common-features

(System, compare values, Wolf.UID)

I think you can't just compare "Wolf.UID" to "Wolf.UID", because it'll end up being the same. But there is a way around that, like adding another condition.
B
33
S
9
G
3
Posts: 493
Reputation: 4,042

Post » Sun Aug 03, 2014 1:41 pm

lol, i totally forgot about UIDs... thanks, it will surely work!
B
65
S
22
G
4
Posts: 358
Reputation: 6,555


Return to How do I....?

Who is online

Users browsing this forum: lukewasthefish and 14 guests