Custom Warnings?

kungfuturte0

New Member
Reaction score
2
Hi. Im sure theres a way to create custom warnings, ive seen it in DOTA. What i mean by custom warnings is for example:

You build a unit, but you have insufficent funds. A warning appears displaying Insufficent funds. I know i could just display a normal game message but this doesnt look quite as good. Its in the left corner, not in the middle like warnings.

Has anyone play DOTA (who hasnt?) and you try and buy the Roshan shield. A warning comes up saying : You must kill Roshan in order to get this item.

This is what i want. If you still dont understand ill get a print screen of what i want. Thanks for any help. Rep + to correct answer.
 

hell_knight

Playing WoW
Reaction score
126
There is a JASS function which allows you to display the game message whereever you want.

They could of just used a hex code , and played the error sound and positioned it where it would look like it was an error.
 

SFilip

Gone but not forgotten
Reaction score
634

kungfuturte0

New Member
Reaction score
2
Code:
//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

Ok im not sure what to do with this :( Do i put in action - custom script. And what do i change to put my custom message etc? Thanks
 

hell_knight

Playing WoW
Reaction score
126
Uh its JASS , well you need to set a variabled called SimError to the sound you want played.

and where it says msg you put the string there.
 

Insane!

Shh I didn't edit this, go away.
Reaction score
122
Code:
//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"+[B]msg[/B]+"|r" )
        call StartSound( udg_SimError )
    endif
endfunction

Ok im not sure what to do with this :( Do i put in action - custom script. And what do i change to put my custom message etc? Thanks

that stuff in bold should be it
 

kungfuturte0

New Member
Reaction score
2
Uh its JASS , well you need to set a variabled called SimError to the sound you want played.

and where it says msg you put the string there.

Ok so i create a new variable and call it SimError. Then i choose variable type sound or sound type?? then after that what i need to do trigger wise?

Do i need to
Code:
set variable SimError = Sound i want played?

Then what i need next??? where do i type that JASS code?

thanks
 

kungfuturte0

New Member
Reaction score
2
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"+No Item To Identify!+"|r" )
        call StartSound( udg_SimError )
    endif
endfunction


Ok where do i put this???

Action - game - display message???

and what do i need to do about sound??? I have created a variable but its not working?? Please help!
 

Naga'sShadow

Ultra Cool Member
Reaction score
49
There's another option. Every warning is in the game options tab, I believe I don't have the editor open now. The one in advanced options where you can replace the background. You can change the interface artwork as well as changing the pre-scripted messages. Note that the game will still fire off the new message when someone would have triggered the old one. You'll have to play with that to get it to fire at the right time.
 

SFilip

Gone but not forgotten
Reaction score
634
OK, here's what you need to do:
-Open the variable editor (Ctrl+B) and create a variable called SimError of type Sound. You don't need to do anything with this variable, just make sure it's created.
-Copy the original code (don't change anything, not even msg as previously suggested) and paste it into the map header. To do this, open the trigger editor and click on the map's name on top of the tree where all triggers are. Then just paste it into the text box on the bottom.
-You use the function this way: call SimError(<player here>, <message here>) in a custom script action. For example:
Code:
test trigger
    Events
        Unit - A unit Dies
    Conditions
    Actions
        Custom script:   call SimError(Player(0), "test")
Player(0) is player 1, Player(1) would be player 2 etc.
GetTriggerPlayer() is triggering player.
GetEnumPlayer() is Picked Player.
GetOwningPlayer(GetTriggerUnit()) is owner of triggering unit.
If you need anything else you need used as a player here, just ask.
 

NotTheHelper

Yeah, its under your bed.
Reaction score
23
Would custom warnings be ike if you try to cast a spell on a unit and instead of saying its magic immune itd say like "Stupid...hes spell immune"
 

SFilip

Gone but not forgotten
Reaction score
634
No, you can change existing messages' text using Advanced - Game Interface.
 

SFilip

Gone but not forgotten
Reaction score
634
For displaying those whenever you wish using a trigger. Just a somewhat fancy way of displaying an error, I guess it's good for custom spells.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      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