Play a sound of specified name in string

Get help using Construct 2

Post » Mon Jul 01, 2013 5:51 am

Currently, I have many sounds, and in C2, we can choose any sound in the dropdown menu of those audio related events. But the thing is this, I want the player to choose some specific sound.

If I have only a few sounds, I could simply go with: if player's chosen index is 1, 2, 3, then play sound A, B, C. Etc. Sure, that would be very simple with events, but I'm talking about at least 50 sounds here. Doing if else if else for all the sounds is horrible. There should be a better way.

I've came across nickname plugin, which allows you to associate any object type with a string. That is very handy. But it does not cover sound department.

So are there any alternative? Having 50 events for 50 sounds is a horrible idea.
I got a game that you multiply, breath fire with two heads and brawl foes to oblivion with your clones: http://www.newgrounds.com/portal/view/660664 (use Chrome on Windows for best performance)

My sites:
http://twinblazar.deviantart.com
http://twinblazar.newgrounds.com
https://twitter.com/twinblazar
http://www.pixiv.net/member.php?id=15072448
B
30
S
11
G
11
Posts: 411
Reputation: 8,469

Post » Mon Jul 01, 2013 6:07 am

Use Play (by name).
ImageImageImage
B
71
S
22
G
247
Posts: 3,753
Reputation: 137,552

Post » Mon Jul 01, 2013 6:12 am

*play sound: [slapstick comedy] got punched in the face*

Oh, my god... It's that simple?
I got a game that you multiply, breath fire with two heads and brawl foes to oblivion with your clones: http://www.newgrounds.com/portal/view/660664 (use Chrome on Windows for best performance)

My sites:
http://twinblazar.deviantart.com
http://twinblazar.newgrounds.com
https://twitter.com/twinblazar
http://www.pixiv.net/member.php?id=15072448
B
30
S
11
G
11
Posts: 411
Reputation: 8,469

Post » Mon Jul 01, 2013 6:42 am


Woo woo woo woo woo woo woo woo woo woo, nyuk nyuk nyuk nyuk
ImageImageImage
B
71
S
22
G
247
Posts: 3,753
Reputation: 137,552


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 10 guests