CrudeMik's Recent Forum Activity

  • 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.

  • sqiddster

    Sorry do you mean

    System Compare

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

    <

    number

    Stop audio

  • 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.

  • sqiddster EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEIIIIII it works! woo! Marvellous thank you

  • thanks a lot guys this looks good will try it out at lunch

  • I get that, but doing it this way would not mean a smooth gradient of volume it'd step.

    For example, if player is 599 px away from sprite : set volume to -20

    if player is 589 px away from sprite : set volume to -19.5

    if player is 579 px away from sprite : set volume to -19

    etc

    There has to be an efficent dynamic way of doing this using min / max values set to clamped variables. I just can't work it out.

  • I want to compare the distance between two sprites and adjust the volume of an audiofile accordingly and to update every tick.

    So if player is 600 px or greater distance from the emitter i want to stop playing the file.

    If the player is less than 600 px I want to play the file and to have its volume to ramp up incrementally from -20db.

    If the player is within 100 px of the emitter I want the volume to set at 0 db.

  • There's a way of doing it without duplicating audio files or writing a custom plugin for sure, I just don't know quite know how to do it.

    We can control the volume of an audio file via a variable. I just don't know how to link and clamp that variable with the volume properties of an audio file.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Here's the setup:

    I have a player sprite and an 'emitter' sprite, what I want to happen is when the player gets within a range of say 600 px of the emitter, I want the engine to play and loop an audio file.

    I want the volume of the audio file to increase to a maximum of 0db and to a minimum of -20 dependant on the proximity of the player sprite to the emitter sprite.

    When the player is out of the range of the emitter, I want the engine to stop playing the audio file.

    I can do most of this myself but I can't work out how to set up the variables and limk them with the volume of the audio file and to clamp the min / max range of said audio file.

    Any help will be appriciated.

    Thanks

  • harrio - haha cheers

  • KaMiZoTo - Thanks, yeah I'm aware of the lighting problems, I'm just experimenting with it all now, I like the hard contrast between light and dark but it'd make it easier to just lighten the whole scene more.

  • - Thanks man, the scope of the project has been limited,

    I can't imagine the game time to extend much further than 3 hours, reason being I actually want to finish it!

    The frame rate is a bit sh*t because of the fraps capture, it runs at 60 fps on my machine using Awesonium and full screen.

CrudeMik's avatar

CrudeMik

Early Adopter

Member since 29 Jan, 2010

None one is following CrudeMik yet!

Connect with CrudeMik

Trophy Case

  • 14-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

19/44
How to earn trophies