Jump to content
eggbeast

weapon zeroing function - how does it actually work?

Recommended Posts

I'm wondering exactly how the weapon zeroing (non marksman dlc - just default) works...

 

so here is our mosin rifle data

//AMMO
	class uns_riflebullet_base: Uns_BulletBase
	{
		hit = 8;
		indirectHit = 0;
		indirectHitRange = 0;
		cost = 1;
		typicalSpeed = 920;
		airFriction = -0.0012;
		waterFriction = -0.3;
		caliber = 0.7;
		deflecting = 20;
		model = "\A3\Weapons_f\Data\bullettracer\tracer_red";
		cartridge = "FxCartridge_762";
		tracerScale = 1;
		tracerStartTime = 0.05;
		tracerEndTime = 1;
		visibleFire = 6;
		audibleFire = 9;
		dangerRadiusBulletClose = 8;
		dangerRadiusHit = 12;
		suppressionRadiusBulletClose = 6;
		suppressionRadiusHit = 8;
		nvgOnly = 0;
		class CamShakeExplode
		{
			power = "(5^0.5)";
			duration = "((round (5^0.5))*0.2 max 0.2)";
			frequency = 20;
			distance = "((5^0.5)*3)";
		};
		class CamShakeHit
		{
			power = 5;
			duration = "((round (5^0.25))*0.2 max 0.2)";
			frequency = 20;
			distance = 1;
		};
	};
	class uns_762x54_Russian: uns_riflebullet_base
	{
		hit = 12;
		airLock = 1;
		model = "\A3\Weapons_f\Data\bullettracer\tracer_green";
		tracerScale = 1.2;
		tracerStartTime = 0.075;
		tracerEndTime = 1;
		airFriction = -0.00096;
		typicalspeed = 830;
	};

//MAGS
	class uns_mosinmag: uns_Riflemag_base
	{
		scope = 2; scopeArsenal = 2;
		displayName = "5Rnd. Mosin Nagant Clip";
		model = "\uns_weap_e\sks\uns_sksmag.p3d";
		picture = "\uns_weap_e\mosin\ico\m_mosin.paa";
		count = 5;
		mass = 4;
		ammo = "uns_762x54_Russian";
		initSpeed = 808;
		descriptionShort = "5Rnd. Mosin Nagant Clip. Calibre: 7.62x54mm Russian. Used in Mosin Nagant rifle.";
	};
SCOPE
	class uns_o_PU: uns_o_PSO1
	{
		scope = 2; scopeArsenal = 2;
		displayName = "Scope (PU 3.5x) [Mosin]";
		descriptionShort = "Scope (PU 3.5x) [Mosin]";
		picture = "\uns_weap_w\a_Optic\ico\uns_o_PU_ca.paa";
		model = "\uns_weap_w\a_Optic\PU3x_mosin\o_PU";
		inertia = 0.1;
		class ItemInfo: ItemInfo
		{
                       opticType = 1;
                       optics = 1;
			mass = 6;
//			modelOptics = "\uns_weap_w\a_optic\PSO1_SVD\optika_snpiere.p3d";
			modelOptics = "\uns_weap_w\a_optic\PU3x_mosin\PU_scope.p3d";//debinned PETE
			class OpticsModes: OpticsModes
			{
				class scope: scope 
				{
                                     opticsID = 1;
                                     useModelOptics = 1;
                                     opticsDisablePeripherialVision = 1;
                                     opticsFlare = 1;
                                     memoryPointCamera = "opticView";
                                     visionMode[] = {"Normal"};
                                     cameraDir = "";
                                    opticsZoomInit = 0.0623;
                                    opticsZoomMin = 0.0623;
                                    opticsZoomMax = 0.0623;
                                    distanceZoomMin = 200;
                                    distanceZoomMax = 200;
                                    opticsPPEffects[] = {"OpticsCHAbera3","OpticsBlur3"};
                                    weaponInfoType = "RscWeaponZeroing";
                                    discreteDistance[] = {100,200,300,400,500,600,700,800,900,1000,1100,1200};
                                    discreteDistanceInitIndex = 0;
                                };
                                class Ironsights: Ironsights
                                {
                                   opticsID = 2;
                                   useModelOptics = 0;
                                   opticsFlare = 0;
                                   opticsDisablePeripherialVision = 0;
                                   opticsZoomMin = 0.25;
                                   opticsZoomMax = 1.1;
                                   opticsZoomInit = 0.5;
                                   memoryPointCamera = "eye_overscope";
                                   visionMode[] = {};
                                    weaponInfoType = "RscWeaponZeroing";
                                    discreteDistance[] = {100,200,300,400,500,600,700,800,900,1000,1100,1200};
                                    discreteDistanceInitIndex = 0;
                                };
   			};
		};
	};		
