In an actor, is it possible to change what sound file is played using the Change Attribute action?

Holderness_Media_IncHolderness_Media_Inc Member Posts: 118
edited January 2012 in Working with GS (Mac)
Is there any way to use a Change Attribute or similar action to change which sound is played back using a Play Sound action?

For example, with images, you can do this:

Change Attribute Self.Image To yourimagenamehere.png

Is there a way to achieve a similar functionality with playing back audio files?

Thanks in advance. :)

Comments

  • MotherHooseMotherHoose Member Posts: 2,456
    edited January 2012
    ah… wouldn't that be great!

    but, don't think so … the images are flat and just involve changes of one-time pixel colors … the sound/music is blocks of a series of notes that play sequentially.
    images are actor's attributes and sounds aren't

    some times I would like to be able to scream "Stop the Music!" …

    someday this might be doable in GS …

    @};- MH
  • Yeah, I was afraid of that since there is no access to the expression editor on the Play Sound selector, only drop down.
    Anyone else know a way?
  • MotherHooseMotherHoose Member Posts: 2,456
    edited January 2012
    weird, though our sounds are all called for by text name …

    feedback this to GS … maybe some future build will have sounds accessible from the ExpEditor … and we can then put our sounds in tables!

    @};- MH
  • Yes. I'm still searching for a way to do this, even if it's a workaround.
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    edited January 2012
    a work around would be having a extra attribute called selectedSound and ahving seperate rules with a differnt sound selected in the play sound behavior.

    So say you want a sound to play when the player collides with whatver. You would have seperate rules when actor collides and selectedSound=1 play sound 1, another rule when actor collides and selectedSound=2 play sound 2, and so on. Then you can change the selectedSound attribute to change what sound plays

    cheers
  • Thanks John. :)
    I've actually already been using variations on this method, I was hoping Tables would have made accessing sounds more flexible. I've got some loose ideas floating around my head that may work with tables, I'm going to see what I can build here.
  • Still haven't found the workaround I'm looking for. Anyone know how to access sound files through expression editor?
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited January 2012
    Hallo HMI, you can't access sound (or music) files via the expression editor; when it comes to sound you've only access to the Sound and Music volumes that way.

    You probably know about putting expressions/attributes in the Volume and Pitch aspects of the sound behaviors though by getting to the Expression Editor by clicking on their appropriate "e"s. Hope that's some sort of help.

    PS As MH and others said there's no real shortcut for playing a different sound with a Behavior or attribute, I'm afraid; you'll have to do it the long way around:

    When PlaySound = 1
    Play Sound 01

    When PlaySound = 2
    Play Sound 02

    etc.
    ----------------------------------------------
    http://davidgriffinapps.co.uk/

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • I am aware of accessing volume and pitch already, was just hoping of some sort of way to access the expression editor. Thanks for the input though, it'll probably help others who may read this later on.
Sign In or Register to comment.