• 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.

Not Enough Mana

Status
Not open for further replies.
Level 4
Joined
Jan 27, 2009
Messages
57
How do I display a message of "Not Enough Mana" for a hero with a custom/trigger skill that has no initial Manacost (manacost and payment is done via trigger).

Tried a dummy casting a spell that costs more mana than he has via trigger and it didnt gave me the message.
 
Level 19
Joined
Mar 18, 2012
Messages
1,716
If you look into the SimError library you will find the following line:
call DisplayTimedTextToPlayer( ForPlayer, 0.52, 0.96, 2.00, msg )

0.52, and 0.96 define the position on your screen, while 0., 0. would be the standart position if you chat with someone.
2.00 is the time in seconds the message is shown and msg is the actual message.
 
Level 4
Joined
Jan 27, 2009
Messages
57
I don't know how Jass works nor how to script it. So i gotta improvise and now the message appears a little bit above the original one btw.

Don't know what a "library" means or what to do with it. Even how i'm gonna use this call Display.... function..
 
Level 7
Joined
Mar 6, 2006
Messages
282
At the top of libraries, such as this one, there's always documentation on everything you need to know.

Don't know what a "library" means or what to do with it.

//**************************************************************************************************
//*
//* 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's scripts section, then just
//* paste the contents into some custom text trigger in your map.
//*
//**************************************************************************************************

Even how i'm gonna use this call Display.... function..

//**************************************************************************************************
//*
//* 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's scripts section, then just
//* paste the contents into some custom text trigger in your map.
//*
//**************************************************************************************************


To use a line of JASS in GUI, you use the action Custom Script (it's at the top, near Set Variable), then you type your line of JASS in there.

So for example, you would put call SimError( GetOwningPlayer( GetTriggerUnit() ), "Cannot target naked people.")

The part you may need help with is, getting the right player. In that example, I showed you how to get the "Owner of ( Triggering Unit ) ".
 
Level 4
Joined
Jan 27, 2009
Messages
57
At the top of libraries, such as this one, there's always documentation on everything you need to know.



//**************************************************************************************************
//*
//* 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's scripts section, then just
//* paste the contents into some custom text trigger in your map.
//*
//**************************************************************************************************



//**************************************************************************************************
//*
//* 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's scripts section, then just
//* paste the contents into some custom text trigger in your map.
//*
//**************************************************************************************************


To use a line of JASS in GUI, you use the action Custom Script (it's at the top, near Set Variable), then you type your line of JASS in there.

So for example, you would put call SimError( GetOwningPlayer( GetTriggerUnit() ), "Cannot target naked people.")

The part you may need help with is, getting the right player. In that example, I showed you how to get the "Owner of ( Triggering Unit ) ".

I had read that post in that forum and did copied the lines into custom script actions for my trigger and it did not recognize the first line of all, something like> library initialize init... (dont remember it whole but i just CTRL+C and V it)
 
Status
Not open for further replies.
Top