Title says it all really. I think it's because of the new GMod update, but I'm not sure. All the animations are in a "T" shape, and it's fuck annoying.
Anyone know how to fix this?
Yes, what's your steam profile, I'll add you and fix it.
What, you'll send me the fix?
I'll fix it for you, what's your steam profile.
Couldn't you just tell me here? I know it's completly rediculous but it sounds like you want to hack me...
Seriously, just post if you know what the problem is here.
It may be problem with the models if they're in t-pose, if not try changing all the sweps to shared animations.
Oh, and if the players don't have a swep equipped it will do that too.
I'm using the standard HL2 citizen models, and if changing them to shared animation fixes them, how do I do that?
In all the SWEP files in the entities/weapons folder.
Find SWEP.HoldType and make sure it is shared (server and client).
Just take it out of any "if SERVER then" statement.
Found this in the hands/shared.lua . This looks different. Anything I should be doing here?
[PHP]
function SWEP:Initialize()
if (CLIENT) then return end
self:SetWeaponHoldType("normal")
end
[/PHP]
I reckon i should remove that...
[php]
if (CLIENT) then return end
[/php]
...part right above.
Take out the "if (CLIENT) then return end".
Nope, still didn't work.
I'm pretty sure that animations.lua was outdated and a new version was posted on facepunch not so long ago. The cakescript's current animations.lua doesn't work because it uses old functions, there was new animation hooks added in a update before.
The recent update scrambled _E or the enumeration table, which is what the NPC Animations script uses. You need to find new values for each animation.
Make animations.lua and animation_tables.lua shared.
[QUOTE=Disseminate;23291081]The recent update scrambled _E or the enumeration table, which is what the NPC Animations script uses. You need to find new values for each animation.[/QUOTE]
Typical I don't know the values, or what they represent. lol
[QUOTE=Freze;23300693]Make animations.lua and animation_tables.lua shared.[/QUOTE]
I'll try that, but from the other quote above, doesn't look like that's the case.
EDIT:
Nope. :(
Who knows what those values are?
A-hah! Is this the solution?:
[url]http://www.facepunch.com/showthread.php?t=936054[/url]
-snip-
Can anyone see where I'm going wrong here?
Citizen animations are fine.
Metro-police animations are a bit dodgey.
Combine animations are... well... fucked up.
I'm testing this in singleplayer. Do I need a server to test it correctly?
[code]
--Hey hey hey! It's fucking NPC animations version three! This time with no Rick Dark shit.
--Credits to Azuisleet ( Original hook ), Entoros( Holdtype thing ), and well, me, Big Bang/F-Nox ( everything else )
--Override! Thanks Entoros!
function _R.Weapon:GetHoldType()
if self.HoldType then
return tostring( self.HoldType )
end
return "default"
end
--Weapons that are always aimed
local AlwaysAimed =
{
"weapon_physgun",
"weapon_physcannon",
"weapon_frag",
"weapon_slam",
"weapon_rpg",
"gmod_tool"
}
--Weapons that are never aimed
local NeverAimed =
{
"hands"
}
function MakeUnAim( ply )
if ValidEntity( ply:GetActiveWeapon() ) then
if( !ply:GetActiveWeapon():GetDTBool( 1 ) and !table.HasValue( AlwaysAimed, ply:GetActiveWeapon():GetClass()) ) then
ply:SetNWBool( "aiming", false )
--ply:GetActiveWeapon():SendWeaponAnim( ACT_VM_HOLSTER )
if SERVER then
ply:DrawViewModel( false )
end
if( ply:GetActiveWeapon():IsValid() ) then
ply:GetActiveWeapon():SetNWBool( "NPCAimed", false );
end
else
MakeAim( ply )
end
end
end
function MakeAim( ply )
if ValidEntity( ply:GetActiveWeapon() ) then
if !table.HasValue( NeverAimed, ply:GetActiveWeapon():GetClass() ) then
ply:SetNWBool( "aiming", true )
if SERVER then
ply:DrawViewModel( true )
end
--ply:GetActiveWeapon():SendWeaponAnim( ACT_VM_DRAW )
ply:GetActiveWeapon():SetNWBool( "NPCAimed", true );
end
end
end
local function HolsterToggle( ply )
if( not ply:GetActiveWeapon():IsValid() ) then
return;
end
if( !ply:GetNWBool( "aiming", false ) ) then
MakeAim( ply );
ply:SetNWBool( "forceaim", true )
else
MakeUnAim( ply );
ply:SetNWBool( "forceaim", false )
end
end
concommand.Add( "rp_toggleholster", HolsterToggle );
concommand.Add( "toggleholster", HolsterToggle );
local function NPCWeaponHook( ply, key )
if key == IN_ATTACK or key == IN_ATTACK2 then
MakeAim( ply )
timer.Create( ply:Nick() .. "weaponholster", 4, 1, function()
if !ply:GetNWBool( "forceaim", false ) then
if !ply:GetActiveWeapon():SetNWBool( "NPCAimed", false ) then
MakeUnAim( ply )
end
end
end)
else
if( !timer.IsTimer( ply:Nick() .. "weaponholster" ) ) then
timer.Create( ply:Nick() .. "weaponholster", 4, 1, function()
if !ply:GetNWBool( "forceaim", false ) then
if ply:GetActiveWeapon():IsValid() then
if !ply:GetActiveWeapon():SetNWBool( "NPCAimed", false ) then
MakeUnAim( ply )
end
end
end
end)
end
end
if key == IN_RUN then
MakeUnAim( ply )
end
end
hook.Add( "KeyPress", "NPCWeaponHook", NPCWeaponHook )
local Anims = {}
Anims.Male = {}
Anims.Male[ "models" ] = {
"models/barney.mdl",
"models/eli.mdl",
"models/breen.mdl",
"models/Gustavio/maleanimtree.mdl",
"models/kleiner.mdl"
}
Anims.Male[ "default" ] = {
[ "idle" ] = "ACT_IDLE",
[ "walk" ] = "ACT_WALK",
[ "run" ] = "ACT_RUN",
[ "jump" ] = "ACT_JUMP",
[ "land" ] = "ACT_LAND",
[ "fly" ] = "ACT_GLIDE",
[ "sit" ] = "ACT_BUSY_SIT_CHAIR",
[ "sitground" ] = "ACT_BUSY_SIT_GROUND",
[ "flinch" ] = {
["explosion"] = "ACT_GESTURE_FLINCH_BLAST"
},
[ "crouch" ] = {
[ "idle" ] = "ACT_COVER_LOW",
[ "walk" ] = "ACT_WALK_CROUCH",
[ "aimidle" ] = "ACT_RANGE_AIM_SMG1_LOW",
[ "aimwalk" ] = "ACT_WALK_CROUCH_AIM_RIFLE"
},
[ "aim" ] = {
[ "idle" ] = "ACT_IDLE_AIM_RIFLE_STIMULATED",
[ "walk" ] = "ACT_WALK_AIM_RIFLE_STIMULATED",
[ "run" ] = "ACT_RUN_AIM_RIFLE_STIMULATED"
}
}
Anims.Male[ "pistol" ] = {
[ "idle" ] = "ACT_IDLE",
[ "walk" ] = "ACT_WALK",
[ "run" ] = "ACT_RUN",
[ "crouch" ] = {
[ "idle" ] = "ACT_COVER_LOW",
[ "walk" ] = "ACT_WALK_CROUCH",
[ "aimidle" ] = "ACT_RANGE_AIM_SMG1_LOW",
[ "aimwalk" ] = "ACT_WALK_CROUCH_AIM_RIFLE"
},
[ "aim" ] = {
[ "idle" ] = "ACT_IDLE_AIM_RIFLE_STIMULATED",
[ "walk" ] = "ACT_WALK_AIM_RIFLE_STIMULATED",
[ "run" ] = "ACT_RUN_AIM_RIFLE_STIMULATED"
},
["fire"] = "ACT_GESTURE_RANGE_ATTACK_SMG1"
}
Anims.Male[ "rifle" ] = {
[ "idle" ] = "ACT_IDLE_SMG1_RELAXED",
[ "walk" ] = "ACT_WALK_RIFLE_RELAXED",
[ "run" ] = "ACT_RUN_RIFLE_RELAXED",
[ "crouch" ] = {
[ "idle" ] = "ACT_COVER_LOW",
[ "walk" ] = "ACT_WALK_CROUCH_RIFLE",
[ "aimidle" ] = "ACT_RANGE_AIM_SMG1_LOW",
[ "aimwalk" ] = "ACT_WALK_CROUCH_AIM_RIFLE"
},
[ "aim" ] = {
[ "idle" ] = "ACT_IDLE_AIM_RIFLE_STIMULATED",
[ "walk" ] = "ACT_WALK_AIM_RIFLE_STIMULATED",
[ "run" ] = "ACT_RUN_AIM_RIFLE_STIMULATED"
},
["fire"] = "ACT_GESTURE_RANGE_ATTACK_SMG1"
}
Anims.Male[ "melee" ] = {
[ "idle" ] = "ACT_IDLE",
[ "walk" ] = "ACT_WALK",
[ "run" ] = "ACT_RUN",
[ "crouch" ] = {
[ "idle" ] = "ACT_COVER_LOW",
[ "walk" ] = "ACT_WALK_CROUCH",
[ "aimidle" ] = "ACT_COWER",
[ "aimwalk" ] = "ACT_WALK_CROUCH_RIFLE"
},
[ "aim" ] = {
[ "idle" ] = "ACT_IDLE",
[ "walk" ] = "ACT_WALK_AIM_RIFLE",
[ "run" ] = "ACT_SPRINT"
},
["fire"] = "ACT_MELEE_ATTACK_SWING"
}
Anims.Male[ "grenade" ] = {
[ "idle" ] = "ACT_IDLE",
[ "walk" ] = "ACT_WALK",
[ "run" ] = "ACT_RUN",
[ "crouch" ] = {
[ "idle" ] = "ACT_COVER_LOW",
[ "walk" ] = "ACT_WALK_CROUCH",
[ "aimidle" ] = "ACT_COVER_LOW",
[ "aimwalk" ] = "ACT_WALK_CROUCH"
},
[ "aim" ] = {
[ "idle" ] = "ACT_IDLE",
[ "walk" ] = "ACT_WALK",
[ "run" ] = "ACT_RUN"
}
}
Anims.Female = {}
Anims.Female[ "models" ] = {
"models/alyx.mdl",
"models/Gustavio/femaleanimtree.mdl"
}
Anims.Female[ "default" ] = {
[ "idle" ] = "ACT_IDLE",
[ "walk" ] = "ACT_WALK",
[ "run" ] = "ACT_RUN",
[ "jump" ] = "ACT_JUMP",
[ "land" ] = "ACT_LAND",
[ "fly" ] = "ACT_GLIDE",
[ "sit" ] = "ACT_BUSY_SIT_CHAIR",
[ "sitground" ] = "ACT_BUSY_SIT_GROUND",
[ "flinch" ] = {
["explosion"] = "ACT_GESTURE_FLINCH_BLAST"
},
[ "crouch" ] = {
[ "idle" ] = "ACT_COVER_LOW",
[ "walk" ] = "ACT_WALK_CROUCH",
[ "aimidle" ] = "ACT_RANGE_AIM_SMG1_LOW",
[ "aimwalk" ] = "ACT_WALK_CROUCH_AIM_RIFLE"
},
[ "aim" ] = {
[ "idle" ] = "ACT_IDLE",
[ "walk" ] = "ACT_WALK_AIM_RIFLE",
[ "run" ] = "ACT_SPRINT"
}
}
Anims.Female[ "pistol" ] = {
[ "idle" ] = "ACT_IDLE",
[ "walk" ] = "ACT_WALK",
[ "run" ] = "ACT_RUN",
[ "crouch" ] = {
[ "idle" ] = "ACT_COVER_LOW",
[ "walk" ] = "ACT_WALK_CROUCH",
[ "aimidle" ] = "ACT_RANGE_AIM_SMG1_LOW",
[ "aimwalk" ] = "ACT_WALK_CROUCH_AIM_RIFLE"
},
[ "aim" ] = {
[ "idle" ] = "ACT_IDLE_AIM_RIFLE_STIMULATED",
[ "walk" ] = "ACT_WALK_AIM_RIFLE_STIMULATED",
[ "run" ] = "ACT_RUN_AIM_RIFLE_STIMULATED"
},
[ "reload" ] = "ACT_GESTURE_RELOAD_SMG1",
["fire"] = "ACT_GESTURE_RANGE_ATTACK_SMG1"
}
Anims.Female[ "rifle" ] = {
[ "idle" ] = "ACT_IDL
So did somone solve this problem ?
Yeah.. In July.
Sorry, you need to Log In to post a reply to this thread.