Multiple animation problem [solved]

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
User avatar
asleeponduty
Private First Class
Posts: 77
Joined: Tue Jul 22, 2008 3:05 pm
Games I'm Playing :: AaaaaAAaaaAAAaaAAAA
xbox live or psn: No gamertag set
Location: Illinois

Multiple animation problem [solved]

Post by asleeponduty »

In my capture-the flag map, I am trying to script several animations that will raise the cannons out of these cannon-pits I created, and when one gets destroyed it is lowered down into the pit, is given full health and raised.
Heres an example:
Destroy object -> all turrets go up. Kill one turret-> busted turret goes on its animation -> Give full health to turret -> turret goes up and repeat
Heres my code so far:

Code: Select all

    Command1 = OnObjectKill(
		function(object, killer)
			if GetEntityName(object) == "panel1" then
				PlayAnimation("turret1") -- opens up the tunnel
				PlayAnimation("opengun2")  -- opens up side1's cannon
				PlayAnimation("openthehatch")  -- opens up side2's cannon
				UnblockPlanningGraphArcs(1)
			end
		end
	)
---------------------------------------------------------------------------
-- this is side 1's code, side2's code is pretty 
-- much the same thing but with different anims  

 Command2 = OnObjectKill(
		function(object, killer)
			if GetEntityName(object) == "gunside1" then
				PauseAnimation("turret1") -- <- thats a bad idea, i know.
				PauseAnimation("closegun1") 
				RewindAnimation("closegun1") 
				PlayAnimation("closegun1") 

 -- <-closegun1 sends the turret and its platform into the ground

				firstgun = CreateTimer("firstgun")
				SetTimerValue(firstgun, (30))
				StartTimer(firstgun)
				OnTimerElapse(
					function(timer)
					SetProperty("gunside1", "CurHealth", 800)
					PauseAnimation("openthehatch") 
					RewindAnimation("openthehatch") 
					PlayAnimation("openthehatch")  
					DestroyTimer(timer) 
					end, 
				firstgun)				
			end
		end
		)
Last edited by asleeponduty on Wed Feb 09, 2011 5:36 pm, edited 1 time in total.
User avatar
DarthD.U.C.K.
Master of the Force
Master of the Force
Posts: 6027
Joined: Wed Sep 27, 2006 11:05 am
Location: Duckburg, Germany

Re: Multiple animation problem

Post by DarthD.U.C.K. »

the code looks good imho, what exactly doesnt work?
User avatar
asleeponduty
Private First Class
Posts: 77
Joined: Tue Jul 22, 2008 3:05 pm
Games I'm Playing :: AaaaaAAaaaAAAaaAAAA
xbox live or psn: No gamertag set
Location: Illinois

Re: Multiple animation problem

Post by asleeponduty »

The problem was the animations wouldnt run, for one of the turrets


Edit: Solved. It was an animation munge error
Post Reply