Play music when player dies

Get help using Construct 2

Post » Tue Jun 25, 2013 6:10 pm

Hi.

I want a little music to play when the player dies.
This is what it looks like in the layout:



And This (the doughtnut video) is what the music sounds like when played with VLC player, followed by how it sounds when activated in the game. See how distorted it sounds? Like it's playing it 6 or 7 times all out of sync.

Any ideas as to what's going on?

Thanks!




B
13
S
1
Posts: 68
Reputation: 1,198

Post » Tue Jun 25, 2013 6:21 pm

use a System Trigger once while true
B
38
S
13
G
3
Posts: 152
Reputation: 4,637

Post » Tue Jun 25, 2013 7:07 pm

don't do "stop" it wil lstop the sound as soon as it started.
B
9
S
3
G
3
Posts: 70
Reputation: 1,990

Post » Tue Jun 25, 2013 7:35 pm

thanks folks!
I'll use a system trigger and fix the 'stop'.
B
13
S
1
Posts: 68
Reputation: 1,198

Post » Tue Jun 25, 2013 9:56 pm

Yep, that did it. (I don't understand the mechanism by which it worked- but if it works, it works, right?)

Thank you
B
13
S
1
Posts: 68
Reputation: 1,198

Post » Tue Jun 25, 2013 10:10 pm

The Stopping of sound "b" shouldn't have been a problem. It was seeing that Y>LayoutHeight over and over every tick, and playing the sound many times.
Telling it to only trigger this event once while y>LayoutHieght will cause it to only play once.
B
215
S
57
G
32
Posts: 900
Reputation: 38,777

Post » Wed Jun 26, 2013 12:10 am

Ah! I see. Thank you, that's going to be handy to know.
B
13
S
1
Posts: 68
Reputation: 1,198

Post » Thu Jun 27, 2013 3:41 am

I use that when I suspect an event is firing too many times. I put a click sound in there, and I know to fix it, if it sounds like a motorboat.
B
215
S
57
G
32
Posts: 900
Reputation: 38,777

Post » Wed Jul 24, 2013 2:28 pm

Hi. When I try to use multiple audio actions it does not seem to work well.
I tried different setups:


1. Stop BG, play FX once, Start Bossmusic (in different orders)
2. Tried wait to add it after a delay
3. tried it with a new condition

But the Bossmusic does not start to play. I tried it with and without tag. Does anyone know how to fix this?
B
51
S
15
G
6
Posts: 682
Reputation: 8,911

Post » Wed Jul 24, 2013 2:47 pm

When I add Audio.Preload on the Title screen (the layout before the game layout) it seems to work and additional music files are played. The main music started on "On start of Layout" is not preloaded but played/streamed properly.

I thought preloading just works for sounds (some effects are not played until 6-10 seconds gameplay have passed when no preload was added) but it seems it works well for music, too.
B
51
S
15
G
6
Posts: 682
Reputation: 8,911

Next

Return to How do I....?

Who is online

Users browsing this forum: Zjahel0001 and 9 guests