• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

No Sound played

Status
Not open for further replies.
Level 13
Joined
Mar 24, 2013
Messages
1,105
Hello, I'm using the below function to create an error message but its not playing the sound, From my limited JASS knowledge it appears to me that the sound is created and stored on initialization. However, its not working so maybe I'm supposed to be doing something else to create/store the sound?

JASS:
library SimError
//==================================================================================================
    globals
        private sound error
    endglobals
    //====================================================================================================

    function SimError takes player ForPlayer, string msg returns nothing
        set msg="\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n|cffffcc00"+msg+"|r"
        if (GetLocalPlayer() == ForPlayer) then
            call ClearTextMessages()
            call DisplayTimedTextToPlayer( ForPlayer, 0.52, 0.96, 2.00, msg )
            call StartSound( error )
        endif
    endfunction

    private function init takes nothing returns nothing
         set error = CreateSoundFromLabel("InterfaceError", false, false, false, 10,10)
    endfunction

endlibrary

Edit: I triple checked my sound, so I am certain that is not the problem
 
Status
Not open for further replies.
Top