Randomizing sound effect when actors collide

ChunkypixelsChunkypixels Member Posts: 1,114
hi...

I'd like to make my actor trigger audio from a selection of 5 or more different sound effects when it collides with another actor.

I currently have it playing a single sound ok when it collides, but cant seem to find any options for making it choose from a selection instead. Does anyone know how I'd do this?

thanks.....

Comments

  • CatOnAKeyboardCatOnAKeyboard Member Posts: 39
    You would need a series of rules (one for each sound effect) and a number that has a random value in it. You then use the random number to decide which rule (and sound) to play.

    ie:

    Behavior:
    randNum := rand(1,x) where x is the number of sounds

    Rule:
    if randNum == 1:
    -- play sound 1

    Rule:
    if randNum == 2:
    -- play sound 2

    etc.
  • ChunkypixelsChunkypixels Member Posts: 1,114
    thanks Cat ...really appreciated :)

    I'll give that a play with.
  • goliathgoliath Member Posts: 1,440
    Did that work? I am having an issue with my game and I am wondering if this random setup will work with what I am trying to do.

    I am making a "Simon" type game and I can't figure out how to randomize colors and patterns.

    If you are unfamiliar with simon, its a game where there are 4 colors and players have to repeat a sequence of random patterns (hopefully I am making myself clear) and immitate whatever the game spits out.
  • ChunkypixelsChunkypixels Member Posts: 1,114
    yup.... Cats suggestion worked for me.

    Gave me the random triggered sounds i required, so should be transferable to other random events.

    thanks again Cat :)
  • MoneyMaker100MoneyMaker100 Member Posts: 13
    Sorry im very new to gamesalad. Where do I enter in the expressions for the 2 rules and the behaviour?
Sign In or Register to comment.