WEAPON
    class Uns_Rifle762: Uns_Rifle
    {
        scope = 0;
        weaponInfoType = "RscWeaponZeroing";
        discreteDistance[] = {100,200,300,400,500,600,700,800,900,1000};
        discreteDistanceInitIndex = 0;
        maxZeroing = 1000;
        distanceZoomMin = 300;
        distanceZoomMax = 300;
        UiPicture = "\uns_men_c\icon\UStroops\i_regular_CA.paa";
        recoil = "uns_recoil_m14";
        reloadAction = "GestureReloadDMR";
        magazineReloadTime = 4;
        cursor = "srifle";
        inertia = 0.5;
        dexterity = 1.5;
        initSpeed = 850;
//etc
    };
	class uns_mosin: Uns_Rifle762
	{
		scope = 2; scopeArsenal = 2;
		displayName = "Mosin Nagant";
		model = "\uns_weap_e\mosin\uns_mosin";
		picture = "\uns_weap_e\mosin\ico\w_mosin.paa";
		handanim[] = {"OFP2_ManSkeleton","\uns_weap_a\bis\LeeEnfield.rtm"};
		magazines[] = {"uns_mosinmag","uns_mosinmag_T"};
		dexterity = 1.6;
		magazineReloadTime = 3.0;
		initSpeed = 800;
		recoil = "uns_recoil_fusil";
		descriptionShort = "Mosin Nagant 5-shot, clip-fed, 7.62x54mm Rifle";
		class WeaponSlotsInfo: WeaponSlotsInfo
		{
			mass = 110;
			class MuzzleSlot{};
			class CowsSlot: CowsSlot
			{
				compatibleItems[] = {"uns_o_PU"};
				iconPosition[] = {0.45,0.38};
				iconScale = 0.2;
			};
			class PointerSlot {};
		};
//sounds to do
		drySound[] = {"\uns_weap_s\mosin\mosin_dry",1,1,10};
		reloadMagazineSound[] = {"\uns_weap_s\mosin\mosin_reload",1,1,25};
		modes[] = {"Single","AImode1","AImode2"};
		class Single: Single
		{
			sounds[] = {"StandardSound"};
			class StandardSound: StandardSound
			{
				begin1[] = {"\uns_weap_s\mosin\mosin_fire",1,0.99,600};
				begin2[] = {"\uns_weap_s\mosin\mosin_fire",1,1,600};
				soundBegin[] = {"begin1",0.5,"begin2",0.5};
			};
			reloadTime = 2.2;
			recoil = "recoil_single_primary_7outof10";
			recoilProne = "recoil_single_primary_prone_6outof10";
			dispersion = 0.003;
			minRange = 0;
			minRangeProbab = 0.001;
			midRange = 0;
			midRangeProbab = 0.001;
			maxRange = 0;
			maxRangeProbab = 0.001;
			aiRateOfFire = 0;
		};
		class AImode1: Single
		{
			reloadTime = 2.2;
			recoil = "recoil_single_primary_7outof10";
			recoilProne = "recoil_single_primary_prone_6outof10";
			burst = 0;
			aiDispersionCoefY = 1.0;
			aiDispersionCoefX = 1.0;
			dispersion = 0.012;
			minRange = 0.1;
			minRangeProbab = 0.6;
			midRange = 30;
			midRangeProbab = 0.7;
			maxRange = 70;
			maxRangeProbab = 0.2;
			showToPlayer = 0;
			aiRateOfFire = 1.5;
			aiRateOfFireDistance = 60;
		};
		class AImode2: AImode1
		{
			reloadTime = 2.2;
			recoil = "recoil_single_primary_7outof10";
			recoilProne = "recoil_single_primary_prone_6outof10";
			burst = 0;
			aiDispersionCoefY = 1.0;
			aiDispersionCoefX = 1.0;
			dispersion = 0.012;
			minRange = 50;
			minRangeProbab = 0.5;
			midRange = 250;
			midRangeProbab = 0.7;
			maxRange = 500;
			maxRangeProbab = 0.2;
			aiRateOfFire = 9;
			showToPlayer = 0;
			aiRateOfFireDistance = 180;
		};
	};

so we have a rifle that can be zeroed up to 1000m in 100m increments.

With the PU scope it can be zeroed out to 1200m.

 

here is the memory lod for the weapon (the opticview point for the scope is in the scope model, not the weapon model)

rifle1_zps3s2qxruc.jpg

 

 

scope memory points

- in this case the overscope point lines up perfectly in the ironsights below the scope

- we use opticView to look through the scope, and eye_overscope to use CQB alt-optics

puscope1_zps5pn2big9.jpg

so, when i press pageup or pagedown, this moves the index value up and down in the zeroing array below

        discreteDistance[] = {100,200,300,400,500,600,700,800,900,1000};
        discreteDistanceInitIndex = 0; //starts at 100m

 

but what exactly does it do to my bullet / model / memory point for chamber? etc etc

I understand the principle of zeroing in real weaponry.

 

can anyone help explain how this works in the game engine?

 

the problem i am having is that the mosin above is zeroing perfectly in ironsights but

with the scope on you must zero it to 1000m in order to hit a target 100m away!!

Share this post


Link to post
Share on other sites

AFAIK it doesn't do anything physically to the model. Zeroing just applies an angle to the simulated bullet when it spawns at the chamber memory point.

The angle applied to the bullet is calculated by the engine so that the round's ballistic curve will cross the plane of the eye memory point at X meters away from the player, where X is the selected zero range.

Share this post


Link to post
Share on other sites

AFAIK it doesn't do anything physically to the model. Zeroing just applies an angle to the simulated bullet when it spawns at the chamber memory point.

I can confirm that. However, if you define different eye memorypoints for different range settings (like used for vanilla GL sights), you actually have to adjust the eye position and sight model to be properly zeroed in case of missile launchers. Idk if guns/grenadelaunchers behave different in that regard, havent made a gun with ladder sight yet.

Share this post


Link to post
Share on other sites

[...] you actually have to adjust the eye position and sight model to be properly zeroed in case of missile launchers. Idk if guns/grenadelaunchers behave different in that regard, havent made a gun with ladder sight yet.

I can confirm its the same for GL ladder sights.

Share this post


Link to post
Share on other sites

yeah i've played around with the GL sights - i can make them animate up to 45 degrees but not up to 90, which is quite odd.

the BIS sample GL seems to have the optic points in the opposite order to what they should be, as the sight zeroes in reverse on my attempt at transplanting it to an m16/m203.  I would dearly love some guidance from somebody who has made this work, and hopefully a better template to work from!

 

my problem here though is the XM21 I edited works fine with ironsights and a scope - it zeroes correctly with both.

the mosin though, when you add a scope you have to zero it to 1000m to hit a 100m bullseye.

so im just really puzzled about this behaviour.

has anyone got any suggestions what might cause it? given all the pics above

Share this post


Link to post
Share on other sites

my problem here though is the XM21 I edited works fine with ironsights and a scope - it zeroes correctly with both.

