| 01-27-2009, 12:30 AM | #1 |
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: 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 JASS:function InitTrig_EnergySpike takes nothing returns nothing 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 |
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 | |
Quote:
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 |
Yep, you need to create a "trigger" named that. |
| 01-27-2009, 03:32 AM | #5 |
Or just do this : 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 |
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. |
