ZakkWylde-
New Member
- Reaction score
- 14
3 questions:
1. The subject of this: is there a better way to do this?
2. Is there a chance that [ljass] call PauseUnit( slider, true )
call IssueImmediateOrder( slider, "stop" )
call PauseUnit( slider, false )[/ljass] would cause an order from a player (like use Divine Shield) to be canceled? Would this be fixed by removing the PauseUnits?
3. Does anyone know possible benefits to pausing the unit before ordering it to stop (and then unpausing it?)
Here is the code:
Thanks,
Zakk
PS: I've been very needy recently I hope soon to contribute as much as I've learned from this site.
1. The subject of this: is there a better way to do this?
2. Is there a chance that [ljass] call PauseUnit( slider, true )
call IssueImmediateOrder( slider, "stop" )
call PauseUnit( slider, false )[/ljass] would cause an order from a player (like use Divine Shield) to be canceled? Would this be fixed by removing the PauseUnits?
3. Does anyone know possible benefits to pausing the unit before ordering it to stop (and then unpausing it?)
Here is the code:
JASS:
globals
integer slide1 = 039;Iice039; //ice
integer slide2 = 039;Nsnw039; //snow - kills
integer slide3 = 039;Dlvc039; //lava cracks
integer slide4 = 039;Dlav039; //lava - kills
endglobals
function Trig_to_turn_Conditions takes nothing returns boolean
local integer Id = GetPlayerId(GetOwningPlayer( GetTriggerUnit() ))
return Id != 12 and Id != 15 and GetIssuedOrderId() != 851973
endfunction
function Trig_to_turn_Actions takes nothing returns nothing
local unit slider = GetTriggerUnit()
local real X = GetUnitX( slider )
local real Y = GetUnitY( slider )
local real faceX
local real faceY
local integer terType = GetTerrainType(X, Y)
if (terType == slide1 or terType == slide2 or terType == slide3 or terType == slide4) then
set faceX = GetOrderPointX() - X
set faceY = GetOrderPointY() - Y
call SetUnitFacing( slider, (Atan2(faceY, faceX)*bj_RADTODEG) )
call PauseUnit( slider, true )
call IssueImmediateOrder( slider, "stop" )
call PauseUnit( slider, false )
endif
set slider = null
endfunction
//===========================================================================
function InitTrig_Turning takes nothing returns nothing
set gg_trg_Turning = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Turning, EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER )
call TriggerAddCondition( gg_trg_Turning, Condition( function Trig_to_turn_Conditions ) )
call TriggerAddAction( gg_trg_Turning, function Trig_to_turn_Actions )
endfunction
Thanks,
Zakk
PS: I've been very needy recently I hope soon to contribute as much as I've learned from this site.