Weapon Deploy time (CSS)

Is there a way I can stop CSS weapon deploy animations from being so fast?

Decompile the view model and change the fps value ( under ACT_VM_RELOAD ) in the mdldecompiler.qc file

10-35 is slow, 36 is normal, 37-52 is fast
between those

No, its for my server. The models are fine but the SWEPs are just not deploying properly. There really fast. Other CSS sweps are fine.

[editline]13th September 2013[/editline]

Thanks for the help though

Change the playback rate after you call the animation:

[lua]local _duration = self.Weapon:SequenceDuration( );
self.Owner:GetViewModel():SetPlaybackRate( _duration * 0.25 )[/lua]

Its only when deploying (cocking the gun on deploy) shooting and reloading is fine.

So after you call the deploy animation, or OnDeploy, get the duration of that deploy animation and slow it down?

This is confusing, how would I do this with this code? SequenceDuration(“OnDeploy”)

In the SWEP base:

[lua]–[[---------------------------------------------------------
Name: SWEP:Deploy( )
Desc: Whip it out
-----------------------------------------------------------]]
function SWEP:Deploy()
local _anim = ACT_VM_DRAW;
if ( self:GetSuppressed( ) ) then
_anim = ACT_VM_DRAW_SILENCED;
end
self.Weapon:SendWeaponAnim( _anim )

// Slows down the deploy animation
local _duration = self:SequenceDuration( );
self.Owner:GetViewModel():SetPlaybackRate( _duration * 0.25 )

return true

end[/lua]

Tested and it works. It will slow the deploy animation down using those 2 lines of code.

There’s no need to do that, you could simply use self:SetDeploySpeed(1) in the shared initialize hook.

[editline]13th September 2013[/editline]

Just in case you’re wondering, it’s defined in weapon_base/shared.lua, line 295

Thanks Jvs and also thank you Acecool. You have spent some time helping me. Put yours give errors Acecool:




[ERROR] gamemodes/jailbreak/entities/weapons/weapon_cs_base/shared.lua:94: attempt to call method 'GetSuppressed' (a nil value)
  1. unknown - gamemodes/jailbreak/entities/weapons/weapon_cs_base/shared.lua:94