How to make custom error massage

Status
Not open for further replies.
Level 7
Joined
Jun 30, 2008
Messages
322
hy all

how can i make a custom error massage. i know you can make and as i rememebered it can be made with custom script. Anyone know how to make?

for example. i want a custom error massage: 'not enugh point' or somehting like this.
thank you very much +rep
 
Level 3
Joined
Jan 8, 2011
Messages
70
Try,
'create floating text for player 1 (red) over point X with text X'.

Or something along those lines, just use the floating text trigger whenever certain events or conditions are met.
 
  • Test Triger
    • Events
      • Unit - A unit owned by Player 1 (Red) Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Game - Display to Player Group - Player 1 (Red) for 5.00 seconds the text: Test Message
      • Quest - Display to (All players) the Warning message: This is warning!
This trigger will run each time when unit owned by player red die.
If dying unit equal to hero it will:
Show "Test Message" message to red player for 5 sec.
Show warning to all players and "This is warning!" message on the screen.
 
This is a version of SimError, by Vexorian, but in GUI (lol, or at least a bit in GUI):
  • Error
    • Events
    • Conditions
    • Actions
      • -------- You can put whatever events/conditions you want --------
      • -------- Make a Sound variable named ErrorSound --------
      • Custom script: if udg_ErrorSound == null then
      • Custom script: set udg_ErrorSound = CreateSoundFromLabel( "InterfaceError",false,false,false,10,10)
      • Custom script: endif
      • -------- Make a string variable named ErrorMessage --------
      • Set ErrorMessage = Not enough points!
      • -------- ^Change this variable above to whatever your error message is. --------
      • -------- Make another player variable named ErrorPlayer --------
      • Set ErrorPlayer = Player 1 (Red)
      • -------- ^This will be who you are showing the error to --------
      • Custom script: if GetLocalPlayer() == udg_ErrorPlayer then
      • Custom script: call ClearTextMessages()
      • Custom script: call DisplayTimedTextToPlayer( udg_ErrorPlayer, 0.52, 0.96, 2.00, "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n|cffffcc00"+udg_ErrorMessage+"|r" )
      • Custom script: call StartSound(udg_ErrorSound)
      • Custom script: endif
Make these variables:
Variables

  • Sound Variable - ErrorSound
  • String Variable - ErrorMessage
  • Player Variable - ErrorPlayer
The sound variable is the sound when the error message pops up. The error message is the message you want to display as an error. The error player is the player who you want to show the error message to.

Alternatively, just go to your map header (open the trigger editor, and click on your map name where all the triggers are listed), make the variables listed above, and then copy and paste this code:
JASS:
function ErrorMessage takes string error, player whichPlayer returns nothing
    if udg_ErrorSound == null then
        set udg_ErrorSound = CreateSoundFromLabel("InterfaceError",false,false,false,10,10)
    endif
    set error = "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n|cffffcc00"+error+"|r"
    if GetLocalPlayer()==whichPlayer then
        call ClearTextMessages()
        call DisplayTimedTextToPlayer(whichPlayer,0.52,0.96,2,error)
        call StartSound(udg_ErrorSound)
    endif   
endfunction

Then whenever you want to use it, you can just do this:
  • Actions
    • Set ErrorMessage = Not enough points!
    • Set ErrorPlayer = Player 1 (Red)
    • Custom script: call ErrorMessage(udg_ErrorMessage,udg_ErrorPlayer)
And then you are good to go. Just change the error message and error player to whatever you want.

Hopefully this helps. :)
 
Last edited:
Status
Not open for further replies.
Top