proximity based volume [SOLVED] :)

Get help using Construct 2

Post » Mon Nov 26, 2012 6:14 pm

@sqiddster EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEIIIIII it works! woo! Marvellous thank you
B
39
S
12
G
8
Posts: 580
Reputation: 7,108

Post » Mon Nov 26, 2012 6:56 pm

Happy to help sqiddster2012-11-26 18:56:11
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Mon Nov 26, 2012 8:39 pm

@sqiddster

I wonder if I could poke your brain a bit more.

How could I use this formulae to say that if the player is out of range of the emitter, stop playing the audio file but if he is within the range of the emitter to start playing it?

This way I could place several of these emitters in a level and trigger the area sound dynamically without using lots of resource constantly looping the sound in the background even if it is inaudible.
B
39
S
12
G
8
Posts: 580
Reputation: 7,108

Post » Mon Nov 26, 2012 9:53 pm

Hmm, you might need to play around a bit, but try something like this:

If distance < threshold, Trigger once
Play audio looping

If distance > threshold, Trigger once
Stop audio

Something along those lines should work.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Mon Nov 26, 2012 10:05 pm

@sqiddster

Sorry do you mean

System Compare

First Value : -distance(playerbase.x,playerbase.y,audioemitterac1.x,audioemitterac1.y) / 80 + -10

<

number

Stop audio
B
39
S
12
G
8
Posts: 580
Reputation: 7,108

Post » Mon Nov 26, 2012 10:27 pm

Ah I figured it out almost!

every tick
for each "emitter"
distance < threshold
trigger once

/ play


every tick
for each "emitter"
distance > threshold
trigger once

/ stop


But when I copy different instances of the emitter, it only plays one instance of the audio, it's not emitting the same sound multiple times at the different sources.
B
39
S
12
G
8
Posts: 580
Reputation: 7,108

Post » Tue Nov 27, 2012 2:09 am

Hmm, not too sure. If you post a simple, stripped down capx I'll take a look at it.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Tue Nov 27, 2012 9:51 pm

@sqiddster

I figured it out :)

Here I made this little build for you to hear the proximity based area sounds. I took all the gameplay out all you can do is run around the level. Use arrow keys to move. Press space in the beginning to remove the platform.

https://dl.dropbox.com/u/3317708/ORBIT%20AUDIO/index.html
B
39
S
12
G
8
Posts: 580
Reputation: 7,108

Post » Tue Nov 27, 2012 11:28 pm

Wow, that's really nice ! And the graphics are awesome! Glad the sounds worked for you, they really helped the atmosphere.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Tue Nov 27, 2012 11:34 pm

Cheers yeah, the audio is pretty essential in this game and working within the construct 2 audio limitations can be...tough. All I need now is panning, just simple panning :(
B
39
S
12
G
8
Posts: 580
Reputation: 7,108

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 21 guests