How do I make NPCs to fight among family members.

Get help using Construct 2

Post » Wed Nov 11, 2015 10:57 pm

"Enemy" is a family, on collision with "shoot". I have to pick "Enemy" which UID is "shoot.owneruid", set it as target and hunt him down. Done like that. Not working.
B
7
S
3
G
1
Posts: 154
Reputation: 1,812

Post » Thu Nov 12, 2015 3:52 pm

Let me extend this problem. The player is firing some shoots here and there. Enemies that got hit start to hunt him down and occasionally fire against each other getting in another fight between family members... so... how do i do?
B
7
S
3
G
1
Posts: 154
Reputation: 1,812

Post » Thu Nov 12, 2015 3:59 pm

Occasionaly.. When is that?

You have to provide all the conditions for the computer to know when to do what..

I'm guessing You have no issue getting an enemy to hunt the player when he is shot, because that seems pretty straight-forward..
What conditions should be true for that enemy to start shooting at other enemies?
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 » Thu Nov 12, 2015 4:39 pm

what about using line of sight of other enemies pull their variable, UID and do a Choose set number string based on the line of sight pulled in. and have that to target the enemy?

I look at it like this If I am angry then the first person or enemy in my view (line of sight) gets shot or I "Choose" that kid over there and then start blasting. And you can event place your own variable for the player in that choose number string.
B
51
S
24
G
6
Posts: 391
Reputation: 7,820

Post » Thu Nov 12, 2015 7:51 pm

I am so happy for your ongoing effort answering my problems. Thank you @gearworkdragon and @littlestain

This is how i make them hunt me:
Image

Ignore any variable non-related on any condition presented. Although they are in Portuguese you can understand it easily

Now, the problem really is as they are fighting the player and shooting him, some bullets may hit on people from the same family but from a different faction and that will change the target priority for them. I am about to implement codes for every faction on the game, but it would be really helpful and code efficient if i could do it all one time using families.

Already created enemy2 family with the same sprites and tried it as targets not happening...

Ps.: (rotation toward is simple and done in another section)
B
7
S
3
G
1
Posts: 154
Reputation: 1,812

Post » Fri Nov 13, 2015 12:01 am

could we see the name of the family ? Its hard to tell which family doing what.
B
51
S
24
G
6
Posts: 391
Reputation: 7,820

Post » Fri Nov 13, 2015 4:05 pm

Everything Faccoes
B
7
S
3
G
1
Posts: 154
Reputation: 1,812


Return to How do I....?

Who is online

Users browsing this forum: zsoldiers and 6 guests