Creating fake error messages?

insaneownage

New Member
Reaction score
6
Hi, it's been a while since I've mapped. I've searched all over but I can't find that script/system that lets you make fake error messages really easily. Can someone show me which one I'm looking for?

Thanks.
 

sidove

Member
Reaction score
22
If you mean like "Not enough gold" then go to Advanced - Game Interface - And there you start editing :)
 

Psiblade94122

In need of sleep
Reaction score
138
no i think he means soemthing like "minimum range" when casting a spell
or "You are too low leveled to use this item"

A custom error msg that would prevent a unit from taking action (detect when the animation starts, pause the unit, tell it to stop, unpause, then display the msg)

i have no idea how to do the last part >_< (which is what the topic is asking) well actually, the msg is easy, getting the error sound to play is hard
 

sidove

Member
Reaction score
22
If it's how you say then like this:

Code:
Example
Events: Unit - dies
ACtions: Sound - Play error sound
Game - Show (You are to young to die) to all player

To get the error sound press F5 in World Editor and the Sound Editor will appear from there press ctrl + f to search and type in error and the sound will appear. Then when you have found it right-click on it and press use as sound :) Hope you understand
 

XxShadyxX

I abused the rep system.
Reaction score
81
He wants the text to show where regular game errors show. Do you know how to do that?
 

Ayanami

칼리
Reaction score
288
I don't think it's possible. However, it is possible to get something close to it.

