Distance model for music

Get help using Construct 2

Post » Mon Jun 03, 2013 8:24 am

Hey guys, i need your help. :)

I dont know how to add distance model for music. The watersounds should get louder if player is on the bridge. If he moves away the volume should get lower. See in the video below:
[TUBE]n9wUIFgG7Bo[/TUBE]

So i asked in an other thread, but didnt get a reply. Thats why i opened a new thread. Didnt want to spam. ;)

I figured out that it can work like this: System every tick -> Set volume(-distance(player.X, Player.Y, Sound.X, Sound.Y)/10 dB)

But i dont know how to embed it in my eventsheet. For example what is PlayerX and Y..SoundX and Y? What are the instructions after "System every tick". If i click "set volume" i only can type in a tag and volume..

Many questions.. ;) Sry for bad english..
B
12
S
2
G
1
Posts: 69
Reputation: 1,142

Post » Mon Jun 03, 2013 9:44 am

You can set up positional audio properties in the Audio object itself, then just assign a listener object in the event sheet. Here's a demo; drag-and-drop the green sprite.
B
57
S
15
G
11
Posts: 912
Reputation: 12,626

Post » Mon Jun 03, 2013 10:46 am

what GeometriX said... also pretty awesome looking graphics
i like the clean vector style :D
B
33
S
6
G
7
Posts: 339
Reputation: 7,426

Post » Mon Jun 03, 2013 11:38 am

Thank you for your quick reply! :)

But i didnt get it.. I updated construct, and saw the audio properties for the first time. :P

Since the update my Footstepsounds didnt work anymore.

(Keyboard/Right arrow is down - Audio/Play "run")
(Keyboard/On Right arrow realeased - Audio/Set "run" muted)..i think because of the new audio properties. Dont know how to solve it..

For the distance model i tried this:
(System/On start of layout - Audio/Set listener objekt to "player")
                                        - Audio/Play "water" not looping at volume db 0 at objekt "bridge"(...))

The sound is playing, but always at the same volume..
B
12
S
2
G
1
Posts: 69
Reputation: 1,142


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 24 guests