• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[JASS] negative roll angle stuffs

Status
Not open for further replies.

Cokemonkey11

Spell Reviewer
Level 30
Joined
May 9, 2006
Messages
3,547
So heres my code:

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?
 
Status
Not open for further replies.
Top