call for errors ? (text error needed)

Status
Not open for further replies.
Level 14
Joined
Mar 4, 2009
Messages
1,156
Is your editor JNGP?
why...
ok

-my unit wants to pick up an item witch is not allowed
order unit to stop
call DebugMsg (GetOwningPlayer(udg_A), "That item is only for Vampires")

my unit wants to cast the custom healing
if life of casting unit not equal to max life of casting unit
call DebugMsg (GetTriggerUnit()), "Already at full health")

EDIT: my editor is not JNPG and i don´t know how to get it at all :/
 
Well, apparently, this is a function that is only supported by JNGP, at least this function should be first written within JNGP and it will work for other editors, once you save it.
Now, the first should work, the "A" is a variable i guess of type "Unit" and "Set A = (Hero Manipulating Item or Triggering unit)". The second one, i don't know if you did write this now, but it should also have "GetOwningPlayer()", forgot that here or in the Editor? ;p
 
Level 14
Joined
Mar 4, 2009
Messages
1,156
Well, apparently, this is a function that is only supported by JNGP, at least this function should be first written within JNGP and it will work for other editors, once you save it.
Now, the first should work, the "A" is a variable i guess of type "Unit" and "Set A = (Hero Manipulating Item or Triggering unit)". The second one, i don't know if you did write this now, but it should also have "GetOwningPlayer()", forgot that here or in the Editor? ;p
not in editor just here :p,and its not working :(

how do i get JNPG xD,from tools?
 
Level 14
Joined
Mar 4, 2009
Messages
1,156
all i get is this crap,i tried more things but none is working

jass error.jpg

when i go test map,it starts and closes:hohum:


can you make this work on your WE

Custom script: call DebugMsg (GetOwningPlayer(udg_A), "Nope, can't cast this.")

or

Custom script: call DebugError (GetOwningPlayer(udg_A), "Nope, can't cast this.")
 
Level 14
Joined
Mar 4, 2009
Messages
1,156
Can`t be simply this:
  • Game - Display to (Player group((Owner of (Triggering unit)))) the text: Error
I don`t think you can call wc3 messages.
Omg...i know how to do a game text -.- ,

i want massage appear like when you cant target a unit or
massages like
"spell is not ready yet","that target in invulnerable","that target is immune to magic" .....

why does my title say how to call for text error....



im sure one of the Pharaoh´s custom scripts should work,but my editor will not accept it
 
Level 12
Joined
Mar 10, 2008
Messages
869
Undeclared function call DebugMsg
...

Well there has to be such thing! How did the people who made TBR do all of those custom errors?

I found this:
JASS:
function BJDebugMsg takes string msg returns nothing
    local integer i = 0
    loop
        call DisplayTimedTextToPlayer(Player(i),0,0,60,msg)
        set i = i + 1
        exitwhen i == bj_MAX_PLAYERS
    endloop
endfunction
But seems a bit weird
Also found
JASS:
    call BJDebugMsg ("Hello")
But that is just a permanent message, almost exactly like text.
 
Level 14
Joined
Mar 4, 2009
Messages
1,156
firstly i would like to thank you for your help

but i cant make that work ;/

does it make a custom error massage?



BTW...
actually all i need is that massage appears down,middle
(and play sound error)

maybe it could be done with game text
 
Level 14
Joined
Mar 4, 2009
Messages
1,156
BJDebugMsg takes only the string parameter...

Try: DisplayTextToPlayer(GetOwningPlayer(GetTriggerUnit()), 1, 0, "Error")

Fiddle with the numbers (x, y) to set it to the right position... Also play the sound yourself.
works great,i just need to put "call " if i want to use it in GUI

call DisplayTextToPlayer(GetOwningPlayer(GetTriggerUnit()), 1, 0, "Error")

also if i put

call DisplayTextToPlayer(GetOwningPlayer(GetTriggerUnit()), 0, 0, "Error")

it looks like normal game text,
i was wondering is this could be a solution so i don't have to make a player group every time i want to do a game text for one player

well than....will this script leak?

call DisplayTextToPlayer( Player(0), 1, 0, "Error")


the only problem is that this massages do not look like error text

is it possible to clear text massages for player but not all text massages?

i don't want a double text like

your hero is already at full health
your hero is already at full health
your hero is already at full health

...
 
Level 14
Joined
Mar 4, 2009
Messages
1,156
BJDebugMsg takes only the string parameter...

Try: DisplayTextToPlayer(GetOwningPlayer(GetTriggerUnit()), 1, 0, "Error")

Fiddle with the numbers (x, y) to set it to the right position... Also play the sound yourself.
the only good thing is that i do not have to make player groups and destroy it like hwn i use normal game text


bad thing is.....,it will move all massages to 1, 0, :(

this is not solved......
 
Level 12
Joined
Mar 10, 2008
Messages
869
Yes, and that's what SimError does.
JASS:
call DisplayTimedTextToPlayer( ForPlayer, 0.52, 0.96, 2.00, msg )
But it puts it in the right place.

Just try doing
JASS:
    globals
        private sound error
    endglobals


//============================================

call ClearTextMessages()
call DisplayTimedTextToPlayer( ForPlayer, 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 BLA |r" )
call StartSound( error )
 
Level 14
Joined
Mar 4, 2009
Messages
1,156
Yes, and that's what SimError does.
JASS:
call DisplayTimedTextToPlayer( ForPlayer, 0.52, 0.96, 2.00, msg )
But it puts it in the right place.

Just try doing
JASS:
    globals
        private sound error
    endglobals


//============================================

call ClearTextMessages()
call DisplayTimedTextToPlayer( ForPlayer, 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 BLA |r" )
call StartSound( error )

ITS USELESS because this script could do the same

call DisplayTimedTextToPlayer(GetOwningPlayer(GetTriggerUnit()), 0.52, 0.96,5, "Error")

clearing all text massages sucks......

i´m just trying to get a normal custom error massage

so if i need to clear all other text massages,its not normal.....
 
Status
Not open for further replies.
Top