Play Sound with multiple enemies. Help!

Get help using Construct 2

Post » Sat Aug 17, 2013 8:05 am

Hi!

When [Enemy] is close to [Player], enemy plays attack animation and then plays sound of attack. It works well with a single enemy but I'm going to have more than one enemy of same type on my level. And the problem is that when I use more than one enemy, the sound of attack doesn't play at all or sometimes it plays for only one enemy. What should I do to have each enemy play attacking sound as soon as it gets close to Player?

https://drive.google.com/folderview?id=0BwBHvnixj6i8b2dtRWRtX0FWdGM&usp=sharing
B
12
S
2
G
1
Posts: 41
Reputation: 1,442

Post » Sat Aug 17, 2013 10:54 am

"For Each"

Conditions>System>ForEach

Note: I haven't looked at the capx which I will do now.
B
20
S
7
G
4
Posts: 322
Reputation: 4,521

Post » Sat Aug 17, 2013 11:13 am

"For Each" doesn't work with triggers, but I do have one!

The event is something like this:

If [Enemy is on stopped] + If [Enemy is overlapping Player] then [Enemy play "Attack" animation] and [Play sound "Attacking"]

Since I have [On Stopped] trigger, the "For Each" loop won't work.

Let me know if you checked the .capx and have any ideas, please.
B
12
S
2
G
1
Posts: 41
Reputation: 1,442

Post » Sat Aug 17, 2013 11:17 am

@BigDream I'm sorry I've tried for half an hour now using functions, different loops and conditions.. but no success.

Sorry pal.
B
20
S
7
G
4
Posts: 322
Reputation: 4,521

Post » Sat Aug 17, 2013 11:22 am

@BigDream http://db.tt/wAtg2vFp
Here is what I did too... logic wise... I can't see why that didn't work.

And for anyone else who reads those events, I did try "for each" and "every 0.1 seconds (when colliding)" and other conditions.
B
20
S
7
G
4
Posts: 322
Reputation: 4,521

Post » Sat Aug 17, 2013 11:59 am

@Sulli, weeks ago I contacted Ashley about this problem but he told me to post to the forums. I knew it wasn't going to help... But anyway, thank you for trying!
B
12
S
2
G
1
Posts: 41
Reputation: 1,442

Post » Sat Aug 17, 2013 4:05 pm

Tadaa ...
Whiteclaws2013-08-17 16:05:55
B
42
S
17
G
17
Posts: 2,247
Reputation: 17,461

Post » Sat Aug 17, 2013 6:41 pm

@WhileClaws, could you please send me the .capx with your changes?
B
12
S
2
G
1
Posts: 41
Reputation: 1,442

Post » Sat Aug 17, 2013 11:35 pm

@BigDream don't be so lazy :P



http://db.tt/6niX4VgGSulli2013-08-17 23:38:41
B
20
S
7
G
4
Posts: 322
Reputation: 4,521

Post » Sun Aug 18, 2013 8:06 am

I needed the .capx

Thank you guys for your help!
B
12
S
2
G
1
Posts: 41
Reputation: 1,442

Next

Return to How do I....?

Who is online

Users browsing this forum: KTML5 and 19 guests