collision sounds at start of scene

forkliftforklift Member Posts: 386
I have a bunch of the same actors stacked on each other that are already touching when the scene starts. I want them to make noise when a collision occurs, but when i have the rule set like so:

when Actor1 touches/collides with Actor1(itself)
play sound

Since they're already touching at the start, i get this erruption of sounds as the actors settle ontop of each other.

How do I work around not playing a sound until after they're settled? It seems that I can't use the rule above to keep these things silent at first until they settle.

Note: I can't see them moving, but for at least 2 seconds they make sounds.

Comments

  • gazjmgazjm Member Posts: 578
    You could put a timer in which says after 3 seconds, then your rules. That way, the rules won't apply for the first 3 seconds of the scene.
  • forkliftforklift Member Posts: 386
    I tried that last night, but it didn't work. Maybe I need to set the timer longer. Since that rule didn't work, i figured it was reading collisions after the timer went off.
  • gazjmgazjm Member Posts: 578
    Thats strange, i had a similar problem and that fixed it. Did you have all the rules in eg

    timer after 3 run to completion (this needs to be checked from what i can remember)

    when Actor1 touches/collides with Actor1(itself)
    play sound
  • forkliftforklift Member Posts: 386
    I'll make sure that 'run to completion' is checked after work today, thanks.
  • forkliftforklift Member Posts: 386
    Run to completion doesn't matter. After numerous tests last night, the 'when collision with actor' rule is ALWAYS on no matter what, so I always get the sound at startup. Even when delaying using a timer, it will sound at the start of the scene, then sound again after the timer.

    This has to be some kind of bug. I even set up other rules that made it impossible to be 'true' surrounding this sound. It still goes off on the start.

    This is stupid.

    Anyone know a way around this?
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Hi forklift; It's odd it won't work as gazjm said...

    Maybe try a boolean attribute, so:

    When all conditions are true
    when Actor1 touches/collides with Actor1(itself)
    when attribute SuchandSuch is true
    play sound

    with an off-screen actor with a Timer in the Rules,
    after 3 seconds
    change attribute SuchandSuch to true.

    Can't see why that wouldn't work.

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • forkliftforklift Member Posts: 386
    I can't see how it's not working, either. I had the logic set up with a boolean which is ALWAYS off and it still made the sound!! After work, I will try to use an instance to control a game.boolean instead of the actor itself hosting it.
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Fingers crossed that works for you. :-)

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • forkliftforklift Member Posts: 386
    This just isn't working. I even started a brand new project and set it up like this:

    game has a boolean called game.sound
    2 actors: ground & box both have collision rules for eachother
    1 instance: timer after 3 seconds set game.sound true
    box has a rule: when game.sound = true, play sound on collision with ground & box

    as soon as the timer is over, even after all the boxes have settled into place, the sound goes off!

    Help!
  • gazjmgazjm Member Posts: 578
    Im at work at the moment so can't test this to see if its even possible, but I think it is.

    Get rid of the timer

    set the volume on the sounds to 0, then have a timer which after 3 seconds changes the volume to 1.

    this should still let the initial sound play, but you won't be able to hear it as the volume is 0.

    Like i said though, im not sure if you can control the volume with a rule, but i think you can.

    cheers
  • forkliftforklift Member Posts: 386
    Thanks, that's good thinking, gazjm. I'll see what I can do after the daily grind.
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    Just wrap the sound behavior in a rule that says when self.time is greater than 2

    Don't add a timer when you already have the self.time running anyways.
  • forkliftforklift Member Posts: 386
    More awesome suggestions, thank you so much everyone. I hope to have a video up soon of what I'm doing.
  • forkliftforklift Member Posts: 386
    Scitunes, that method still has the sounds errupting after the self timer goes off.

    Tshirtbooth, that method does work, thank you.
  • comoquerescomoqueres Member Posts: 1
    tshirtbooth,
    I've been trying for four hours (prob longer) to figure it out on my own. No luck. How do you

    "at the end of a level i change device.audio.sound to 0
    then at the beginning of the level i change device.audio.sound to 1 AFTER 1.5 seconds:"

    Is it done through rules in an actor? or some attribute of the scene? Thanks.
Sign In or Register to comment.