• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Solved] Strange Syntax error

Status
Not open for further replies.
This seems to wrong however I don't know where it is wrong at, would appreciate any help.

[jass=bugged part]

function kidot takes nothing returns nothing
local trigger z22 = CreateTrigger()
local trigger x22 = CreateTrigger()
local unit u=GetSpellAbilityUnit()
TriggerRegisterUnitEvent(z22, u, EVENT_UNIT_SPELL_ENDCAST)
call TriggerAddAction( z22, function Trig_Kidot_Actions3 )
TriggerRegisterUnitEvent(x22, u, EVENT_UNIT_SPELL_FINISH)
call TriggerAddAction( x22, function Trig_Kidot_Actions2 )
endfunction

Only the above seems to be a problem

function InitTrig_KidotProjectionX takes nothing returns nothing
set gg_trg_KidotProjectionX = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_KidotProjectionX, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_KidotProjectionX, Condition( function Trig_Kidot_Conditions2 ) )
call TriggerAddAction( gg_trg_KidotProjectionX, function kidot )
endfunction
JASS:
 
Last edited:
Level 16
Joined
Mar 25, 2016
Messages
1,327
function kidot takes nothing returns nothing
local trigger z22 = CreateTrigger()
local trigger x22 = CreateTrigger()
local unit u=GetSpellAbilityUnit()
TriggerRegisterUnitEvent(z22, u, EVENT_UNIT_SPELL_ENDCAST)
call TriggerAddAction( z22, function Trig_Kidot_Actions3 )
TriggerRegisterUnitEvent(x22, u, EVENT_UNIT_SPELL_FINISH)
call TriggerAddAction( x22, function Trig_Kidot_Actions2 )
endfunction
You are missing some calls before registering the events.
 
Level 16
Joined
Mar 25, 2016
Messages
1,327
You forgot the keyword call before your register event functions:
TriggerRegisterUnitEvent(z22, u, EVENT_UNIT_SPELL_ENDCAST)
should be
call TriggerRegisterUnitEvent(z22, u, EVENT_UNIT_SPELL_ENDCAST)

JassHelper is not very informative if you forget to use call/set and just tells you syntax error.
 
Status
Not open for further replies.
Top