• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

UnitAlive help

Status
Not open for further replies.
Level 28
Joined
Jan 26, 2007
Messages
4,789
Perhaps you could use the funtion native GetWidgetLife takes widget whichWidget returns real instead? (I thought TriggerHappy preferred that function, but I'm not really 'into' that stuff xD).
Something like this:
JASS:
function Alive takes nothing returns boolean
    if GetWidgetLife(GetTriggerUnit()) > 0 then
        return true
    endif
    return false
endfunction

(I tested your function as well and it gave the same error, but I can't find it in the function list, though its color does change, indicating it's a valid function).
 
Be sure that you didn't misspell the name. You might've accidentally put like "Unittalive(u)" or something like that. Also be sure that you have the latest JNGP.

Otherwise I don't know why it'd cause syntax errors. As far as I know, the position of it doesn't matter and parameter naming doesn't matter neither. (I've tested it in my haunt spell, it works fine without naming the parameter "id")
 
Well then, the problem beats me. =P I can only think of two other reasons:
- Your common.ai is missing, which I highly doubt unless you messed with your MPQ a lot or something.
- Or the syntax error is referring to some other part of the code. Sometimes it might highlight the wrong line/part. Try posting the code or a segment of the code and show the error.
 
Status
Not open for further replies.
Top