HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

"Expected a name"

04-10-2006, 10:58 AM#1
Thunder_Eye
Collapse JASS:
function Trig_Untitled_Trigger_001_Func001A takes nothing returns nothing
    local effect e = GetHandleEffect(GetEnumUnit(), "e")
    call DestroyEffect(e)
    call ReplaceUnitBJ( GetEnumUnit(), 'h001', bj_UNIT_STATE_METHOD_RELATIVE )
    call AddUnitAnimationPropertiesBJ( true, "alternate", GetLastReplacedUnitBJ() )
    call SetHandleHandle(GetLastReplacedUnitBJ(), "e", AddSpecialEffectTargetUnitBJ( "hand, right", GetLastReplacedUnitBJ(), "Sword_1H_Rapier_A_01.mdx" ))
    set e = null
endfunction

function Trig_Untitled_Trigger_001_Actions takes nothing returns nothing
    call ForGroupBJ( GetUnitsSelectedAll(Player(0)), function Trig_Untitled_Trigger_001_Func001A )
endfunction

can someone tell me what is wrong with this function?

(I know it has lots of things that can be improved but I just want to know what causes the error.
04-10-2006, 11:43 AM#2
Zoxc
You miss GetHandleEffect and SetHandleHandle which you can find here http://www.wc3jass.com/viewtopic.php?t=224
04-10-2006, 11:50 AM#3
Thunder_Eye
no I have them in the map-script, thats why they arent showing.
04-10-2006, 11:56 AM#4
vile
Expected a name is either you have a global var that doesnt exist or a function you're trying to use or call and it doesnt exist.
04-10-2006, 12:08 PM#5
Zoxc
Quote:
Originally Posted by Thunder_Eye
no I have them in the map-script, thats why they arent showing.

Then you must have put them below this function.
04-10-2006, 12:10 PM#6
Thunder_Eye
hmm nope, there arent any globals in there, and the handlevars is in the mapscript so they are ontop all the triggers.

It cant be the handlevars cause Im using them in another trigger that works.

(Ive tested the functions in JSP which gives no errors)
04-10-2006, 12:22 PM#7
Zoxc
Well this function miss GetHandleEffect and SetHandleHandle.
04-10-2006, 12:24 PM#8
Thunder_Eye
hmm wierd, how can the other function work then?
and how can I fix it?

EDIT: hmm maybe you were right, I added the handlevars in the trigger and renamed them and it worked :S
why didnt they work before?

EDIT2: no, just saw that the trigger got disabled, so it still doesnt work. Forget the first edit.
04-10-2006, 12:28 PM#9
Zoxc
If this trigger is in map script it might be above the handle vars. If it's not, try exporting war3map.j and upload it here.
04-10-2006, 12:31 PM#10
Thunder_Eye
The function I posted is in a trigger, the handlevars is in the mapscript.
I will upload the war3map.j, just wait a minute.
EDIT: hmm will I need an mpqextracter? cause I dont have one :/
EDIT2: hmm hope this is what you want, "upload"
Attached Files
File type: txtwar3map.txt (9.0 KB)
04-10-2006, 12:43 PM#11
Zoxc
You will need a mpq extracter, you can use the one in JassCraft or you can download a *real* mpq tool.
04-10-2006, 12:57 PM#12
Thunder_Eye
Ive uploaded the war3map.j as a text file in the previous post.
04-10-2006, 06:47 PM#13
PipeDream
A quick PJASS run indicates you have no global vars (no gg_trg_zzz) declared and two functions that should always be there are missing. I have no idea why that would be, I have never seen that before.
04-10-2006, 07:06 PM#14
Thunder_Eye
gah, so the global for the trigger is missing?
04-10-2006, 10:00 PM#15
Anitarf
That shouldn't be a problem, delete the trigger and re-add it, and the variable should auto-generate again?