Firstly, go to your trigger editor. You would find a map icon with your map name on it. Press that at copy in this under the space below (the space that's below).

JASS:
function PlaySoundForPlayer takes player whichPlayer, sound whichSound returns nothing
if ( whichPlayer == GetLocalPlayer() ) then
call PlaySoundBJ( whichSound )
endif
endfunction


Secondly, when you want to play the sound for the player, use this.

Trigger:
  • Trigger
    • Events
    • &lt;Your event&gt;
    • Conditions
    • Actions
      • &lt;Your actions&gt;
      • Custom script: if GetLocalPlayer() == GetOwningPlayer(GetTriggerUnit()) then
      • Custom script: call ClearTextMessages()
      • Custom script: endif
      • Custom script: call DisplayTimedTextToPlayer( GetOwningPlayer(GetTriggerUnit()), 0, 0, 2.00, &quot;&lt;Your Error Message&gt;&quot; )
      • Custom script: call PlaySoundForPlayer(GetOwningPlayer(GetTriggerUnit()), gg_snd_Error)


Hope this helps.

PS. You might want to add spacing to your error message to make it align to the right.

Glenphir
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
It's not possible to make a genuine custom error message, but you can imitate one.

There are a bunch of these scripts floating around, most called SimError.

I use this one.
 

NetherHawk

New Member
Reaction score
26
there is 1 made by vexorian. exact replica of creating an error message, but it requires you to use jass or a customscript. Create a trigger call SimError and convert it to csutom text. Paste the stuff below in. If you use jass u can use it by yourself. If you use GUI, u need to create a custom script and type in

call SimError(WHICHPLAYER,"WHATERROR")

remeber to have the " " for your error message

JASS:
library SimError initializer init
//**************************************************************************************************
//*
//*  SimError
//*
//*     Mimic an interface error message
//*       call SimError(ForPlayer, msg)
//*         ForPlayer : The player to show the error
//*         msg       : The error
//*    
//*     To implement this function, copy this trigger and paste it in your map.
//* Unless of course you are actually reading the library from wc3c&#039;s scripts section, then just
//* paste the contents into some custom text trigger in your map.
//*
//**************************************************************************************************

//==================================================================================================
    globals
        private sound error
    endglobals
    //====================================================================================================

    function SimError takes player ForPlayer, string msg returns nothing
        set msg=&quot;\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n|cffffcc00&quot;+msg+&quot;|r&quot;
        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(&quot;InterfaceError&quot;,false,false,false,10,10)
         //call StartSound( error ) //apparently the bug in which you play a sound for the first time
                                    //and it doesn&#039;t work is not there anymore in patch 1.22
    endfunction

endlibrary
 

akrep_ve_su

New Member
Reaction score
1
Excuse me; but map gives compiling error due to something written wrong in this line:
call SimError(Tossing_Player,"Cantimpale")
Tossing_Player is a Player variable refers to owner of casting unit.
Cantimpale is the rawdata name of Error mesage i am using.
What is wrong here?
 

Laiev

Hey Listen!!
Reaction score
188
if you're using gui

JASS:
call SimError(Tossing_Player,&quot;Cantimpale&quot;)


>>

JASS:
call SimError(udg_Tossing_Player,&quot;Cantimpale&quot;)
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
if tossing_player is a GUI global variable you have to write udg_Tossing_Player, all GUI variables have the prefix udg_
 

akrep_ve_su

New Member
Reaction score
1
call SimError (udg_Tossing_Player,"Cantimpale")
This is what i write but it still gives an error.
 

Jedi

New Member
Reaction score
63
1-First, open your variable editor.Make a sound variable with "error" name(without quotes)

2-Delete old SimError library, and put this in your map header.



JASS:
//**************************************************************************************************
//*
//*  SimError
//*
//*     Mimic an interface error message
//*       call SimError(ForPlayer, msg)
//*         ForPlayer : The player to show the error
//*         msg       : The error
//*    
//*     To implement this function, copy this trigger and paste it in your map.
//* Unless of course you are actually reading the library from wc3c&#039;s scripts section, then just
//* paste the contents into some custom text trigger in your map.
//*
//**************************************************************************************************
    function SimError takes player ForPlayer, string msg returns nothing
        set msg=&quot;\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n|cffffcc00&quot;+msg+&quot;|r&quot;
        if (GetLocalPlayer() == ForPlayer) then
            call ClearTextMessages()
            call DisplayTimedTextToPlayer( ForPlayer, 0.52, 0.96, 2.00, msg )
            call StartSound( udg_error )
        endif
    endfunction


3-Find a GUI trigger that works at map initialization, add this as first line:

Custom Script: set udg_error=CreateSoundFromLabel("InterfaceError",false,false,false,10,10)
 

akrep_ve_su

New Member
Reaction score
1
It is not possible to do it easier way? I play error sound via trigger Sound - Play Sound
I changed Cantimpale error message "value" (in game interface section) to the message i want to receive. And i've written exactly as:
call SimError (udg_Tossing_Player,"Cantimpale")
Tossing_Player refers to the player who owns a hero casts Toss spell as i said before. Now is there something wrong that i am doing here? I really would like to complete the trigger this way (if possible) rather than starting an entire new one; especially one contains codes that i don't understand =)
 

tooltiperror

Super Moderator
Reaction score
231
It is not possible to do it easier way? I play error sound via trigger Sound - Play Sound
I changed Cantimpale error message "value" (in game interface section) to the message i want to receive. And i've written exactly as:
call SimError (udg_Tossing_Player,"Cantimpale")
Tossing_Player refers to the player who owns a hero casts Toss spell as i said before. Now is there something wrong that i am doing here? I really would like to complete the trigger this way (if possible) rather than starting an entire new one; especially one contains codes that i don't understand =)

You probably shouldn't hijack threads, you should make your own.
 

akrep_ve_su

New Member
Reaction score
1
I see, you are the annoying guy every forum has who tells "start a new topic" or "stop creating new topics and continue from the existing one" based on occasion. Mostly this is performed in reverse order but i guess you are creating your own style. "hijack threads" huh? Really impressive..
 

tooltiperror

Super Moderator
Reaction score
231
Actually, it clearly states in the forum rules for this section...

Ghan_04 said:
E. DO NOT HIJACK THREADS! If you have a question of your own to ask, post a new thread, don't try to take over someone else's thread.
 

akrep_ve_su

New Member
Reaction score
1
Actually, it clearly states in the forum rules for this section...
Does it also state that when the original question of the topic is answered (means problem solved if thread owner didn't return in 160 days i presume(!) ); asking another question related to the same topic does not have anything to do with "taking over" ? And did it occour to you if i had opened a new topic for my question; someone would link me here and after reading instructions i would get stuck again just like i've (because of the reasons i've explained in my original post) So i wiould have to ask it in the related topic; means this one... Is this all confusing?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top