• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

InGame Error - Action

Status
Not open for further replies.
Level 4
Joined
Dec 15, 2007
Messages
96
Hey,
Is it possible to trigger an "Interface error messege" (from Game Interface) using a Jass line?

I've noticed an error messege in the Game Interface which is not in use, so I just wondered if there were any ways to sort of "call" it, or make it appear by using a Custom Script action, or any other methods? If there is, please feel free to explain here. Thank you:con:
 
Level 2
Joined
Feb 24, 2007
Messages
37
There is a function for it yes.

SimError(no leak) by Vexorian on JassVault said:
JASS:
//Needs a udg_SimError global sound variable
function SimError takes player ForPlayer, string msg returns nothing
    if udg_SimError==null then
        set udg_SimError=CreateSoundFromLabel( "InterfaceError",false,false,false,10,10)
    endif
    if (GetLocalPlayer() == ForPlayer) then
        call ClearTextMessages()
        call DisplayTimedTextToPlayer( ForPlayer, 0.52, -1.00, 2.00, "|cffffcc00"+msg+"|r" )
        call StartSound( udg_SimError )
    endif
endfunction

Copy and paste that part into your mapheader (the mapicon at the top in the trigger editor) and make a global sound variable named SimError. Now you can use it in a trigger for example:

  • Unit Dies
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set Player = (Owner of (Triggering unit))
      • Custom script: call SimError(udg_Player, "Grats your unit died")
Or as one Jass line

JASS:
call SimError(GetOwningPlayer(GetTriggerUnit()), "Grats your unit died")
 
Status
Not open for further replies.
Top