Attack Anims

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.
Post Reply
Edak
New User
Posts: 4
Joined: Sun Jan 10, 2010 11:35 pm

Attack Anims

Post 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
Tomi
POL Developer
Posts: 478
Joined: Tue Feb 21, 2006 5:08 pm

Re: Attack Anims

Post 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
Edak
New User
Posts: 4
Joined: Sun Jan 10, 2010 11:35 pm

Re: Attack Anims

Post by Edak »

Thanks Tomi, No doubt it has to be something that obvious but I couldn't figure it out.
Turley
POL Developer
Posts: 670
Joined: Sun Feb 05, 2006 4:45 am

Re: Attack Anims

Post by Turley »

why not simply change in your itemdesc Anim & MountedAnim entry for the weapons?
Edak
New User
Posts: 4
Joined: Sun Jan 10, 2010 11:35 pm

Re: Attack Anims

Post 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
Edak
New User
Posts: 4
Joined: Sun Jan 10, 2010 11:35 pm

Re: Attack Anims

Post by Edak »

That worked, it also fixed the issue with the mount animation attacking too. Thanks!
Post Reply