waaaks!
Zinctified
- Reaction score
- 255
heres a trigger made by vex for showing the animation index of a selected unit
u need only to press esc, then the selected unit will play its animation indexes
it requires cs cache
i hope this helps someone
u need only to press esc, then the selected unit will play its animation indexes
it requires cs cache
JASS:
function AnimationTest_Actions takes nothing returns nothing
local group g=CreateGroup()
local player p=GetTriggerPlayer()
local unit u
local trigger t
local string k
local integer i
local boolean b
call GroupEnumUnitsSelected(g,p,null)
set u=FirstOfGroup(g)
if (GetTableBoolean("[animtest]", "viewing")) then
call CinematicModeBJ(false,bj_FORCE_ALL_PLAYERS)
call SetTableBoolean(GetTableString("[animtest]","current"),"skip",true)
call SetTableString("[animtest]","current","")
call SetTableBoolean("[animtest]","viewing",false)
call ClearTextMessages()
elseif (u!=null) then
call CinematicModeBJ(true,bj_FORCE_ALL_PLAYERS)
call VolumeGroupReset()
set k=NewTable()
call SetTableString("[animtest]","current",k)
call SetTableBoolean("[animtest]","viewing",true)
call SetCameraPosition(GetUnitX(u),GetUnitY(u))
call PauseUnit(u,true)
set b=(GetUnitAbilityLevel(u,039;Avul039;)==0)
if (b) then
call UnitAddAbility(u,039;Avul039;)
endif
set i=0
call TriggerSleepAction(0)
loop
exitwhen (GetTableBoolean(k,"skip"))
call ClearTextMessages()
call BJDebugMsg("Currently playing Animation "+I2S(i)+"\nPress ESC again to exit")
call SetUnitAnimationByIndex(u,i)
call PolledWait(3)
set i=i+1
endloop
call PauseUnit(u,false)
if (b) then
call UnitRemoveAbility(u,039;Avul039;)
endif
call DestroyTable(k)
else
call BJDebugMsg("Please select a unit before pressing ESC")
endif
call DestroyGroup(g)
set g=null
set u=null
endfunction
//===========================================================================
function InitTrig_AnimationTest takes nothing returns nothing
local integer a=0
set gg_trg_AnimationTest = CreateTrigger( )
loop
exitwhen (a>11)
call TriggerRegisterPlayerEventEndCinematic( gg_trg_AnimationTest, Player(a) )
set a=a+1
endloop
call TriggerAddAction( gg_trg_AnimationTest, function AnimationTest_Actions )
endfunction
i hope this helps someone