Ok, my spell is basically a Shockwave that teleports the casting unit to the targeted point. It worked fine with GUI but after reading a couple of tutorials I thought I'd see if I could make it in JASS too. Here's what I have:
function Trig_Flame_Burst_Copy_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A00I' ) ) then
return false
endif
return true
endfunction
function Trig_Flame_Burst_Copy_Actions takes nothing returns nothing
local location l = GetSpellTargetLoc()
local real x = GetLocationX(l)
local real y = GetLocationY(l)
local unit u = GetTriggerUnit()
PauseUnit takes unit u, boolean true returns nothing
SetUnitFlyHeight takes unit u, real 0, real 0 returns nothing
SetUnitPositionLoc takes u, location , GetLocationX(l), GetLocationY(l), returns nothing
SetUnitFlyHeight takes unit u, GetUnitDefaultFlyHeightu, real 0 returns nothing
PauseUnit takes unit u boolean false returns nothing
endfunction
//===========================================================================
function InitTrig_Flame_Burst_Copy takes nothing returns nothing
set gg_trg_Flame_Burst_Copy = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Flame_Burst_Copy, EVENT_PLAYER_UNIT_SPELL_FINISH )
call TriggerAddCondition( gg_trg_Flame_Burst_Copy, Condition( function Trig_Flame_Burst_Copy_Conditions ) )
call TriggerAddAction( gg_trg_Flame_Burst_Copy, function Trig_Flame_Burst_Copy_Actions )
endfunction
Every time I try and test the map I get a message saying that it 'Expected a code statement' in all the lines that involve changing the unit in some way. I know that you can call a function instead, but I read somewhere that this way reduces lag. Can anyone point me in the right direction?
function Trig_Flame_Burst_Copy_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A00I' ) ) then
return false
endif
return true
endfunction
function Trig_Flame_Burst_Copy_Actions takes nothing returns nothing
local location l = GetSpellTargetLoc()
local real x = GetLocationX(l)
local real y = GetLocationY(l)
local unit u = GetTriggerUnit()
PauseUnit takes unit u, boolean true returns nothing
SetUnitFlyHeight takes unit u, real 0, real 0 returns nothing
SetUnitPositionLoc takes u, location , GetLocationX(l), GetLocationY(l), returns nothing
SetUnitFlyHeight takes unit u, GetUnitDefaultFlyHeightu, real 0 returns nothing
PauseUnit takes unit u boolean false returns nothing
endfunction
//===========================================================================
function InitTrig_Flame_Burst_Copy takes nothing returns nothing
set gg_trg_Flame_Burst_Copy = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Flame_Burst_Copy, EVENT_PLAYER_UNIT_SPELL_FINISH )
call TriggerAddCondition( gg_trg_Flame_Burst_Copy, Condition( function Trig_Flame_Burst_Copy_Conditions ) )
call TriggerAddAction( gg_trg_Flame_Burst_Copy, function Trig_Flame_Burst_Copy_Actions )
endfunction
Your missing countless calls and forgeting to give most calls a function.
PauseUnit takes unit u, boolean true returns nothing
Your not defining the function your calling it so no è&ç%/() wonder it will not work. Try this instead.
function Trig_Flame_Burst_Copy_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A00I'
endfunction
function Trig_Flame_Burst_Copy_Actions takes nothing returns nothing
local location l = GetSpellTargetLoc()
local unit u = GetTriggerUnit()
call PauseUnit(u,true)
call SetUnitFlyHeight(u,0,0)
call SetUnitPositionLoc(u,l)
call SetUnitFlyHeight(u,GetUnitDefaultFlyHeight(u),0)
call PauseUnit(u,false)
call RemoveLocation(l)
set l = null
set u = null
endfunction
function InitTrig_Flame_Burst_Copy takes nothing returns nothing
set gg_trg_Flame_Burst_Copy = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_Flame_Burst_Copy,EVENT_PLAYER_UNIT_SPELL_FINISH)
call TriggerAddCondition(gg_trg_Flame_Burst_Copy,Condition(function Trig_Flame_Burst_Copy_Conditions))
call TriggerAddAction(gg_trg_Flame_Burst_Copy,function Trig_Flame_Burst_Copy_Actions)
endfunction
THAT IS WHAT IT SHOULD BE!!!!!!! I was kind enough to even rewrite the trigger removing unessary locals and it will run more efficently as well as nolonger leak.
Im sorry I was so angry writing that. . . I was writing a verycomplex spell for my map that was a jassed up star fall with added effects and i was having trouble deciding on how to write it.
If you need any help with a spell PM me your jass code and ill rewrite it so that it works and explain where you went worng.