Play Sound Depending on Table Cell Value

lukejrlukejr 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?

Comments

  • MotherHooseMotherHoose Member Posts: 2,456
    @lukejr … so do we all!

    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

    image MH
  • lukejrlukejr Member Posts: 11
    Thanks for the reply. I have it now with 40 rules for 40 different audio sounds, checks if attribute is equal to a random number (1,40).

    There is a need for GS to better support audio, I'm not alone on this I hope.

    Thanks, JR.
  • rhinokeyrhinokey Member Posts: 158
    i really wish whtye would allow you to use tables in the if section of rules, and also allow you to do your sound and actor spawns picked straight from tables. that would make tables soooo more powerfull, if you could use them in the if section then you could use tables for almost all attributes. this is something i really hope to see in the near future, sure you can work around this but its hard to doubt that it would be nice

  • floydianspiralfloydianspiral Member, PRO Posts: 308
    I made a post about this very thing a little bit ago and I agree...allowing us to use a tabel cell as a pointer to an audio file would make it so a long list of rules boils down to just saying, pick 1-40 table cells and play that sound! I'm making a game with generative audio/music and it would really add a lot of functionality to GS without all the bloat.

    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.
  • philterphilter Member Posts: 2
    Yeah im trying to build a basic playlist that one set of actors "loads" the sound then a play button plays that sound.

    I cant seem to figure out how to unlink the playlist actors to directly playing the sound.

    any suggestions would be most welcome! thanks
  • lukejnrlukejnr Member, PRO Posts: 63
    Is there any improvement with the audio support in GameSalad? This feature was listed in a poll last year conducted but I haven't heard anything about it since.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited January 2014
    Is there any improvement with the audio support in GameSalad? This feature was listed in a poll last year conducted but I haven't heard anything about it since.
    @lukecurley Can you be more specific? If you mean being able to use expressions in rules to play specific sounds then no, no improvements have been made.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • lukejnrlukejnr Member, PRO Posts: 63
    Thanks for the reply, yes that's what I mean. I have been waiting on this feature for 18 months now. Very useful if you're using a large number of sounds in a scene.
  • games4fungames4fun Member Posts: 185

    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.

  • OakgroundsOakgrounds Member, PRO Posts: 28

    Being able to link to a sound from a table would be very useful.

  • Larry WintersLarry Winters Member Posts: 13

    I'll check in on this. Any update?

Sign In or Register to comment.