- Joined
- Feb 21, 2005
- Messages
- 26
hey, I just started learning Jass yesterday and i need help with why my if statements keep giving me a End Of Line Error.
JASS:
function Trig_Up_Sides takes nothing returns nothing
//If the unit wasnt in a location where you could move to 4 locations it looks for locations with 3 movements
local region Region
local integer i=10//location checker
local integer x=0
loop
set Region = udg_Location[x]
set x=x+1
exitwhen x==5
endloop
loop
set Region = udg_Location[i]
set i=i+6
exitwhen i==136
endloop
endfunction
function Trig_Up_Actions takes nothing returns nothing
local region Region
local integer i=11//location checker
local integer x=15//for 3 space regions they go from x1-x5 when it reaches this it will tell i to add 6 to it
set udg_CurrentLocation[GetConvertedPlayerId(GetTriggerPlayer())] = GetTriggeringRegion()
loop
set Region = udg_Location[i]
//Looks for locations that can move 3 spaces
//////////////////////////////////
if i==x then set i=i+ set x=x+10 else endif //Error! Expected End Of Line//
set i=i+1 //////////////////////////////////
exitwhen i==145
endloop
if udg_CurrentLocation[GetConvertedPlayerId(GetTriggerPlayer())] != Region then call
TriggerAddAction( gg_trg_Up, function Trig_Up_Sides ) else endif //Error! Expected End //Of Line
endfunction
//===========================================================================
function InitTrig_Up takes nothing returns nothing
set gg_trg_Up = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Up, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddAction( gg_trg_Up, function Trig_Up_Actions )
endfunction