Page 1 of 1
Animation trigger PLEASE help!
Posted: Fri Apr 11, 2008 5:25 pm
by cloneknight
I want to make it so that when i shoot a panel thet a "gate" closes but when i repare it it opens. how would i be able to do this, i know it has to do with the lua thing but i dont really under stand it...
Re: animation trigger help
Posted: Fri Apr 11, 2008 5:35 pm
by Maveritchell
Code: Select all
OnObjectKillName(PlayAnimDown, "gatepanel");
OnObjectRespawnName(PlayAnimUp, "gatepanel");
function PlayAnimDown()
PauseAnimation("thegateup");
RewindAnimation("thegatedown");
PlayAnimation("thegatedown");
ShowMessageText("level.kas2.objectives.gateopen",1)
ScriptCB_SndPlaySound("KAS_obj_13")
SetProperty("gatepanel", "MaxHealth", 2200)
-- SetProperty("gatepanel", "CurHealth", 50000)
-- PlayAnimation("gatepanel");
--SetProperty("gatepanel", "MaxHealth", 1e+37)
--SetProperty("gatepanel", "CurHealth", 1e+37)
-- Allowing AI to run under gate
UnblockPlanningGraphArcs("seawall1");
DisableBarriers("seawalldoor1");
DisableBarriers("vehicleblocker");
end
function PlayAnimUp()
PauseAnimation("thegatedown");
RewindAnimation("thegateup");
PlayAnimation("thegateup");
-- Allowing AI to run under gate
BlockPlanningGraphArcs("seawall1");
EnableBarriers("seawalldoor1");
EnableBarriers("vehicleblocker");
SetProperty("gatepanel", "MaxHealth", 1000)
SetProperty("gatepanel", "CurHealth", 1000)
end
Those are the pertinent sections from the Kashyyyk .lua.
Re: Animation trigger PLEASE help!
Posted: Fri Apr 11, 2008 11:30 pm
by cloneknight
here are the names fo the objects and animations
gate lock(object) = lock
"group" name of animation = nesttrap
anim name = nestget
what i tried to do is so when the lock is destroied that the anim group nesttrap activates and when it is fixed it rewinds? (i dont know if it can rewind if not ill make a anim that un does the "trap") and it just does that whenevet you fix or destory "lock"
tried to do it myself kept getting craches...
Re: Animation trigger PLEASE help!
Posted: Sat Apr 12, 2008 4:13 pm
by cloneknight
sorry for double post
if i edit it it wouldnt have moved up sorry
here is what i tried to do nestup is what happens when you destroy lock
when you fix lock it playd nestdown
OnObjectKillName(PlayAnimUp, "lock");
OnObjectRespawnName(PlayAnimDown, "lock");
function PlayAnimUp()
PauseAnimation("nestdown");
RewindAnimation("nestup");
PlayAnimation("nestup");
end
function PlayAnimDown()
PauseAnimation("nestup");
RewindAnimation("nestdown");
PlayAnimation("nestdown");
end