How Do I Attach Audio to a Characters Move Action?

Discussion in 'How Can I...?' started by Phill Mason, Sep 30, 2015.

  1. Phill Mason

    Phill Mason Serious Boxer

    Joined:
    Sep 25, 2015
    Messages:
    880
    Likes Received:
    721
    Hi folks, I have a character that flies and stops again and I would like to attach a sound to the moving action to give the character some life.

    I've tried attaching a transparent object to the character and applying a sound on wakeup, but that only seems to work on the start level, plus it doesn't stop, which isn't what I'm going for.

    Anyone have any ideas on how we could do that?
     
  2. Collin Wade Thiessen

    Collin Wade Thiessen Avid Boxer

    Joined:
    Sep 25, 2015
    Messages:
    291
    Likes Received:
    341
    You could do it with actions but need to time the gameplay with when it stops/starts. If flying is attached to the jumpsound you could have a spawner with a sound in the action that only sounds when you jump. Hope that helps
     
    Phill Mason likes this.
  3. Phill Mason

    Phill Mason Serious Boxer

    Joined:
    Sep 25, 2015
    Messages:
    880
    Likes Received:
    721
    I like your thinking @Collin, but he doesn't jump. I did look at this and we have options for, jump, shoot, defeated and ground collision, but nothing for move. I played around with the actions idea, but the character can randomly move around in all directions and could start and stop at anytime, so timing it games-wise won't work either. Thanks bud.
    Perhaps a "move sound" will show up in a future update :)
     
    Sean Buildbox and AndyG like this.
  4. AndyG

    AndyG Miniboss Boxer

    Joined:
    Sep 25, 2015
    Messages:
    1,100
    Likes Received:
    915
    +1 That sounds like a great idea Phill. Im already thinking footsteps with the move action :)
     
    Phill Mason likes this.
  5. Kamil Kucma

    Kamil Kucma Boxer

    Joined:
    Sep 25, 2015
    Messages:
    62
    Likes Received:
    41
    Hi Phill, I was thinking a lot about it, and actually I found a way to do it!
    1. add an invisible object and give it a desired idle sound
    2. go to the character settings and open "move animation"
    3. place there your char + drag there that invisible object, set it to spawner, no collide and add a -1000 (for example) linear velocity to remove it quickly after it play the sound once

    It's not perfect but works really good for me ;-)
     
    mxstudios, swnam12, mattrouse and 3 others like this.
  6. Phill Mason

    Phill Mason Serious Boxer

    Joined:
    Sep 25, 2015
    Messages:
    880
    Likes Received:
    721
    @Kamil Kucma, excellent idea, thanks matey :) I didn't think about using a spawner and I've tested it and it works a treat.
    For me, I found it better attaching a sound to "WakeUp" rather than 'Idle' because idle only triggered the very beginning of the sound and wakeup played the whole mp3.

    What I really love about working with the spawner in this way is, I can set the "Spawn Rate' to match my audio clip length exactly so my character has a kind of pulsing audio from a very short soundbite - very cool. Thanks again for the loan of your brains, it's added an extra dimension to the character :)
     
  7. GTE Games

    GTE Games Avid Boxer

    Joined:
    Sep 25, 2015
    Messages:
    251
    Likes Received:
    254
    @Phill Mason , I know this is an old thread. I can't get the sound tto attach to the wakeup sound.

    I just want to make sure I'm trying this right. You attached the sound to the "wakeup sound" field on the invisible object that you dropped into your characters "move animation", correct? I see the OP was during BB 1.3.4 (I believe) so maybe something changed.

    Any tips appreciated. Thanks.
     
  8. Phill Mason

    Phill Mason Serious Boxer

    Joined:
    Sep 25, 2015
    Messages:
    880
    Likes Received:
    721
    Hi @mojpoj I've been looking through my notes and my bb file to try and remember all the actions I took to get this sound-hack to work. I usually write myself "How To" notes so I remember how to implement a hack in the future, but unfortunately didn't do that for this one.

    I read over the help I got in this thread above and looked at my game and can see that I added an invisible object and this object hold the move sound I want my character to have. I then went into the characters move animation which already had the move animation inside and I opened the object list on the left. From the object list I added my small invisible object I'd added earlier to my move animation and placed it close to my character. I gave it the following attributes:
    Decoration, Fixed -500 X velocity, No collide, No destroy, wake up + distance 5 and spawner 1.3 permanent. The 1.3 setting makes the sound trigger about right for the length of my mp3, you'll have to experiment a bit to get it right for your characters move sound.

    When the character stops, your sound stops spawning, so it works great for giving a little bit of life when your character moves, good luck :)
     
    swnam12 and mojpoj like this.
  9. eyal

    eyal Serious Boxer

    Joined:
    Sep 25, 2015
    Messages:
    642
    Likes Received:
    121
    Hi @Phill Mason - thank you for the detailed explanation. I did what you wrote but couple of things happen -

    1. even after the character dies, the sound continues till it's finished
    2. it seems that it's playing over and over and not just as a loop but one over each other - I have only one track

    The main difference is that I don't don't put it in the move but in the default animation because I have nothing in the move.

    Any idea ?
     
  10. heathclose

    heathclose Miniboss Boxer

    Joined:
    Jan 28, 2016
    Messages:
    1,810
    Likes Received:
    1,026
    Yah, I've had an eye on this thread because I need a constant character sound (until death anyway)... will post a vid here later for more suggestions and ideas on top of what I've done (with this threads help btw)...
     
  11. Phill Mason

    Phill Mason Serious Boxer

    Joined:
    Sep 25, 2015
    Messages:
    880
    Likes Received:
    721
    Hey @eyal, not really sure why you're not getting the desired result.

    1: My first question would be, how long is the audio clip you're using for your character? Mine was about 1 or 2 seconds, that's all. I timed it with the spawner so it triggered again just as the first impression stopped.

    2: Again, this maybe due to the length of your audio.

    I don't think it matters where you put the audio trigger, it's all about how you get it to trigger and how regular. I'm sure there are a big handful of variables in play here, but will be interesting to see what @heathclose has been playing around with too. I haven't looked at my game that used this for some time now, but I'll take a peep back into exactly what's happening to see if I've missed any details.
     
    Last edited: Apr 18, 2016
  12. heathclose

    heathclose Miniboss Boxer

    Joined:
    Jan 28, 2016
    Messages:
    1,810
    Likes Received:
    1,026
    Last edited: Apr 17, 2016
  13. heathclose

    heathclose Miniboss Boxer

    Joined:
    Jan 28, 2016
    Messages:
    1,810
    Likes Received:
    1,026
  14. Christoph

    Christoph Miniboss Boxer

    Joined:
    Oct 4, 2015
    Messages:
    2,807
    Likes Received:
    2,309
    @heathclose: Why don't you use the sound mixed into the main gameplay audio? It would work the way you want it to and since you have a character that always is moving I think it is the best and easiest solution.

    In the case of Phill Mason it was a little bit trickier because his character only moves when the player taps the screen. Therefore the solution with the invisible spawner in the move animation was a great solution I think.
     
  15. heathclose

    heathclose Miniboss Boxer

    Joined:
    Jan 28, 2016
    Messages:
    1,810
    Likes Received:
    1,026
    I don't plan to have music repeat over and over and over upon death... otherwise mixing it in would work good, thx for the idea though.. I'm gonna give the main menu music and nothing else so it plays without interruption... I can't stand music that starts over after a death
     
  16. Christoph

    Christoph Miniboss Boxer

    Joined:
    Oct 4, 2015
    Messages:
    2,807
    Likes Received:
    2,309
    That makes sense. And why don't you use the trick with the invisible spawner and the move animation?
     
  17. Phill Mason

    Phill Mason Serious Boxer

    Joined:
    Sep 25, 2015
    Messages:
    880
    Likes Received:
    721
    Hey @heathclose, I've just re-watched your video again and you clearly have a different setup from mine, as I've just been comparing what you're trying to achieve verses what i did in my game.
    But here's a couple of things I'm unsure of from your video.

    1: Have you tried firing (spawning) your sound object off to the left (-99999) so if you hit something, your sound trigger object won't be ahead of you, it'll always be spawned off behind you?

    2: It looks like your sound trigger is in front on you, I assume it is positioned in that place in the move animation of your character, right?
    If so, check to make sure your sound trigger object is using the WakeUp Sound for your character audio clip and not the Idle Sound.

    If you're getting really stuck, drop me a note when you're online and we can hop onto Skype if you like? I know how annoying it is trying to hack these little finishing touches. Skype: phillmason

    Let me know how you get on.
     
    Last edited: Apr 21, 2016
  18. Andy

    Andy Miniboss Boxer

    Joined:
    Sep 24, 2015
    Messages:
    2,152
    Likes Received:
    1,546
    Once we get beyond the 2.0 release next week we might be able to look at adding an idle sound. We'll have to work out the issue you are seeing on at game over when the sound keeps going. But hopefully Phil's ideas can get you going for now.
     
  19. heathclose

    heathclose Miniboss Boxer

    Joined:
    Jan 28, 2016
    Messages:
    1,810
    Likes Received:
    1,026
    @Phill Mason @Andy
    Here is a video of what happens when I spawn it behind me... the sound placement is very sensitive to the screen, which is great for everything other than this hack... Also, if I set the spawner is set to wake and the sound is placed in wake it begins to play over and over until it is so layered it starts to phase itself out... which is a fairly neat way to show someone the mechanics of phasing, but not so neat for the pitter patter of the my little toy submarine :)
     
  20. Phill Mason

    Phill Mason Serious Boxer

    Joined:
    Sep 25, 2015
    Messages:
    880
    Likes Received:
    721
    That's why you need to set the spawn rate to exactly marry up with the length of your audio. A bit of trial and error here, but if your audio clip is 2 seconds long, that might be a spawn rate of something groovy like 3.27, or 4 or 5.6, who knows. Also my sound slightly fades in and out which helps with any slight overlaps and perhaps your audio could slowly pulse in volume too? Given that its a submarine, perhaps a slow waveform pulse of up and down in volume would be a more realistic engine sound anyway, just a thought.
     

Share This Page