Warcraft III resources & community, 2003–2006 · archived

SimError

not rated
Submitted by AltSubmitterFunctions0 downloads
Lets you create a realistic looking error message. Looks almost exactly like real error messages, except that the change in y is ignored by DisplayTimedTextToPlayer, so it's a little higher than it should be.

Source

//Simulates an interface error message for a specified player
function SimError takes player ForPlayer, string msg returns nothing
    local sound error = CreateSound( "Sound\\Interface\\Error.wav", false, false, false, 10, 10, "HeroAcksEAX" )
    if (GetLocalPlayer() == ForPlayer) then
       call ClearTextMessages()
       call DisplayTimedTextToPlayer( ForPlayer, 0.52, -1.00, 2.00, "|cffffcc00"+msg+"|r" )
       call SetSoundParamsFromLabel( error, "InterfaceError" )
       call SetSoundDuration( error, 614 )
       call SetSoundChannel( error, 6 )
       call PlaySoundBJ( error )
    endif
endfunction

Comments

1
i believe sound is a handle, therefore this code has a memory leak; also, ClearTextMessages() will clear all displayed text, so say for instance you are given a QUEST instruction and then you have an error, it will clear the instruction.