Cokemonkey11
Spell Reviewer
- Joined
- May 9, 2006
- Messages
- 3,575
So heres my code:
The units 'h000' through 'h004' are just footmen with different negative roll angles, this trigger is set up to make a unit appear to be 'tilting' back and fourth
But unfortunately after a few seconds of running the unit is replaced with one standing straight up and facing 0 degrees
Is this a bug in my trigger or?
JASS:
globals
unit foot
integer array unitType
integer adder = 1
integer current = 1
endglobals
function timerResults takes nothing returns nothing
call RemoveUnit(foot)
set foot = CreateUnit(Player(0),unitType[current],0,0,270)
set current = current+adder
if current>=5 then
set adder = -1
elseif current<=1 then
set adder = 1
endif
endfunction
function Trig_tiltingFoot_Actions takes nothing returns nothing
local timer time = CreateTimer()
set unitType[1] = 'h000'
set unitType[2] = 'h001'
set unitType[3] = 'h002'
set unitType[4] = 'h003'
set unitType[5] = 'h004'
set foot = CreateUnit(Player(0),'h000',0,0,270)
call TimerStart(time,.03,true,function timerResults)
endfunction
function InitTrig_tiltingFoot takes nothing returns nothing
set gg_trg_tiltingFoot = CreateTrigger()
call TriggerRegisterTimerEvent(gg_trg_tiltingFoot,1,false)
call TriggerAddAction(gg_trg_tiltingFoot,function Trig_tiltingFoot_Actions)
endfunction
The units 'h000' through 'h004' are just footmen with different negative roll angles, this trigger is set up to make a unit appear to be 'tilting' back and fourth
But unfortunately after a few seconds of running the unit is replaced with one standing straight up and facing 0 degrees
Is this a bug in my trigger or?