- Joined
- Jan 1, 2005
- Messages
- 133
Ok basically ive got a bug in my sc maps where when you liftoff the cc can still recieve miners/gas whiles its surpose to be flying. Now i had a guy create a slow lifoff/liftdown trigger system and i realised if i could add a remove ability (return lumber&gold) then i would fix this bug from the game but i dunno how towrite the coding in jass. Anyone help
I tried to add the line call UnitRemoveAbility(u,'A00V') but keepo getting a varible error so im guessing im not setting it correctly.
JASS:
function Trig_Terran_Liftoff_Conditions takes nothing returns boolean
return GetIssuedOrderId()==OrderId("unroot")
endfunction
function IncreaseHeight takes nothing returns nothing
local timer t=GetExpiredTimer()
local unit u=GetHandleUnit(t,"Structure")
call SetUnitFlyHeight(u,GetUnitFlyHeight(u)+5,0)
if GetUnitFlyHeight(u)>200 then
call FlushStoredHandle(t,"Structure")
call DestroyTimer(t)
endif
set t=null
set u=null
endfunction
function Trig_Terran_Liftoff_Actions takes nothing returns nothing
local timer t=CreateTimer()
call UnitRemoveAbility(u,'A00V')
call SetHandleHandle(t,"Structure",GetTriggerUnit())
call SetUnitFlyHeight(GetTriggerUnit(),0,0)
call TimerStart(t,0.05,true,function IncreaseHeight)
endfunction
//===========================================================================
function InitTrig_Terran_Liftoff takes nothing returns nothing
set gg_trg_Terran_Liftoff=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_Terran_Liftoff,EVENT_PLAYER_UNIT_ISSUED_ORDER)
call TriggerAddCondition(gg_trg_Terran_Liftoff,Condition(function Trig_Terran_Liftoff_Conditions))
call TriggerAddAction(gg_trg_Terran_Liftoff,function Trig_Terran_Liftoff_Actions)
endfunction
I tried to add the line call UnitRemoveAbility(u,'A00V') but keepo getting a varible error so im guessing im not setting it correctly.