New player animations for sword

I am doing entirely new player animations for a sword i am making. Can someone please tell me what anims i need to make it complete? I already have the idle one.
You see, i decompiled the male_anims.mdl, and there’s ones like run_mod, look up, look left, etc. So could someone please clarify what i need to do?
Also, if you know how to actually integrate them into gmod, please let me know.
You can use this to just code the animations with lua rather than compiling them into the player model (only other way to get them in gmod).

There is already a sword animation.
I don’t know if it will help you.

SWEP.HoldType = “sword”

local ActIndex = {}
ActIndex[“pistol”] = ACT_HL2MP_IDLE_PISTOL
ActIndex[“smg”] = ACT_HL2MP_IDLE_SMG1
ActIndex[“grenade”] = ACT_HL2MP_IDLE_GRENADE
ActIndex[“ar2”] = ACT_HL2MP_IDLE_AR2
ActIndex[“shotgun”] = ACT_HL2MP_IDLE_SHOTGUN
ActIndex[“rpg”] = ACT_HL2MP_IDLE_RPG
ActIndex[“physgun”] = ACT_HL2MP_IDLE_PHYSGUN
ActIndex[“crossbow”] = ACT_HL2MP_IDLE_CROSSBOW
ActIndex[“melee”] = ACT_HL2MP_IDLE_MELEE
ActIndex[“slam”] = ACT_HL2MP_IDLE_SLAM
ActIndex[“normal”] = ACT_HL2MP_IDLE
ActIndex[“sword”] = ACT_HL2MP_IDLE_MELEE2

Name: SWEP:SetWeaponHoldType()
Desc: Sets up the translation table, to translate from normal
standing idle pose, to holding weapon pose.
function SWEP:SetWeaponHoldType(t)

local index = ActIndex[t]

if (index == nil) then
	Msg("SWEP:SetWeaponHoldType - ActIndex[ \""..t.."\" ] isn't set!


self.ActivityTranslate = {}
self.ActivityTranslate [ACT_HL2MP_IDLE] 					= index
self.ActivityTranslate [ACT_HL2MP_WALK] 					= index + 1
self.ActivityTranslate [ACT_HL2MP_RUN] 					= index + 2
self.ActivityTranslate [ACT_HL2MP_IDLE_CROUCH] 				= index + 3
self.ActivityTranslate [ACT_HL2MP_WALK_CROUCH] 				= index + 4
self.ActivityTranslate [ACT_HL2MP_GESTURE_RANGE_ATTACK] 		= index + 5
self.ActivityTranslate [ACT_HL2MP_GESTURE_RELOAD] 			= index + 6
self.ActivityTranslate [ACT_HL2MP_JUMP] 					= index + 7
self.ActivityTranslate [ACT_RANGE_ATTACK1] 				= index + 8



Name: SWEP:TranslateActivity()
Desc: Translate a player’s activity into a weapon’s activity.
So for example, ACT_HL2MP_RUN becomes ACT_HL2MP_RUN_PISTOL
depending on how you want the player to be holding the weapon.
function SWEP:TranslateActivity(act)

if (self.Owner:IsNPC()) then
	if (self.ActivityTranslateAI[act]) then
		return self.ActivityTranslateAI[act]

	return -1

if (self.ActivityTranslate[act] != nil) then
	return self.ActivityTranslate[act]

return -1


Name: SWEP:Initialize()
Desc: Called when the weapon is first loaded.
function SWEP:Initialize()

if (SERVER) then


Have a screenshot of that?

If you’ve played Oblivion, picture how an npc looks when holding a two handed melee weapon. It looks pretty much like that.

The hands are close together and the weapon is held due-forward, close to the body. The swing is like using a maul or something similar such as a big hammer.

Look, i don’t want some silly garry’s mod animation. I’m an animator. I make my own animations. So i want to be able to use those ones, rather than the ones that come with garry’s mod.
I appreciate your help, guys, but… it doesn’t really help.
So, any suggestions? CUSTOM animations, remember :wink:

Custom animations are a bit more difficult than they look.

Make a seperate model and let the player switch to that one whne he equips your swep!

Actually the Lua animations API would be perfect for this.

I never try to use the Lua animations API. Is it easy to use?

If you want actual help for making model animations you should go ask in the modeling section. We don’t have a clue. :buddy:

Hm. I thought it was more of a scripting question…

But Grea$emonkey. Saying “it’s more difficult than it looks” does not help one iota. I don’t care if it’s difficult, i just want to do it. So please… :stuck_out_tongue:

Then it’s a model scripting question, this forum deals exclusively with lua. :wink: Last time I checked you don’t need lua to compile animations into a model, no lua script is going to help you there.

So for qc files and all that stuff, definitely, ask in modeling.

Ok, many thanks.