Jump to content


Photo

Animation Code Problems


  • Please log in to reply
3 replies to this topic

#1 Redhorn Pass

Redhorn Pass

    Also known as Fohel

  • Members
  • 135 posts
  • Projects:The Beorn Mod
  •  An INI coder

Posted 28 May 2009 - 07:06 PM

Hi, I have been trying to create a beorn for my mod and am currently doing the bear coding. The problem is that the bear does not use any of the attacking animations which I have created. :p I have put the following code into my object code file:

The attacking code:

// --- Attacking Anims		
AnimationState				= FIRING_OR_PREATTACK_A DISGUISED	// Melee attack.
	Animation
		AnimationName		= CUBear_SKL.CUBear_IDLF
		AnimationMode		= ONCE
		UseWeaponTiming		= NO
	End
End


The DISGUISED model condition is the one I am using to change between human and bear

The other bear animation code:

CODE


;The walking code
AnimationState = DISGUISED MOVING PANICKING
Animation = RUNA
AnimationName = CUBear_SKL.CUBear_RUNA
AnimationMode = LOOP
End
Flags = RANDOMSTART
End

AnimationState = DISGUISED MOVING
StateName = STATE_moving
Animation = Moving
AnimationName = CUBear_SKL.CUBear_WALKA
AnimationBlendTime = 10
AnimationMustCompleteBlend = yes
End
Flags = RESTART_ANIM_WHEN_COMPLETE
BeginScript
Prev = CurDrawablePrevAnimationState()
if Prev == "STATE_Alert" then CurDrawableSetTransitionAnimState("TRANS_AlertToIdle") end
EndScript

End


;The death code

AnimationState = DISGUISED DYING
Animation = CUBear_DIEA
AnimationName = CUBear_SKL.CUBear_DIEA
AnimationMode = ONCE
End
End

;The idle code
AnimationState= DISGUISED
StateName = STATE_Idle
Animation = IdleA
AnimationName = CUBear_SKL.CUBear_IDLA
AnimationPriority = 10
AnimationMode = ONCE
AnimationBlendTime = 10
End
Animation = IdleB
AnimationName = CUBear_SKL.CUBear_IDLB
AnimationPriority = 10
AnimationMode = ONCE
AnimationBlendTime = 10
End
Flags = RESTART_ANIM_WHEN_COMPLETE
BeginScript
Prev = CurDrawablePrevAnimationState()
if Prev == "STATE_Alert" then CurDrawableSetTransitionAnimState("TRANS_AlertToIdle") end
EndScript
End

I know that there is no problem with the animation model since I used the following code as a test:

   	AnimationState= DISGUISED
		StateName					=   STATE_Idle
		Animation = IdleA
			AnimationName	   = CUBear_SKL.CUBear_IDLF
			AnimationPriority	= 10
			AnimationMode	   = ONCE
			AnimationBlendTime	=	10
		End
		Animation = IdleB
			AnimationName	   = CUBear_SKL.CUBear_IDLF
			AnimationPriority	= 10
			AnimationMode	   = ONCE
			AnimationBlendTime	=	10
		End

The animation model works fine when I use it as my idle animation. It is only when I use it as my attacking animation that nothing happens. This makes me think that it is my code not the animation model which is at fault.


_________________________________________________________________________

I have also created a special attack called bear pounce. Bear pounce is based on the earth shatter ability. The bear pounce kills all the nearby enemies as it should but the bear does not stand up and slam its front paws on the ground as it is supposed to. :good: This is my animation code for bear pounce:

AnimationState		  =	SPECIAL_WEAPON_THREE DISGUISED // FIRING_OR_PREATTACK_C
			StateName		  =	Attacking
			Animation		  =	StaffLaser
				AnimationName =	CUBear_SKL.CUBear_IDLF//	isitari's light?
				AnimationMode =	ONCE
			End
			FXEvent			  =	Frame:30 Name:FX_GandalfStaffFlare
		End

Is SPECIAL_WEAPON_THREE the model condition I should use here?

My special power code for bear pounce:

Behaviour code:

CODE

;---------------------------Pounce-------------------------------------


Behavior = UnpauseSpecialPowerUpgrade ModuleTag_CreateAHeroBearPounceEnabler_Level1
SpecialPowerTemplate = SpecialAbilityCreateAHeroBearPounce
TriggeredBy = Upgrade_CreateAHeroBearPounce_Level1
End
Behavior = SpecialPowerModule ModuleTag_CreateAHeroBearPounceStarter_Level1
SpecialPowerTemplate = SpecialAbilityCreateAHeroBearPounce
UpdateModuleStartsAttack = Yes
StartsPaused = Yes
End
Behavior = WeaponFireSpecialAbilityUpdate ModuleTag_CreateAHeroBearPounceUpdate_Level1
SpecialPowerTemplate = SpecialAbilityCreateAHeroBearPounce
SpecialWeapon = CreateAHeroEarthShaker_Level1
WhichSpecialWeapon = 3 ; Corresponds to SPECIAL_WEAPON_THREE
StartAbilityRange = 1.0

SkipContinue = Yes
UnpackTime = 2000 ; Trigger on frame 60 (of 100)
PackTime = 1333 ; Remaining 40 frames (of 100)
MustFinishAbility = Yes
End

Does anyone know why my attack animations won't work?

Thanks :)
Posted Image

Posted Image

#2 Ridder Geel

Ridder Geel

    Master Yelloh

  • T3A Staff
  • 10,852 posts
  • Location:The Netherlands (AKA: Holland)
  • Projects:RC Mod + SEE + RTS Engine
  •  The Dangerous T3A Team Chamber Member
  • Division:BFME
  • Job:T3A Staff

Posted 28 May 2009 - 07:24 PM

Are those animations before the "normal" state ones? :good:
Ridder Geel

#3 Redhorn Pass

Redhorn Pass

    Also known as Fohel

  • Members
  • 135 posts
  • Projects:The Beorn Mod
  •  An INI coder

Posted 29 May 2009 - 12:41 PM

Are those animations before the "normal" state ones? :good:


Yes. Should the disguised animations be after the normal animations?

Edited by Redhorn Pass, 29 May 2009 - 12:42 PM.

Posted Image

Posted Image

#4 Ridder Geel

Ridder Geel

    Master Yelloh

  • T3A Staff
  • 10,852 posts
  • Location:The Netherlands (AKA: Holland)
  • Projects:RC Mod + SEE + RTS Engine
  •  The Dangerous T3A Team Chamber Member
  • Division:BFME
  • Job:T3A Staff

Posted 29 May 2009 - 01:59 PM

No before...
I believe you want him to change form? Why not just make him as a new object like the WK :p Look in his code to see what i mean :sad:
Ridder Geel




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users