[JASS] Playing a sound from a GUI-created string variable?

Status
Not open for further replies.
I'm able to play a sound with the JASS PlaySound function just fine. but i want to be able to pass it a GUI string variable. I tried passing it udg_mySoundString instead of "the\\sound\\filename.wav" but it doesn't seem to work. I don't want to use the SoundEditor since i'll have multiple maps and don't want to add the same sounds for each one.

At Elapsed GameTime = 0.00 i run
Code:
call Preload(udg_mySoundString)
but it doesn't seem to help.
The variable is not surrounded by ""s.
 
Last edited:
Can you link your map ? Or atleast the code.

vJASS:
private function onInit takes nothing returns nothing
    set udg_mySoundString ="the\\sound\\filename.wav"
    call PlaySound(udg_mySoundString)
endfunction
Should work 🤔
 
Status
Not open for further replies.
Back
Top