Locational Damage and Picking

Get help using Construct 2

Post » Wed Jan 14, 2015 9:58 pm

So what I want is relatively simple:
When bullets collide with enemies, damage the enemy
When bullets collide with enemy head, damage the enemy more

The "heads" are invisible hitboxes in the same container as the enemies. I have it working for one type of enemy and type of bullet, but I have many types of bullet and enemies so I need to work with families. I've tried this:

Image

But this won't pick the enemy in the container with the head that is collided with, so all enemies are damaged.
How do I make it pick the right enemy.

Edit: I'm putting the word "headshot" here so it might help people find this thread in the future
Last edited by Erfeo on Thu Jan 15, 2015 12:07 pm, edited 1 time in total.
B
10
S
2
Posts: 26
Reputation: 687

Post » Wed Jan 14, 2015 10:08 pm

You might consider using a variable to store the "Enemy" UID to which your Enemy_Head is linked. I don't think containers work really well with families.
B
74
S
31
G
26
Posts: 994
Reputation: 20,198

Post » Wed Jan 14, 2015 10:25 pm

What does the variable Action do when set to "Hurt" ?
Why not handle the condition on different state like "Hurt_little" and "Hurt_more", so they execute properly.

I suggest you set the damage at first priority before other actions taking place.
ImageImage
B
111
S
51
G
24
Posts: 787
Reputation: 23,394

Post » Wed Jan 14, 2015 10:49 pm

Magistross: Oh right, that would work. Since I learned about container, they seem the go-to option for this sort of thing but I'm beginning to see that they have a lot limitations. Thanks for the help.

alextro: It prevents the enemy from performing actions like moving or shooting and plays an animation. Why would this cause a problem?
Why would damage need to go first.
B
10
S
2
Posts: 26
Reputation: 687

Post » Wed Jan 14, 2015 11:38 pm

Just in case to make sure the "Hurt" state doesn't prevent other actions to occur & make things are executed in right order.
ImageImage
B
111
S
51
G
24
Posts: 787
Reputation: 23,394


Return to How do I....?

Who is online

Users browsing this forum: AnD4D, Google [Bot] and 21 guests