The trigger should do the following, move three dummy units around a unit in circles (it triggers once every 0.2 seconds). It doesn't work -.-.
Unit - Move fireDummy[(Integer A)] instantly to
(Point(((X of (Position of surroundedUnit)) + (85.00 x (Sin((200.00 - (Angle from (Position of surroundedUnit) to (Position of fireDummy[(Integer A)])))))))
,
(Point(((Y of (Position of surroundedUnit)) + (85.00 x (Sin(((Angle from (Position of surroundedUnit) to (Position of fireDummy[(Integer A)])-20))))))
What's wrong with this :S (Note some brackets messed up upon copying)?
Here's the JASS:
function Trig_Surrounded_Cosmetics_Actions takes nothing returns nothing
set bj_forLoopAIndex = 0
set bj_forLoopAIndexEnd = 2
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call SetUnitPositionLocFacingLocBJ( udg_fireDummy[GetForLoopIndexA()], Location(( GetLocationX(GetUnitLoc(udg_surroundedUnit)) + ( 85.00 * SinBJ(( 200.00 - AngleBetweenPoints(GetUnitLoc(udg_surroundedUnit), GetUnitLoc(udg_fireDummy[GetForLoopIndexA()])) )) ) ), ( GetLocationY(GetUnitLoc(udg_surroundedUnit)) + ( 85.00 * SinBJ(( AngleBetweenPoints(GetUnitLoc(udg_surroundedUnit), GetUnitLoc(udg_fireDummy[GetForLoopIndexA()])) - -20.00 )) ) )), GetUnitLoc(udg_surroundedUnit) )
call SetUnitAnimation( udg_fireDummy[GetForLoopIndexA()], "attack" )
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
endfunction
//===========================================================================
function InitTrig_Surrounded_Cosmetics takes nothing returns nothing
set gg_trg_Surrounded_Cosmetics = CreateTrigger( )
call DisableTrigger( gg_trg_Surrounded_Cosmetics )
call TriggerRegisterTimerEventPeriodic( gg_trg_Surrounded_Cosmetics, 0.20 )
call TriggerAddAction( gg_trg_Surrounded_Cosmetics, function Trig_Surrounded_Cosmetics_Actions )
endfunction
Unit - Move fireDummy[(Integer A)] instantly to
(Point(((X of (Position of surroundedUnit)) + (85.00 x (Sin((200.00 - (Angle from (Position of surroundedUnit) to (Position of fireDummy[(Integer A)])))))))
,
(Point(((Y of (Position of surroundedUnit)) + (85.00 x (Sin(((Angle from (Position of surroundedUnit) to (Position of fireDummy[(Integer A)])-20))))))
What's wrong with this :S (Note some brackets messed up upon copying)?
Here's the JASS:
function Trig_Surrounded_Cosmetics_Actions takes nothing returns nothing
set bj_forLoopAIndex = 0
set bj_forLoopAIndexEnd = 2
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call SetUnitPositionLocFacingLocBJ( udg_fireDummy[GetForLoopIndexA()], Location(( GetLocationX(GetUnitLoc(udg_surroundedUnit)) + ( 85.00 * SinBJ(( 200.00 - AngleBetweenPoints(GetUnitLoc(udg_surroundedUnit), GetUnitLoc(udg_fireDummy[GetForLoopIndexA()])) )) ) ), ( GetLocationY(GetUnitLoc(udg_surroundedUnit)) + ( 85.00 * SinBJ(( AngleBetweenPoints(GetUnitLoc(udg_surroundedUnit), GetUnitLoc(udg_fireDummy[GetForLoopIndexA()])) - -20.00 )) ) )), GetUnitLoc(udg_surroundedUnit) )
call SetUnitAnimation( udg_fireDummy[GetForLoopIndexA()], "attack" )
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
endfunction
//===========================================================================
function InitTrig_Surrounded_Cosmetics takes nothing returns nothing
set gg_trg_Surrounded_Cosmetics = CreateTrigger( )
call DisableTrigger( gg_trg_Surrounded_Cosmetics )
call TriggerRegisterTimerEventPeriodic( gg_trg_Surrounded_Cosmetics, 0.20 )
call TriggerAddAction( gg_trg_Surrounded_Cosmetics, function Trig_Surrounded_Cosmetics_Actions )
endfunction
Last edited: