Five Elite Mercenaries are send to an Island in middle of the 1980'. The Task: Find and Eliminate a local Drug Baron. Features: new Physic, real Sunmovement, Day/Night Change, Hunger/Food system, realistic (!) Weather system, Light/Dark viewing system for AI, 5 different Fractions on the Island. Complete Realistic simulation of nearly all things, including Sleep. New weapons, new Vehicles. Vehicles driving system is now exact (!) like GTA IV , FireSystem,... this mod is Heavily inspired by GTA, IGI, FarCry.

Forum Thread
  Posts  
switching off dynamic weaponshake in devkit (Games : Far Cry : Mods : FarCry Operation Clearing : Forum : Technical Discussion for OP CL Devkit : switching off dynamic weaponshake in devkit) Locked
Thread Options
pvcf
pvcf Germany
May 17 2014 Anchor

if you dont need dynamic weaponshake or dynamic weapon take down during sprinting, for example because you have
own weaponanimations for, then read that:

you can switch off the weaponSHAKE by sprinting in weaponsparams.lua for each wpn by the
DynamicWeaponShake = 1, --pvcf-- we inject dynamic weapon bob roll depending on movement speed
HighWeaponShake = 0, --pvcf 0 = lower values than normal, = 1 or no entry means high shake

if DynamicWeaponShake is NOT existent or set to 0, the weapon will only do the standart p_bobrol for shake(search in BasicWeapon.lua for

	else
		p_bob_weapon = 0.006;
		--bob_pitch=0.015;  --standart ist 0.015

the 0.006 is then the standart used wpn shake.

for taking down the wpn during running search in basicweapon.lua that part

			if not shooter.fireparams.holdingoffset then
				if (not _localplayer.cnt.running ) then					
					local x = 0; local y = 0; local z = 0;
					BasicWeapon:DoWeaponOffset(x,y,z,ax,ay,az);
					--Hud:AddMessage("$2 1 ",2);
				end
			else
				if (not _localplayer.cnt.running ) then
					--Hud:AddMessage("$4 2 ",2);
					local x = shooter.fireparams.holdingoffset.x;
					local y = shooter.fireparams.holdingoffset.y;
					local z = shooter.fireparams.holdingoffset.z;								
					BasicWeapon:DoWeaponOffset(x,y,z,ax,ay,az);
				end
			end

and change it to

			if not shooter.fireparams.holdingoffset then
				--if (not _localplayer.cnt.running ) then					
					local x = 0; local y = 0; local z = 0;
					BasicWeapon:DoWeaponOffset(x,y,z,ax,ay,az);
					--Hud:AddMessage("$2 1 ",2);
				--end
			else
				--if (not _localplayer.cnt.running ) then
					--Hud:AddMessage("$4 2 ",2);
					local x = shooter.fireparams.holdingoffset.x;
					local y = shooter.fireparams.holdingoffset.y;
					local z = shooter.fireparams.holdingoffset.z;								
					BasicWeapon:DoWeaponOffset(x,y,z,ax,ay,az);
				--end
			end

now the running condition which forces a different holdingoffset is switched off and weapon is always in the holdingoffset which is defined in WeaponParams.lua in each weapon with

holdingoffset = {x=0.02,y=-0.05,z=-0.04}, --position offset in non zoom mode
holdingoffset = { --position offset in non zoom mode
x=0.0, --horizontal offset

y=0.09, --holding distance offset

z=-0.04 --vertical offset
},
holdingoffsetangle = {x=-10,y=0,z=0}, --pvcf angle offset in non zoom mode (experimental, do not use! )
and during aiming:
aim_offset={x=0.11,y=0.09,z=0.04}, --position offset in zoom mode
aim_offsetAngle={x=0.0,y=0.0,z=0.0}, --pvcf angle change in zoom mode

in Hud.lua search for that line:

if (Hud.put_wpn_down_Sprinting) then

and change it to

Hud.put_wpn_down_Sprinting = nil;
if (Hud.put_wpn_down_Sprinting) then

now the weapon is stable all the time and ready for your custom animations, note that now also the sprinting recognition is still availible with
_localplayer.cnt.sprinting

Edited by: pvcf

Reply to thread
click to sign in and post

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.