Animation trigger PLEASE help!
Moderator: Moderators
-
cloneknight
- Chief Warrant Officer

- Posts: 357
- Joined: Sun Aug 20, 2006 11:39 am
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
Animation trigger PLEASE help!
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...
Last edited by cloneknight on Fri Apr 11, 2008 9:06 pm, edited 1 time in total.
- Maveritchell
- Jedi Admin

- Posts: 7366
- Joined: Mon Aug 21, 2006 11:03 pm
Re: animation trigger help
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-
cloneknight
- Chief Warrant Officer

- Posts: 357
- Joined: Sun Aug 20, 2006 11:39 am
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
Re: Animation trigger PLEASE help!
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...
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...
-
cloneknight
- Chief Warrant Officer

- Posts: 357
- Joined: Sun Aug 20, 2006 11:39 am
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
Re: Animation trigger PLEASE help!
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
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
