Jump to content


Photo

slow death for drogoth


  • Please log in to reply
7 replies to this topic

#1 firmus

firmus
  • Project Team
  • 134 posts

Posted 13 March 2006 - 02:42 PM

hi,

I made Slow Death for my drogoth, so he falls down. All works, apart from the anims. I've made three anims, but I don't know how to define,
that the game plays all three anims.
first the first one time,
then the second in a loop, until drogoth hits the ground,
and the 3rd should be played, when he hits the ground.

		  AnimationState = DYING
		 Animation 
				AnimationName = WUDrogoth_SKL.WUDrogoth_DIEA
				  AnimationMode = ONCE
				 ;AnimationBlendTime = 10
			   ;AnimationSpeedFactorRange = 0.5 0.5
			  End
		End
		  AnimationState = DYING
			Animation 
				AnimationName = WUDrogoth_SKL.WUDrogoth_DIEB
				  AnimationMode = LOOP
				 ;AnimationBlendTime = 10
			   ;AnimationSpeedFactorRange = 0.5 0.5
			  End
		End

		AnimationState = RUBBLE 
			Animation 
				AnimationName = WUDrogoth_SKL.WUDrogoth_DIEC
				AnimationMode = ONCE
				AnimationBlendTime = 4
			End
		End

what must I change?

#2 Bart

Bart

  • Network Admins
  • 8,524 posts
  • Location:The Netherlands
  • Division:Revora
  • Job:Network Leader

Posted 13 March 2006 - 03:01 PM

what about scripting it? you know, BeginScript EndScript stuff
bartvh | Join me, make your signature small!
Einstein: "We can’t solve problems by using the same kind of thinking we used when we created them."

#3 firmus

firmus
  • Project Team
  • 134 posts

Posted 13 March 2006 - 05:25 PM

but how it works? (which scripts I need)

#4 ched

ched

    .

  • Undead
  • 4,431 posts
  • Location:Angers (France)
  • Projects:Rhovanion Alliance
  •  T3A Team Chamber Member
  • Division:BFME
  • Job:Previous Division Leader

Posted 13 March 2006 - 06:08 PM

The best would be to combine all 3 anims in one, but well, let's go with scripting :spam:

I have not tested this myself, and although I've acquired a certain experience with this animation scripting, I'm guessing it may not work due to the fact you can't play several anims under one animation state.

First off, you should be referring to all of them in one AnimationState, DYING.

AnimationState			= DYING
			Animation	 = Part1
				AnimationName	   	= WUDrogoth_SKL.WUDrogoth_DIEA
				AnimationMode	   	= ONCE
			End
			Animation		   		= Part2
				AnimationName	   	= WUDrogoth_SKL.WUDrogoth_DIEB
				AnimationMode	   	= ONCE
			End
			Animation		   		= Part3
				AnimationName	   	= WUDrogoth_SKL.WUDrogoth_DIEC
				AnimationMode	   	= ONCE
								AnimationBlendTime = 4
			End
					   End

Referring to multiple animation states will result in some not being used, or worse, game.dat
Now, by using the same Animation State for all, what you do is randomize between the anims, which still isn't the point; this is where the scripting kicks in.

Notice that I've named each anim in the line "Animation =" and cut it down into Part 1, 2 and 3. What we'll do is that we'll script it so it goes to through the 3 anims one by one.
First off, as I said before, it will randomise through the anims if you don't pick one up straight away. So we call for Part1.
BeginScript
								   return "Part1"

And that's where I'm afraid the code will stop parsing the scripting. But it's worth trying ;)

then you simply play the other two, but do add a continuity, so it plays 2 after 1, and 3 after 2.

BeginScript
								  if PrevAnim == "Part2"
				then
					return "Part3"
								else
					if PrevAnim == "Part1"
										return "Part2"
								else  
										return "Part1"
								end
								end
					EndScript

Hopefully that was clear enough :huh:

final code :

AnimationState			= DYING
			Animation	 = Part1
				AnimationName	   	= WUDrogoth_SKL.WUDrogoth_DIEA
				AnimationMode	   	= ONCE
			End
			Animation		   		= Part2
				AnimationName	   	= WUDrogoth_SKL.WUDrogoth_DIEB
				AnimationMode	   	= ONCE
			End
			Animation		   		= Part3
				AnimationName	   	= WUDrogoth_SKL.WUDrogoth_DIEC
				AnimationMode	   	= ONCE
								AnimationBlendTime = 4
			End
					   End
							  BeginScript
								   if PrevAnim == "Part2"
				 then
				 	return "Part3"
								 else
				 	if PrevAnim == "Part1"
										 return "Part2"
								 else  
										 return "Part1"
								 end
								 end
				   EndScript

Edited by ched, 13 March 2006 - 06:10 PM.

Software is like sex; it's better when it's free ~Linus Torvald

#5 Bart

Bart

  • Network Admins
  • 8,524 posts
  • Location:The Netherlands
  • Division:Revora
  • Job:Network Leader

Posted 13 March 2006 - 06:27 PM

shouldn't the last animation be in RUBBLE (or the unit equivalent), because it has to play when he's actually dead?
bartvh | Join me, make your signature small!
Einstein: "We can’t solve problems by using the same kind of thinking we used when we created them."

#6 ched

ched

    .

  • Undead
  • 4,431 posts
  • Location:Angers (France)
  • Projects:Rhovanion Alliance
  •  T3A Team Chamber Member
  • Division:BFME
  • Job:Previous Division Leader

Posted 13 March 2006 - 06:48 PM

Another idea I had would be setting a transition anim between the anims. Basically through that you can call AnimState.

So you'd have the DYING animation state, and two other TransitionStates.



Then, in the scripts, you'd have the following :

BeginScript
		CurDrawableSetTransitionAnimState("Death_Part2") 
			EndScript

however, with transition states, it plays the transition first. So you'll have to go backwards, by setting Part3 under the AnimState, calling part2 (as a transition) and then calling part1 from part2, and let it all play :spam:

you should end up with something similar :

AnimationState = DYING
			 Animation	 = Part3
				AnimationName		   = WUDrogoth_SKL.WUDrogoth_DIEC
				AnimationMode		   = ONCE
			End
		   BeginScript
					 CurDrawableSetTransitionAnimState("Death_Part2") 
			EndScript
		 End

		TransitionState = Death_Part2
		Animation				   = Part2
				  AnimationName		   = WUDrogoth_SKL.WUDrogoth_DIEB
				  AnimationMode		   = ONCE
			End	
			 BeginScript
					 CurDrawableSetTransitionAnimState("Death_Part1") 
			EndScript
	End

		 TransitionState = Death_Part1
		Animation				   = Part1
				  AnimationName		   = WUDrogoth_SKL.WUDrogoth_DIEB
				  AnimationMode		   = ONCE
			End	
		 End

hopefully this will work better than the first one I suggested ;)

On a side note, thanks to Dain for forcing me to manipulate those AnimScripts, it seems to have paid off :huh:
Software is like sex; it's better when it's free ~Linus Torvald

#7 Bart

Bart

  • Network Admins
  • 8,524 posts
  • Location:The Netherlands
  • Division:Revora
  • Job:Network Leader

Posted 13 March 2006 - 06:55 PM

nice avatar BTW :huh:
bartvh | Join me, make your signature small!
Einstein: "We can’t solve problems by using the same kind of thinking we used when we created them."

#8 firmus

firmus
  • Project Team
  • 134 posts

Posted 13 March 2006 - 09:55 PM

both codes don't work :(




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users