Play Sound Depending on Table Cell Value
lukejr
Member Posts: 11
Hi,
I am using a table cell value to change the image of an Instance. Using self.Image and the Constrain Attribute behavior to change the image. There is no self.Sound or self.Audio option available. How can I play a Sound clip, taking the name of the sound file from the Table and playing it.
Using the Play Sound behavior hard codes in that sound file, is it possible to have this dynamic?
To Change Image I'm Using:
Constrain Attribute self.Image To "Question_"..tableCellValue( game.Table_Features , game.SetQuestionImage , game.SetRandomOrder )
I want similar for sound, is this possible?
I am using a table cell value to change the image of an Instance. Using self.Image and the Constrain Attribute behavior to change the image. There is no self.Sound or self.Audio option available. How can I play a Sound clip, taking the name of the sound file from the Table and playing it.
Using the Play Sound behavior hard codes in that sound file, is it possible to have this dynamic?
To Change Image I'm Using:
Constrain Attribute self.Image To "Question_"..tableCellValue( game.Table_Features , game.SetQuestionImage , game.SetRandomOrder )
I want similar for sound, is this possible?
Comments
you get a little choice when the sounds are in Rules:
Rule: when
Attribute: QuestionImage = whatever
-Play Sound: … and then you have to select that sound
in your Actor this will look like a long list of blocks of code
but in the actorProject it will be just a few lines … so no problem
try to have a soundMan actor spawn when needed
and in each of its rule's … Play Sound √Run to Completion
followed immediately by a destroyBehavior
(soundMan pops up gets the right sound … destroys itself … and sound still plays)
that way the scene doesn't have to load that actor and rules
MH
There is a need for GS to better support audio, I'm not alone on this I hope.
Thanks, JR.
What I really want is for them to replace the drop down menu that makes you select a sound file and replace it with an expression editor, that way you could just use 1 table for randomized sounds/attributes.
I cant seem to figure out how to unlink the playlist actors to directly playing the sound.
any suggestions would be most welcome! thanks
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Anyone in the Gamesalad Team know when we will be able to play sounds with tables? Really important feature for games with lots of sounds.
Being able to link to a sound from a table would be very useful.
I'll check in on this. Any update?