Page 1 of 1

Attack Anims

Posted: Sun Jan 10, 2010 11:44 pm
by Edak
Hey everyone, I searched all I could to find this answer but as far as I can tell, it's no where on these forums.

With the AoS weapons, when attacking with the crescent blade for example, The player will swing his hands as if he's wrestling, but the weapon will stay stationary, I noticed in UoFiddler that there is an attack where the weapon actually swings but it's called attack slash 2H, I've defined the item as a 2 handed weapon, but it still does the hand slap animation (which with a weapon as cool as the crescent blade, looks just silly)

Also, when mounted, my mount will do his attack with me, like that roaring up attacking, it looks strange because the player will sit in mounted position and the animal will raise it's front legs through the character (I'm on a chimera)

I would like to know how I can control the animations, I don't mind if I have to define a script for every weapon, and I'm not sure how 'hard coded' the animations are to each item, but if possible could I make the player do the idle animation while attacking? (Not that i'd ever want to, just as an example I want to know if I can have that sort of freedom with the animations)

Thanks

Re: Attack Anims

Posted: Mon Jan 11, 2010 6:55 am
by Tomi
simply dont let the core handle your combat and make your own animation functions for it.

something like this ( some old code I had )

Code: Select all

function PlayAnims( byref attacker, byref defender, byref damaged )

	if ( attacker.IsA( POLCLASS_NPC ) )
		var attack_anim := SplitWords( NPC_CFG[attacker.npctemplate].AnimArray );
		if ( attack_anim )
			PerformAction( attacker, CInt( attack_anim[RandomInt( attack_anim.size(  ) ) + 1] ) );
		else
			BroadCastU( "Missing Attack Animation." + attacker.npctemplate );
		endif
	else
		var anim := SplitWords( WEAPON_CFG[attacker.weapon.objtype].AnimArray );
		if ( anim )
			PerformAction( attacker, CInt( anim[RandomInt( anim.size(  ) ) + 1] ) );
		else
			BroadCastU( "Missing Weapon Animation." + attacker.weapon.objtype );
		endif
	endif

	if ( defender.IsA( POLCLASS_NPC ) )
		if ( damaged )
			var damaged_anim := NPC_CFG[defender.npctemplate].DamagedAnim;
			if ( damaged_anim )
				PerformAction( defender, damaged_anim );
			else
				BroadCastU( "Missing Damaged Animation." + defender.npctemplate );
			endif
		endif
	endif

endfunction

Re: Attack Anims

Posted: Mon Jan 11, 2010 9:42 am
by Edak
Thanks Tomi, No doubt it has to be something that obvious but I couldn't figure it out.

Re: Attack Anims

Posted: Mon Jan 11, 2010 10:16 am
by Turley
why not simply change in your itemdesc Anim & MountedAnim entry for the weapons?

Re: Attack Anims

Posted: Mon Jan 11, 2010 10:42 am
by Edak
Haha I tried that Turley but it just dawned on me that hex value is relative to the animation inside the animation, so to speak. I was replacing it with the animation as a whole (937 or 0x3A9 for the crescent blade)

What about the mount attacking also?

And a little off topic, but my debug file shows my server looking for npcdesc.cfg in ever folder, it claims it doesn't exist, and it does this for each folder without npcdesc in it. Any ideas?

Thanks

Re: Attack Anims

Posted: Mon Jan 11, 2010 10:49 am
by Edak
That worked, it also fixed the issue with the mount animation attacking too. Thanks!