- Joined
- Oct 21, 2007
- Messages
- 123
When i tried creating a building onto a certin location, i would like it to be facing some other direction rather then facing front every time. Is there a way to rotate it?
function Trig_Rotation_Conditions takes nothing returns boolean
if ( not ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_STRUCTURE) == true ) ) then
return false
endif
return true
endfunction
function Trig_Rotation_Actions takes nothing returns nothing
call SetUnitPositionLocFacingBJ( GetTriggerUnit(), GetUnitLoc(GetTriggerUnit()), bj_UNIT_FACING )
endfunction
//===========================================================================
function InitTrig_Rotation takes nothing returns nothing
set gg_trg_Rotation = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_Rotation, 1.00 )
call TriggerAddCondition( gg_trg_Rotation, Condition( function Trig_Rotation_Conditions ) )
call TriggerAddAction( gg_trg_Rotation, function Trig_Rotation_Actions )
endfunction
lol en_feugo how rare of you to respond to me. Anyhow i had the idea of using the creation trigger and spawn the building to rotate since it's only way. ty anyhow.
Easy questions are nice for easy rep.
if you reffer to my answer... i dont know jass :S
b
Event-
A unit finishes building
Condition-
Finished building (BuildingInRegion) = True
Action-
Set unit facing point X,Y
That is called GUI. And yes i know how that works. I just didn't think about it clearly about that kind of rotation lol. Either way ty for your helping attempt.
also... you may set that building as a unit (in the unit properties) then.. place the unit in the location you want and make it face the point you want with this "/" "*" ... after this... go back to unit properties and set the unit back to building...