the mosin though, when you add a scope you have to zero it to 1000m to hit a 100m bullseye.

so im just really puzzled about this behaviour.

has anyone got any suggestions what might cause it? given all the pics above

 

Have you tried to assign to XM21 the uns_mosinmag class or viceversa ( give the xm21 mag  class to mosin )  and see if it works fine? 

Don't solve your problem but you can understand if it's an ammo issue.

Share this post


Link to post
Share on other sites

good idea - i never even considered for a moment that the ammo was faulty.

 

my money is on the scope model properties being weird or something...

Share this post


Link to post
Share on other sites

good idea - i never even considered for a moment that the ammo was faulty.

 

my money is on the scope model properties being weird or something...

 

I usually use this class InventoryOpticsItem_Base_F to inherit properties for ItemInfo. 

You used ItemInfo itself... seems little strange..

 

InventoryOpticsItem_Base_F has this properties

type = 201;
muzzlePos = "usti hlavne";
muzzleEnd = "konec hlavne";
allowedSlots[] = {801,701,901};
mountAction = "MountOptic";
unmountAction = "DismountOptic";
Do you have those memory points in the mosin model?

Share this post


Link to post
Share on other sites

[...]

the BIS sample GL seems to have the optic points in the opposite order to what they should be, as the sight zeroes in reverse on my attempt at transplanting it to an m16/m203.  I would dearly love some guidance from somebody who has made this work, and hopefully a better template to work from!

[...]

 

Within the M203/UGL Muzzle define:

			cameraDir = "gl_look";
                        discreteDistance[] = {50, 100, 150, 200, 250, 300, 350};
			discreteDistanceCameraPoint[] = {"gl_eye_50m","gl_eye_100m","gl_eye_150m","gl_eye_200m","gl_eye_250m","gl_eye_300m","gl_eye_350m"};
			discreteDistanceInitIndex = 1; // 0 = 50m, 1 = 100m, 2 = 150m etc.

and then within the memory lod:

UGL_LadderSights.jpg

Share this post


Link to post
Share on other sites

thanks man i will give that a try

 

do you happen to have the model.cfg entries for animating the ladder sight?

cos mine flips up only 45 degrees across 4 zero indices

Share this post


Link to post
Share on other sites

how do you guys place the memory points for the ladder sights? I calculated the angle i have to aim up in order to hit something at a certain range and positioned the eye points accordingly. Yet ingame this does not match at all.

Share this post


Link to post
Share on other sites

thanks man i will give that a try

 

do you happen to have the model.cfg entries for animating the ladder sight?

cos mine flips up only 45 degrees across 4 zero indices

			class sight_gl_flip
			{
				type=rotation;
				source=weaponMuzzle;
				selection="sight_gl";
				axis="sight_gl_axis";
				memory=1;
				minValue=0.0;
				maxValue=0.40;
				angle0=(rad -90);
				angle1=(rad 0);
				angle2=(rad 90);
			};

how do you guys place the memory points for the ladder sights? I calculated the angle i have to aim up in order to hit something at a certain range and positioned the eye points accordingly. Yet ingame this does not match at all.

See my previous reply for an example.

Share this post


Link to post
Share on other sites

thanks jackal - we will try fixing our model! - angle2 huh? what the hell does angle2 do?

Share this post


Link to post
Share on other sites

thanks jackal - we will try fixing our model! - angle2 huh? what the hell does angle2 do?

