Pick UID from enemies generically on an OR event

Get help using Construct 2

Post » Tue Nov 27, 2012 9:39 pm

I want to make an event where when the main character collides with an enemy it destroys it so I am trying the following:

Event if enemy A collides with hero
OR
Event if enemy B collides with hero
OR
Event if enemy C collides with hero

THEN store that enemy UID

Sub event if hero animation is "attack"

THEN pick and destroy that enemy using the stored UID.


Thing is I can't find any way to pick that enemy's UID generically (regardless of the type of enemy A, B or C) I know that this can be achieved by making separate events for each enemy, but I find that to be too redundant.

Any help will be greatly appreciated :D

Thanks in advance
B
6
Posts: 13
Reputation: 477

Post » Tue Nov 27, 2012 9:44 pm

on collision > set a variable to enemy.uid

attack animation is finished > pick enemy by uid "variable" > destroyvtrix2012-11-27 21:45:28
ImageImage
B
61
S
19
G
6
Posts: 809
Reputation: 9,028

Post » Tue Nov 27, 2012 9:49 pm

Ok that was what I was pondering right now it seems there is no generic "pick" event that chooses the uid of whatever object collided with hero guess I will have to handle them separately. Thx
B
6
Posts: 13
Reputation: 477

Post » Tue Nov 27, 2012 9:53 pm

if you put the enemies into a family you could save the uid of the family
the collision would pick the right enemy a,b or c
ImageImage
B
61
S
19
G
6
Posts: 809
Reputation: 9,028

Post » Sat Jan 26, 2013 7:26 am

[QUOTE=vtrix] if you put the enemies into a family you could save the uid of the family
the collision would pick the right enemy a,b or c[/QUOTE]
How would I put the enemies into a family? What's a "family" in C2 terms?
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
113
S
20
G
8
Posts: 741
Reputation: 13,661

Post » Sat Jan 26, 2013 8:06 am

[QUOTE=Rhindon] [QUOTE=vtrix] if you put the enemies into a family you could save the uid of the family
the collision would pick the right enemy a,b or c[/QUOTE]
How would I put the enemies into a family? What's a "family" in C2 terms?[/QUOTE]

Here is link to description of families.
B
24
S
8
G
7
Posts: 756
Reputation: 7,192

Post » Sat Jan 26, 2013 2:24 pm

@Rhindon & @AlucardPR:
Please note that families are only available in licensed copies of C2.
B
27
S
8
G
8
Posts: 903
Reputation: 8,452


Return to How do I....?

Who is online

Users browsing this forum: DiabloOvermind, emoticon, odiusfly, Yahoo [Bot] and 20 guests