HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Jass Trouble

01-27-2009, 12:30 AM#1
Valdez
Ok I was having some trouble with my first custom trigger. When I try to test my map it says that all of these are missing something..

This is its int as a whole:
Collapse JASS:
function InitTrig_EnergySpike takes nothing returns nothing
 set gg_trg_EnergySpike = CreateTrigger( )
 call TriggerRegisterAnyUnitEventBJ(gg_trg_EnergySpike, EVENT_PLAYER_UNIT_SPELL_CAST)
 call TriggerAddCondition( gg_trg_EnergySpike, Condition( function EnergySpikeCondition ) )
 call TriggerAddAction( gg_trg_EnergySpike, function EnergySpikeActions )
endfunction

The
Collapse JASS:
function InitTrig_EnergySpike takes nothing returns nothing
line error says "Expected a variable name"

The event/condition/action lines all have the error "Expected a name"

I did make this by scratch tho.. any ideas on what I'm missing?
01-27-2009, 12:38 AM#2
Anitarf
Does the gg_trg_EnergySpike variable exist? Meaning, do you have your code in a GUI "trigger" with the name EnergySpike?
01-27-2009, 12:48 AM#3
Valdez
Quote:
Originally Posted by Anitarf
Does the gg_trg_EnergySpike variable exist? Meaning, do you have your code in a GUI "trigger" with the name EnergySpike?

No, its under the main section of custom script.. so should I move it to a trig named that?
01-27-2009, 12:50 AM#4
Zerzax
Yep, you need to create a "trigger" named that.
01-27-2009, 03:32 AM#5
Bobo_The_Kodo
Or just do this :

Collapse JASS:
function InitTrig_EnergySpike takes nothing returns nothing
 local trigger t = CreateTrigger( )
 call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_CAST)
 call TriggerAddCondition( t, Condition( function EnergySpikeCondition ) )
 call TriggerAddAction( t, function EnergySpikeActions )
endfunction
01-27-2009, 06:09 AM#6
Valdez
Thanks for help, Ani I would give you rep..but I can't give any to you yet :(

and Bobo, for some reason it doesn't load when I try giving some to u.