Use filename as "Display Text" variable?

codematescodemates Member Posts: 112
edited November -1 in Working with GS (Mac)
Is it possible to use the sound filename as a Display Text variable (minus the file extension)?

Thanks

Comments

  • entersimonentersimon Member, PRO Posts: 273
    You can't do it directly, but you could make a workaround for it. It really depends on what your project is and how you want it to work, but let's say you were just going through a list of 3 sounds. a different sound comes up each time you touch an actor.

    Create an attribute called Sound Counter and make it an integer and leave it at zero.

    Then make a rule inside an actor that says if it's touched

    Change attribute Sound Counter to Sound Counter + 1

    and if you want it to go back to the beginning after you finish the 3rd sound and touch it again, add this:

    If attribute Sound Counter > 3
    change attribute Sound Counter to 1

    That way you can use a different actor as a display for the text of your sound.
    Inside that actor just make a few rules:

    If Sound Counter = 1

    Play sound "whatever"

    Display text "Sound file 1's name"

    New rule

    If Sound Counter = 2

    Play sound "whatever_2"

    Display text "Sound file 2's name"

    New rule

    If Sound Counter = 3

    Play sound "whatever_3"

    Display text "Sound file 3's name"

    It's just a workaround. Good luck to you and to me!
  • codematescodemates Member Posts: 112
    @tshirtbooth Thanks!

    @entersimon Thanks for your answer, I can probably used this for another feature. I am actually looking to use the audio file name (e.g. sound1.ogg) as the "Display text" name so I don't have to create the attribute for each sound. I have a lot of sound and was trying to find a more efficient way rather than editing an asset on a scene and adding a "Display text" if I can use the filename from the "Play Sound" attribute.
Sign In or Register to comment.