toggle menu
Categories
Discussions
Dashboard
Sign In
·
Register
Sign In
·
Register
Categories
Discussions
Dashboard
Sign In
·
Register
×
Home
›
GameSalad 101
›
Art, Graphics, Music and Sound
random audio
rivetopia
Member
Posts:
12
September 2009
edited November -1
in
Art, Graphics, Music and Sound
any suggestions for having a button trigger random audio files
Comments
quantumsheep
Member
Posts:
8,188
September 2009
Make an attribute that's an integer. Call it 'Sound' or something.
Make a button actor.
Have a rule in this actor that says:
When mouse is over actor
AND
When mouse is down
Change attribute 'Sound' to (function) Random (1,10)
Then have a rule within this that says If attribute Sound = 1 then play this sound.
Repeat for other sounds
That should do it - making a fart sim perchance?
rivetopia
Member
Posts:
12
September 2009
Thanks, quantumsheep, That worked perfect.
Zilla
Member
Posts:
157
April 2010
Is there no shorter way like the one with the image attribute:
"sound-"..self.randomSound..".ogg"?
Strobanik
Member
Posts:
77
April 2010
Zilla.. I would like to know that too. But I don't think so, since you can't tie a sound to an actor like you do with images...
But it would be great if you could do it in som other clever way. Anyone?
spaceneedle
PRO
Posts:
93
April 2010
No, I don't think you can. It would really simplify rule sets for sound board apps, rather than having a special button for every sound with a rule set.
Sign In
or
Register
to comment.
Comments
Make a button actor.
Have a rule in this actor that says:
When mouse is over actor
AND
When mouse is down
Change attribute 'Sound' to (function) Random (1,10)
Then have a rule within this that says If attribute Sound = 1 then play this sound.
Repeat for other sounds
That should do it - making a fart sim perchance?
"sound-"..self.randomSound..".ogg"?
But it would be great if you could do it in som other clever way. Anyone?