Its basically a "reset angle" that the animation phase triggers when it is reversed (i.e. when you switch back to the rifle's muzzle). Otherwise the rotation would be triggered again, and rotate another 90 degrees in the same direction.

  • Like 1

Share this post


Link to post
Share on other sites

See my previous reply for an example.

I know how to place them. The impact point does not match with the sight however. I calculated and confirmed the elevation required for certain ranges. I placed eye mem's and adjusted the sight model accordingly. The impacts are off hwoever. That's the issue

Share this post


Link to post
Share on other sites

my issue is twofold

- the ladder doesnt animate up past 45 degrees, meaning i guess it is using sin or cos so that its max is 45.

- the eye points wander about behind the weapon and dont aim through the ladder - so i was hoping for a better understanding of how to manage the eye position so it "looks and feels right" rather than seeign a warped looking buttof the rifle, from all these fisheye lens kinda angles behind the weapon

Share this post


Link to post
Share on other sites

my issue is twofold

- the ladder doesnt animate up past 45 degrees, meaning i guess it is using sin or cos so that its max is 45.

- the eye points wander about behind the weapon and dont aim through the ladder - so i was hoping for a better understanding of how to manage the eye position so it "looks and feels right" rather than seeign a warped looking buttof the rifle, from all these fisheye lens kinda angles behind the weapon

I posted an example of the ladder sights from my L119A1s model.cfg earlier in the thread, check that out.

Try aligning the memory points to the "front" view (select the points, press 'P' and then select 'Front Plane' and click OK. Then simply line them all up on the Z Axis with the ladder sight.

  • Like 1

Share this post


Link to post
Share on other sites

ok necroing my own thread, as i'm still working through the grenade launcher animations. good to keep it all in one place for later use...

 

so, i'm trying to animate Rifle Grenades

 

like these:

m1_2_zpsq6ub62ud.jpg

 

mas_flare1_zpslfuxmrib.jpg

so we have:

muzzle 0 - bullets

muzzle 1 - grenade launcher

 

the model has these selections:

gl_adapter

gl_mag

 

1. now when i switch to grenade launcher (muzzle 1) i would like gl_adapter to unhide (source weaponMuzzle value 1?)

2. when i load a grenade magazine i would like the gl_mag to unhide (source reloadMagazine2 value 1?)

3. when i fire the grenade launcher i would like the gl_mag to hide (source hasmagazine2 - is this even a source?, or else hasmagazine, but this wont correlate to the right muzzle, i.e. the grenade will show up if a rifle mag is loaded - isempty maybe?)

4. when i switch muzzle i would like gl_adapter and gl_mag to unhide (source weaponMuzzle value 1?)

 

how can this be achieved in model animations?

 

i have been trying to get anything to hide on the weapon and so far no luck whatsoever. do i need animationsources listed i the cfgweapons entry?

 

example:

			class gl_magazine_hide
			{
				type="hide";
				source="weaponMuzzle";
				selection="gl_mag";
				minValue=0;
				maxValue=1;//2 //muzzle array position
				minPhase=0;
				maxPhase=1;
				hideValue=0;
				sourceAddress="mirror";
			};

sources:

https://community.bistudio.com/wiki/Model_Config

 

any help most appreciated.

 

looks like BI also think it is a hard nut to crack

https://dev.arma3.com/post/sitrep-00125

"This seems like a simple change that could have happened much sooner, but due to the way the special muzzle and magazines for grenade launchers are simulated, it required some creative implementation. We would also like to animate an actual grenade, but this faces yet more technical obstacles. We're prototyping a solution, but cannot yet guarantee it will be feasible."

 

some of toadie's weapons seem to have this set out like this:

	    class AG36_RL_hideround
            {
                type="hide";
		source = "reloadMagazine2";
                selection="ag36_round";
                animPeriod=0;
                minValue=0;
                maxValue=1; 
		hidevalue=0.3;
		unhidevalue=0.5538461538461538;
            };
	    class AG36_RL_warhead
            {
                type="hide";
		source = "reloadMagazine2";
                selection="ag36_warhead";
                animPeriod=0;
                minValue=0;
                maxValue=1; 
		hidevalue=0.0001;
		unhidevalue=0.5538461538461538;
            };

Share this post


Link to post
Share on other sites

ok so some of this now works...

the top two anims stop the nade from showing up at all, so i remmed them out for now.

 

now

- muzzle select hides the adapter, launcher and grenade correctly

- reload magazine in muzzle 1 (gl) now hides and unhides the grenade and adapter correctly

 

work to do

- the grenade does not disappear when fired, nor when the muzzle 1 magazine is empty.

 

I am guessing this is a limitation caused by selections nade already being hidden/unhidden by the muzzle select/ reloadmagazine?

yet both those sources manage to hide and unhide the SAME selections, so why cant i do it for the fired grenade?

//hide nade mag if fired
/*
			class 22mm_adapter_hide_fired
			{
				type="hide";
				source = "hasmagazine";
                selection="adapter";
				minValue=0;
				maxValue=1;//2
				minPhase=0;
				maxPhase=1;
				hideValue=0;
				unhideValue=1;
				sourceAddress="mirror";
			};
			class 22mm_grenade_hide_fired: 22mm_adapter_hide_fired
			{
				selection = "grenade";
			};
*/
//hide nade during mag reload - working
			class 22mm_adapter_hide_empty
			{
				type="hide";
				source = "reloadMagazine2";
                selection="adapter";
                animPeriod=0;
                minValue=0;
                maxValue=1; 
				hidevalue=0.3;
				unhidevalue=0.5538461538461538;
			};
			class 22mm_grenade_hide_empty: 22mm_adapter_hide_empty
			{
				selection = "grenade";
			};
//hide nade and adapter if muzzle is not selected - working
			class 22mm_m8_magazine_muzzle_hide
			{
				type="hide";
				source="weaponMuzzle";
				selection="m8_gl";
				minValue=0;
				maxValue=1;//2
				minPhase=0;
				maxPhase=1;
				hideValue=0;
				unhideValue=1;
				sourceAddress="mirror";
			};
			class 22mm_adapter_muzzle_hide: 22mm_m8_magazine_muzzle_hide
			{
				selection = "adapter";
			};
			class 22mm_grenade_muzzle_hide: 22mm_m8_magazine_muzzle_hide
			{
				selection = "grenade";
			};

Share this post


Link to post
Share on other sites

I experienced this when we were trying to have the VOG grenade disappear from the barrel on RHS' GP-25 and the 40mm from our M203/M320

 

Grenade magazines and GL weapons seem to behave a bit strange compared to rifles. The reload.1 source didn't seem to do anything (maybe because they're single shot so do not reload?) and grenade simulation type magazines are removed totally from the weapon when it's launched so isEmpty.1 was not much use if you're trying to do two-part ammunition like I was for the 40mm.

 

btw. the reload.N etc. sources I'm mentioning are new ones that can replace things like reloadMagazine2 with reloadMagazine.1

https://community.bistudio.com/wiki/Model_Config#Animations

 

Arma 3 Update 1.60 comes with a new way how to handle multiple muzzle animation sources for weapons:

  • revolving, ammo, ammoRandom, reload, trigger, reloadMagazine, hasMagazine, isEmptyNoReload, isEmpty, zeroing, weaponMode may be used with indexes ranging from -1 to (number of muzzles - 1) in format "name.x" (e.g. reload.0)
  • Index -1 means currently selected muzzle, index 0 means first muzzle of given weapon, index 1 second and so on
  • Animation sources without indexes should behave the same way as before

 

In the end we used the revolving.1 source for hiding the grenades and magazineReloadSwitchPhase = in the GP-25 muzzle's config.cpp to determine where the revolving anim resets and unhides the grenade rather than having it as part of a hide/unhide animation in reloadMagazine.1

      class grenade_fired
      {
        type="hide";
        source="revolving.1";
        selection="vog";
        minValue=0.0;
        maxValue=1.0;
        hideValue=-1.0;
        unhideValue=0.5;
      };

Share this post


Link to post
Share on other sites

what a superb answer thanks so much!

it looks like this might actually work after all.

could i possibly trouble you further for an example of this

 

magazineReloadSwitchPhase = in the GP-25 muzzle's config.cpp

Share this post


Link to post
Share on other sites

ah i see, so adding this to the muzzle config

magazineReloadSwitchPhase = 1;

means that each fired event will cause the phase to change in your rotating/hide animation?

do you need an animationsources defined in the muzzle also to manage this or is it automatic?

Share this post


Link to post
Share on other sites

ok it works perfectly thanks so much!

	class uns_m1carbine_gl: uns_m1carbine_base
	{
		sectionsInherit="uns_m1carbine_base";
		skeletonName="uns_m1carbine_gl_base";
		sections[]=
		{
			"OP", "adapter", "grenade", "m8_gl"
		};
		class Animations: Animations
		{
//hide nade mag if fired
			class 22mm_adapter_hide_fired
			{
				type="hide";
				source="revolving.1";
				selection="adapter";
				minValue=0.0;
				maxValue=1.0;
				hideValue=-1.0;
				unhideValue=0.5;
			};
			class 22mm_grenade_hide_fired: 22mm_adapter_hide_fired
			{
				selection = "grenade";
			};
//hide nade and adapter if muzzle is not selected
			class 22mm_m8_magazine_muzzle_hide
			{
				type="hide";
				source="weaponMuzzle";
				selection="m8_gl";
				minValue=0;
				maxValue=1;//2
				minPhase=0;
				maxPhase=1;
				hideValue=0;
				unhideValue=1;
				sourceAddress="mirror";
			};
			class 22mm_adapter_muzzle_hide: 22mm_m8_magazine_muzzle_hide
			{
				selection = "adapter";
			};
			class 22mm_grenade_muzzle_hide: 22mm_m8_magazine_muzzle_hide
			{
				selection = "grenade";
			};
		};
	};

Share this post


Link to post
Share on other sites

ah i see, so adding this to the muzzle config

magazineReloadSwitchPhase = 1;

means that each fired event will cause the phase to change in your rotating/hide animation?

do you need an animationsources defined in the muzzle also to manage this or is it automatic?

 

Basically, the magazineReloadSwitchPhase parameter tells the game when to reset the revolving animation sources (used for things like MG belt depletion) back to the starting value when loading a new magazine.

 

If you wanted the MG ammo belt to appear shorter when the magazine is almost empty you'd use the ammo or revolving source to hide the bullets in sequence.

But by default they would no reappear until the magazine is fully reloaded because the bone is always controlled by the revolving animation until the phase is reset: Effectively magazineReloadSwitchPhase = 1; by default

 

If you wanted the bullets to be visible again half way through the magazine reloading animation so that it looks like there is a full belt in the fresh magazine. You'd set magazineReloadSwitchPhase = 0.5; so that the phase resets half way through the mag change animation.

 

On the RHS GP25 we have magazineReloadSwitchPhase = 0.36; so that it is timed to make the grenade reappear in sync with our GL reloading animation when the unit's hand is in front of the GP25 barrel.

And in the weapon's model.cfg we also have a small translation anim starting at 0.3600001 in the reloadMagazine.1 source, that has the grenade sliding from outside the barrel so that ingame it looks like you can physically see the character drop the grenade in the barrel a fraction of a second after it becomes visible.

			class vog_start
			{
				type="translation";
				source="reloadMagazine.1";
				selection="vog";
				axis="bolt_axis";
				memory="false";
				animPeriod=0;
				minValue = 0.36;
				maxValue = 0.3600001; 
				offset0 = 0.0;
				offset1 = -1.10;
			};
			class vog_end: vog_start
			{
				minValue = 0.3600001; 
				maxValue = 0.505; 
				offset1 = 1.10;
			};

vog_start (0.36 to 0.3600001) is a lightning fast anim that places the grenade in front of the barrel. Then you have the vog_end anim is the one you really see after the grenade is visible, pushing the grenade back in to place at a much slower speed since it runs from 0.3600001 to 0.505.

 

If we didn't set magazineReloadSwitchPhase = 0.36; the grenade would not be visible at all until the magazine reload sequence was ended, and you'd just see the unit waving their hand in front of the barrel with nothing in there.

  • Like 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×