Jump to content
eggbeast

folding stock using isSelected animation source

Recommended Posts

has anybody managed to make a folding stock using isSelected animation source?

So that the stock folds away when on your back but folds out when you take it out.

 

I have added it like this but it won't animate.

i have made a two part stock for the mp40, the fore stock is the long arm, and the rear stock is the fold-out part that rests on your shoulder

the stock_rear_axis is part of stock_fore selection.

 

it is folded in hands and when i switch weapons and put it on back it remains folded.

i would like it unfolded in hands.

	class uns_rifle_base: Default
	{
		skeletonBones[]=
		{
			"trigger","",
			"magazine","",
			"bolt","",
			"rearsight_1","",
			"stock_rear", "",
			"stock_fore","stock_rear"
		};
	};

class CfgModels
{
	class Default
	{
		sectionsInherit="";
		sections[]={};
		skeletonName="";
	};
	class uns_rifle_base: Default
	{
		sections[]=
		{
			"trigger","zasleh","magazine","bolt"
		};
		skeletonName="uns_rifle_base";
		class Animations
		{
			class stock_fold1
			{
				type = "rotationZ";
				source = "isSelected";
				selection = "stock_fore";
				axis = "stock_fore_axis";
				minValue = 0;
				maxValue = 1;
				angle0 = "rad 0";
				angle1 = "rad 180";
			};			
			class stock_fold2: stock_fold1
			{
				selection = "stock_rear";
				axis = "stock_rear_axis";
				minValue = 0;
				maxValue = 1;
				angle0 = "rad 0";
				angle1 = "rad -80";
			};			
		};
	};
	class uns_mp40: uns_rifle_base{};
};

can anybody post a working example please? would really appreciate it thanks.

Share this post


Link to post
Share on other sites

I used isSelected once, for a hide animation for CUP's Javelin. When you have it on your back, it hides the CLU and only reveals it when using the launcher.

It doesn't animate smoothly, though, AFAIK the value jumps from 0 to 1 the moment you select the launcher, which is why the CLU pops up on the back when readying the launcher, but there is nothing that can be done about it.

 

This is how my model.cfg looks like:

class cfgSkeletons
{
	class Default
	{
		isDiscrete = 1;
		skeletonInherit = "";
		skeletonBones[] = {};
	};
	class CUP_JavelinSkeleton: Default
	{
		skeletonBones[]=
		{
			"hide_not_selected","",
			"missile",	""
		};
	};
};
class CfgModels
{
	class Default
	{
		sections[] = {};
		sectionsInherit = "";
		skeletonName = "";
	};
	class CUP_javelin_launcher_loaded: Default
	{
		skeletonName = "CUP_JavelinSkeleton";
		sections[] = {"hide_not_selected"};
		class Animations
		{
			class hide_when_not_selected
			{
				type = "hide";
				source = "isSelected";
				selection = "hide_not_selected";
				minValue = 0;
				maxValue = 1;
				hideValue = 0;
				unhideValue = 1;
				sourceAddress = "clamp";
				axis = "";
				memory = 0;
			};
			class no_magazine
			{
				type = "hide";
				source = "hasMagazine";
				selection = "missile";
				minValue = 0;
				maxValue = 1;
				hideValue = 0.5;
				unhideValue = -1;
			};
		};
	};
};

Does the animation work in Buldozer?

Share this post


Link to post
Share on other sites

thanks A

I can't get bulldozer to open without crashing, so i have no idea hehe.

thanks maybe only certain anim TYPES work with this source then. i will try adding

- a hide anim for the folded stock when weapon is selected

- a hide anim for the unfolded stock when weapon is not selected

it will add faces the model totals, but if hide works and the animation period is always instant, maybe that is best way to go

thanks again

Share this post


Link to post
Share on other sites

Good luck.
I would really try to get buldozer to work, it's much easier than having to repack your addon every time.

Share this post


Link to post
Share on other sites

i have no issue with a rotating animation (except it beeing "digital" 1 or 0) for a skeleton stock

Share this post


Link to post
Share on other sites

ok thanks. i know it seems dumb to ask, but could you possibly share a working example please?

my example above should work but doesn't. i've had a go at this over the past few months and never got it to work.

Share this post


Link to post
Share on other sites


class BaseRotation {

type = "rotation";

selection = "";

source="";

axis="";

memory = 1;

begin = 0; end = 1;

minValue = 0; maxValue = 1;

angle0 = 0; angle1 = 1;

};

class Foldingstock: BaseRotation{

source="isSelected";

selection="skel_stock";

axis="ax_skel_stock";

minValue=0;

maxValue=1;

angle0 = "rad -180";

angle1 = "rad 0";

};

  • Like 1

Share this post


Link to post
Share on other sites

thanks you so much. i will give this a try.

Share this post


Link to post
Share on other sites

ok i have both the mp40 and mac10 stocks animating perfectly in buldozer (i got that fixed, and boy does it make things easier!)

when i toggle to isSelected, and run the phase from 0 to 1, the stocks fold out perfectly.

however in game, nothing happens when i select a pistol and put the weapon on my back, or vice versa.

Share this post


Link to post
Share on other sites

 

 

model.cfg's follow.

 

mp40 model.cfg

class CfgSkeletons
{
	class Default
	{
		isDiscrete=1;
		skeletonInherit="";
		skeletonBones[]={};
	};
	class uns_rifle_base: Default
	{
		skeletonBones[]=
		{
			"zasleh", "",
			"trigger","",
			"magazine","",
			"bolt","",
			"charging_handle", "bolt",
			"rearsight_1","",
			"stock_fore","",
			"stock_rear", "stock_fore"
		};
	};
};
//class Rotation { type="rotation"; memory=1; minValue=0; maxValue=1; angle0=0; angle1=1; };
class CfgModels
{
	class Default
	{
		sectionsInherit="";
		sections[]={};
		skeletonName="";
	};
	class uns_rifle_base: Default
	{
		sections[]=
		{
			"trigger","zasleh","magazine","bolt","charging_handle"
		};
		skeletonName="uns_rifle_base";
		class Animations
		{
			class reload_magazine_hide
           	{
				type="hide";
                source="reloadMagazine";
               	selection="magazine";
                minValue=0;
                maxValue=1;
				hideValue = 0.1538461538;
				unhidevalue = 0.46153;
       		};
			class unloaded_magazine_hide 
			{
				type = "hide";
				source = "hasMagazine";
				selection = "magazine";
				hideValue=0.1;
			};
			class reload_magazine_hinge
           	{
				type="translation";
                source="reloadMagazine";
               	selection="magazine";
                minValue=0.1230769230;
                maxValue=0.153846153;
                axis="magazine_axis";
				begin = "bolt_axis_begin";
                end =  "bolt_axis_end";
				offset0 = 0;
				offset1 = -1.5;
            };
			class reload_magazine_hinge2
           	{
				type="translation";
                source="reloadMagazine";
               	selection="magazine";
				begin = "bolt_axis_begin";
                end =  "bolt_axis_end";
                minValue=0.46153846153;
                maxValue=0.5076923076;
                axis="magazine_axis";
				offset0 = 0;
				offset1 = 1.5;
            };	
			class bolt
			{
				type = "translation";
				source = "reload";
				selection = "bolt";
				axis = "bolt_axis";
				begin = "bolt_axis_begin";
				end = "bolt_axis_end";
				memory = 1;
				minValue = 0.0;
				maxValue = 1; //0.1;
				offset0 = 0.0;
				offset1 = 1.0;
			};
			class bolt_empty: bolt
			{
				selection = "bolt";
                source = "isEmpty";
				axis = "bolt_axis";
				offset1 = "1";
			};
			class trigger
			{
				type = "rotationZ";//rotationX
				source = "reload";
				selection = "trigger";
				axis = "trigger_axis";
				minValue = 0;
				maxValue = 1;
				angle0 = "rad 0";
				angle1 = "rad -30";
			};
			class Charging_handle_reload_begin  
			{
				type="translation";
				source="reloadMagazine";
				memory = 1;
				selection="charging_handle";
				axis="charging_handle_axis";
				minValue = 0.6;
				maxValue = 0.7;
				minPhase = 0.6;
				maxPhase = 0.7;
				offset0 = 0.0;
				offset1 = -1;
			};
			class Charging_handle_reload_end: Charging_handle_reload_begin  
			{
				minValue = 0.8;
				maxValue = 0.99;
				minPhase = 0.8;
				maxPhase = 0.99;
				offset1 = 1;
			};
			class Zeroing100m //rotate sight up or down
            {
				type="rotationZ";
                source="zeroing1";
                selection="rearsight_1";
                axis = "rearsight_1_axis";
                minValue = 0;
                maxValue = 0.1;
 				angle0="rad 90";
 				angle1="rad 0";
            };
			class muzzleflash_hide
            {
				type="hide";
                source="hasSuppressor";
                selection="zasleh";
                minValue = 0.0;
                maxvalue = 0.25;
				hideValue = 0.01;
            };
			class MuzzleFlashROT
 			{
 				type="rotationX";
 				source="ammoRandom";
 				sourceAddress="loop";
 				selection="zasleh"; 
 				axis="barrel_axis"; 
 				centerFirstVertex=true;
 				minValue=0;
 				maxValue=4;
 				angle0="rad 0";
 				angle1="rad 360";
 			};
			class BaseRotation 
			{
				type = "rotation";
				selection = "";
				source="";	
				axis="";
				memory = 1;
				begin = 0;
				end = 1;
				minValue = 0;
				maxValue = 1;
				angle0 = 0;
				angle1 = 1;
			};	
			class stock_fold1: BaseRotation
			{
				source="isSelected";
				selection = "stock_fore";
				axis = "stock_fore_axis";
				minValue=0;
				maxValue=1;
				angle0 = "rad 0";
				angle1 = "rad -180";		
			};
			class stock_fold2: stock_fold1
			{
				selection = "stock_rear";
				axis = "stock_rear_axis";
				angle1 = "rad 80";
			};			
		};
	};
	class uns_mp40: uns_rifle_base{};
};

mac10 model.cfg

class CfgSkeletons
{
	class Default
	{
		isDiscrete=1;
		skeletonInherit="";
		skeletonBones[]={};
	};
	class uns_rifle_base: Default
	{
		skeletonBones[]=
		{
			"trigger","",
			"magazine","",
			"bolt","",
			"charging_handle","bolt",
			"ironsights","",
			"siderail","",
			"stock","",
			"rear_stock","stock",
			"zasleh",""
		};
	};
};
//class Rotation { type="rotation"; memory=1; minValue=0; maxValue=1; angle0=0; angle1=1; };

class CfgModels
{
	class Default
	{
		sectionsInherit="";
		sections[]={};
		skeletonName="";
	};
	class uns_rifle_base: Default
	{
		sections[]=
		{
			"trigger","zasleh",
			"magazine","bolt","charging_handle",
			"ironsights","siderail",
			"stock","rear_stock"
		};
		skeletonName="uns_rifle_base";
		class Animations
		{
			class trigger
			{
				type = "rotationZ";
				source = "reload";
				selection = "trigger";
				axis = "trigger_axis";
				minValue = 0;
				maxValue = 1;
				angle0 = "rad 0";
				angle1 = "rad -30";
			};
			class BaseRotation 
			{
				type = "rotation";
				selection = "";
				source="";	
				axis="";
				memory = 1;
				begin = 0;
				end = 1;
				minValue = 0;
				maxValue = 1;
				angle0 = 0;
				angle1 = 1;
			};	
			class rear_stock_rotate: BaseRotation
			{
				source="isSelected";
				selection="rear_stock";
				axis="rear_stock_axis";
				minValue=0;
				maxValue=1;
				angle0 = "rad 0";
				angle1 = "rad 90";		
			};
			class stock_translate
			{
				source="isSelected";
				type = "translation";
				selection = "stock";
				axis = "stock_axis";
				begin = "stock_axis_begin";
				end = "stock_axis_end";
				memory = 1;
				minValue = 0;
				maxValue = 1;
				offset0 = 0;
				offset1 = 1;
			};
			class reload_magazine_hide
           	{
				type="hide";
                source="reloadMagazine";
               	selection="magazine";
                minValue=0;
                maxValue=1;
				hideValue = 0.1538461538;
				unhidevalue = 0.46153;
       		};
			class unloaded_magazine_hide 
			{
				type = "hide";
				source = "hasMagazine";
				selection = "magazine";
				hideValue=0.1;
			};
			class reload_magazine_hinge
           	{
				type="translation";
                source="reloadMagazine";
               	selection="magazine";
                minValue=0.1230769230;
                maxValue=0.153846153;
                axis="magazine_axis";
				begin = "bolt_axis_begin";
                end =  "bolt_axis_end";
				offset0 = 0;
				offset1 = -1.5;
            };
			class reload_magazine_hinge2
           	{
				type="translation";
                source="reloadMagazine";
               	selection="magazine";
				begin = "bolt_axis_begin";
                end =  "bolt_axis_end";
                minValue=0.46153846153;
                maxValue=0.5076923076;
                axis="magazine_axis";
				offset0 = 0;
				offset1 = 1.5;
            };	
			class bolt
			{
				type = "translation";
				source = "reload";
				selection = "bolt";
				axis = "bolt_axis";
				begin = "bolt_axis_begin";
				end = "bolt_axis_end";
				memory = 1;
				minValue = 0;
				maxValue = 1;
				offset0 = 0;
				offset1 = -1;
			};
			class bolt_empty: bolt
			{
				selection = "bolt";
                source = "isEmpty";
				axis = "bolt_axis";
				offset1 = "-1";
			};
			class Charging_handle_reload_begin  
			{
				type="translation";
				source="reloadMagazine";
				memory = 1;
				selection="charging_handle";
				axis="bolt_axis";
				minValue = 0.6;
				maxValue = 0.7;
				minPhase = 0.6;
				maxPhase = 0.7;
				offset0 = 0.0;
				offset1 = 1;
			};
			class Charging_handle_reload_end: Charging_handle_reload_begin  
			{
				minValue = 0.8;
				maxValue = 0.99;
				minPhase = 0.8;
				maxPhase = 0.99;
				offset1 = -1;
			};
			class backsight_hide
			{
				 type="hide";
				 source="hasOptics";
				 selection="ironsights";
				 animPeriod=0;
				 minValue=0.0;
				 maxValue=0.3;
				 minPhase=0.0;
				 maxPhase=0.3;
				 hideValue=0.1;
				 sourceAddress="mirror";
			};
			class siderails_hide
			{
				 type="hide";
				 source="hasAccessory";
				 selection="siderail";
				 animPeriod=0;
				 minValue=0.0;
				 maxValue=0.3;
				 minPhase=0.0;
				 maxPhase=0.3;
				 hideValue=0.1;
				 sourceAddress="mirror";
			};
            class MuzzleFlashROT
			{
				type="rotationX";
				source="ammoRandom";
				sourceAddress="loop";
				selection="zasleh";
				axis="barrel_axis";
				centerFirstVertex="true";
				minValue=0;
				maxValue=4;
				angle0="rad 0";
				angle1="rad 360";
			};
			class muzzleflash_hide
            {
				type="hide";
				source="hasSuppressor";
                selection="zasleh";
                minValue = 0.0;
                maxvalue = 0.25;
                hideValue = 0.01;
			};
		};
	};
	class uns_mac10: uns_rifle_base{};
};

Share this post


Link to post
Share on other sites

nothing happens in-game when switching weapons...

 

i have even tried adding the animationsource to the config, but that does nothing either.

    class uns_mp40: Uns_SMG
    {
        scope = 2; scopeArsenal = 2;
        displayName = "MP-40";
        model = "\uns_weap_e\mp40\uns_mp40";
        handAnim[] = {"OFP2_ManSkeleton","\uns_weap_a\m16\m16_handguard.rtm"};
        picture = "\uns_weap_e\mp40\ico\w_mp40.paa";
        magazines[] = {"uns_mp40mag"};
        dexterity = 1.75;
        inertia = 0.2;
        initSpeed = 280;
        recoil = "uns_recoil_smg_tommy";
        weaponInfoType = "RscWeaponZeroing";
        discreteDistance[] = {100,200};
        discreteDistanceInitIndex = 0;
        memoryPointCamera = "eye";
//        magazineReloadSwitchPhase = 0.5;
        cameradir = "aim_point";
        discreteDistanceCameraPoint[] = {"eye","eye2"};
        class WeaponSlotsInfo: WeaponSlotsInfo
        {
            mass = 45;
            class MuzzleSlot{};
            class CowsSlot{};
            class PointerSlot{};
        };
        descriptionShort = "MP40 with 32 round mag.";
        class animationsources
        {
            class isSelected
            {
                source = "isSelected";
                weapon = "uns_mp40";
            };
        };

Share this post


Link to post
Share on other sites

I am starting to doubt whether isSelected actually works as an animationsource. i must be missing something really obvious here...

i think i got a hide anim working way back when i started on the unsung weapons last year.

 

I hear you guys saying you got it working, can you possibly share a little more detail about how please? i'd be most grateful, am scratching my head here.

Share this post


Link to post
Share on other sites

It works on my rifle, just like that. I have not tested anything else. class animationsources only works for vehicles i think. My config class inherits from Rifle_Base_F however - you have created your own baseclass. Not sure if that is the culprit

Share this post


Link to post
Share on other sites

Cfgskeleton has same name as Cfgmodel in both you configs and the mp 40 Cfgmodel misses the entries for the "stock_rear", "stock_fore" selections in CfgModel/sections (mac10 uses different selection names for same thing? "rear_stock","stock",)

 

i am not even sure if you can use uns_rifle_base as skeleton name and as Cfgmodel name, specially not for 2 guns at the same time.

a model.cfg can also be named like the model it uses it, aslong it is in same folder as the p3d.

so i would make a uns_mp40.cfg and a uns_mac10.cfg, in there name the skeleton uns_mp40bone/uns_mac10bone and in the CfgModel use the names of the p3d (uns_mp40 and uns_mac10), make sure all animated selections are defined as bones and in sections of CfgModel and it should work.

Share this post


Link to post
Share on other sites

thanks guys. i really do appreciate your help.

 

for info: we have a DP-28 developed by von knudenberg last year which uses animationsources to animate the D-ring on the pan magazine:

		class animationsources
		{
			class revolving
			{
				source = "revolving";
				weapon = "uns_DP28";
			};
			class reload
			{
				source = "reload";
				weapon = "uns_DP28";
			};
		};

good spot on the mp40 sections!

i have now renamed the base classes and skeletons separately - and lo and behold - loads of animations that weren't quite working properly are now functioning properly!.

Share this post


Link to post
Share on other sites

thanks to scars09, x3kj and alwarren for your help, and Toadie2k/reyhard for their amazing animation skills, we now have a perfectly working MP40 and mac10!

and i now need to edit something like 150 weapon models to fix up my historical mistakes... :(

 

 

Share this post


Link to post
Share on other sites

What was the problem after all? I'm currently encountering the same effect(isSelected works in OB but not ingame) but everything seems fine in my model.cfg and my model is really simple. I do not use modelSpecial in magazine configs. Here's my entire model.cfg file:

class CfgSkeletons
{
	class apilas_skeleton
	{
		pivotsModel="";
		isDiscrete = 1;
		skeletonInherit = "";
		skeletonBones[] =
		{
			"front_cover", "",
			"face_cover", "",
			"optic","",
			"camo",""
		};
	};
};
class CfgModels
{
	class Default {};
	class Weapon : Default {};
	class Launcher : Weapon {};
	class apilas: Launcher
	{
		skeletonName = "apilas_skeleton";
		sectionsInherit = "";
		sections[] = {"front_cover","face_cover","optic","camo"};
		class Animations
		{
			class back 
			{
				type = "translation";
				source = "isSelected";
				sourceAddress = "mirror";
				selection = "camo";
				axis = "back_axis";
				memory = 1;
				minValue = -1;
				maxValue = 0;
				minPhase = 0;
				maxPhase = 1;
				offset0 = 0;
				offset1 = 1;
			};
		};
	};
};

Share this post


Link to post
Share on other sites

 

Cfgskeleton has same name as Cfgmodel

that was my problem

 

what are you trying to do exactly? translating the selection camo somewhere?

is camo a standalone bone? or is it part of another selection? it sounds like a selection named for skin type, rather than for moving.

Share this post


Link to post
Share on other sites

mp40 example

- notice i name the sections i wish to animate. not sure if that is a factor

- stock_rear_axis memory points are also named as stock_fore selection, so the axis moves with the stock fore selection/bone, as it is a two-part stock.

 

model.cfg

class CfgSkeletons
{
	class Default
	{
		isDiscrete=1;
		skeletonInherit="";
		skeletonBones[]={};
	};
	class uns_mp40_skel: Default
	{
		isDiscrete=1;
		skeletonInherit="Default";
		skeletonBones[]=
		{
			"zasleh", "",
			"trigger","",
			"magazine","",
			"bolt","",
			"charging_handle", "bolt",
			"rearsight_1","",
			"stock_fore","",
			"stock_rear", "stock_fore"
		};
	};
};
class Rotation { type="rotation"; memory=1; minValue=0; maxValue=1; angle0=0; angle1=1; };
class CfgModels
{
	class Default
	{
		sectionsInherit="";
		sections[]={};
		skeletonName="";
	};
	class uns_mp40: Default
	{
		sections[]=
		{
			"trigger","zasleh",
			"magazine","bolt","charging_handle",
			"stock_fore","stock_rear"
		};
		skeletonName="uns_mp40_skel";
		sectionsInherit="Default";
		class Animations
		{
			class BaseRotation 
			{
				type = "rotation";
				selection = "";
				source="";	
				axis="";
				memory = 1;
				begin = 0;
				end = 1;
				minValue = 0;
				maxValue = 1;
				angle0 = 0;
				angle1 = 1;
			};	
			class stock_fold1: BaseRotation
			{
				source="isSelected"; //bipod
				selection = "stock_fore";
				axis = "stock_fore_axis";
				minValue=0;
				maxValue=1;
				angle0 = "rad 0";
				angle1 = "rad -180";		
			};
			class stock_fold2: stock_fold1
			{
				selection = "stock_rear";
				axis = "stock_rear_axis";
				angle1 = "rad 80";
			};			
			class reload_magazine_hide
           	{
				type="hide";
                source="reloadMagazine";
               	selection="magazine";
                minValue=0;
                maxValue=1;
				hideValue = 0.1538461538;
				unhidevalue = 0.46153;
       		};
			class unloaded_magazine_hide 
			{
				type = "hide";
				source = "hasMagazine";
				selection = "magazine";
				hideValue=0.1;
			};
			class reload_magazine_hinge
           	{
				type="translation";
                source="reloadMagazine";
               	selection="magazine";
                minValue=0.1230769230;
                maxValue=0.153846153;
                axis="magazine_axis";
				begin = "bolt_axis_begin";
                end =  "bolt_axis_end";
				offset0 = 0;
				offset1 = -1.5;
            };
			class reload_magazine_hinge2
           	{
				type="translation";
                source="reloadMagazine";
               	selection="magazine";
				begin = "bolt_axis_begin";
                end =  "bolt_axis_end";
                minValue=0.46153846153;
                maxValue=0.5076923076;
                axis="magazine_axis";
				offset0 = 0;
				offset1 = 1.5;
            };	
			class bolt
			{
				type = "translation";
				source = "reload";
				selection = "bolt";
				axis = "bolt_axis";
				begin = "bolt_axis_begin";
				end = "bolt_axis_end";
				memory = 1;
				minValue = 0.0;
				maxValue = 1; //0.1;
				offset0 = 0.0;
				offset1 = 1.0;
			};
			class bolt_empty: bolt
			{
				selection = "bolt";
                source = "isEmpty";
				axis = "bolt_axis";
				offset1 = "1";
			};
			class trigger
			{
				type = "rotationZ";//rotationX
				source = "reload";
				selection = "trigger";
				axis = "trigger_axis";
				minValue = 0;
				maxValue = 1;
				angle0 = "rad 0";
				angle1 = "rad -30";
			};
			class Charging_handle_reload_begin  
			{
				type="translation";
				source="reloadMagazine";
				memory = 1;
				selection="charging_handle";
				axis="charging_handle_axis";
				minValue = 0.6;
				maxValue = 0.7;
				minPhase = 0.6;
				maxPhase = 0.7;
				offset0 = 0.0;
				offset1 = -1;
			};
			class Charging_handle_reload_end: Charging_handle_reload_begin  
			{
				minValue = 0.8;
				maxValue = 0.99;
				minPhase = 0.8;
				maxPhase = 0.99;
				offset1 = 1;
			};
			class Zeroing100m //rotate sight up or down
            {
				type="rotationZ";
                source="zeroing1";
                selection="rearsight_1";
                axis = "rearsight_1_axis";
                minValue = 0;
                maxValue = 0.1;
 				angle0="rad 90";
 				angle1="rad 0";
            };
			class muzzleflash_hide
            {
				type="hide";
                source="hasSuppressor";
                selection="zasleh";
                minValue = 0.0;
                maxvalue = 0.25;
				hideValue = 0.01;
            };
			class MuzzleFlashROT
 			{
 				type="rotationX";
 				source="ammoRandom";
 				sourceAddress="loop";
 				selection="zasleh"; 
 				axis="barrel_axis"; 
 				centerFirstVertex=true;
 				minValue=0;
 				maxValue=4;
 				angle0="rad 0";
 				angle1="rad 360";
 			};
		};
	};
};

weapon config

	class uns_mp40: Uns_SMG
	{
		scope = 2; scopeArsenal = 2;
		displayName = "MP-40";
		model = "\uns_weap_e\mp40\uns_mp40";
		handAnim[] = {"OFP2_ManSkeleton","\uns_weap_a\m16\m16_handguard.rtm"};
		reloadAction = "HLC_GestureReloadFALLONG";
        magazineReloadSwitchPhase = 0.5;
		picture = "\uns_weap_e\mp40\ico\w_mp40.paa";
		magazines[] = {"uns_mp40mag"};
		dexterity = 1.75;
		inertia = 0.2;
		initSpeed = 280;
		recoil = "uns_recoil_smg_tommy";
		weaponInfoType = "RscWeaponZeroing";
		discreteDistance[] = {100,200};
		discreteDistanceInitIndex = 0;
        memoryPointCamera = "eye";
        cameradir = "eye_look";
        discreteDistanceCameraPoint[] = {"eye_100","eye_200"};
		class WeaponSlotsInfo: WeaponSlotsInfo
		{
			mass = 45;
			class MuzzleSlot{};
			class CowsSlot{};
			class PointerSlot{};
		};
		descriptionShort = "MP40 with 32 round mag.";
		hasbipod = 1;		//for folding stock
//sounds follow
};

Share this post


Link to post
Share on other sites

here is a PM63  - it translates the fore stock out and then rotates the rear stock round

uns_pm63f folded version starts folded and only unfolds when you weapon-rest

uns_pm63 unfolded version folds only when weapon is not selected (i.e. on your back)

class CfgSkeletons
{
    class Default
    {
        isDiscrete=1;
        skeletonInherit="";
        skeletonBones[]={};
    };
    class uns_pm63_skel: Default
    {
        skeletonInherit="Default";
        skeletonBones[]=
        {
            "magazine","",
            "bolt","",
            "trigger","",
            "zasleh",""
        };
    };
    class uns_pm63_stock_skel: uns_pm63_skel
    {
        skeletonInherit="uns_pm63_skel";
        skeletonBones[]=
        {
            "stock1","",
            "stock2","stock1",
            "grip",""
        };
    };
};
class CfgModels
{
    class Default
    {
        sectionsInherit="";
        sections[]={};
        skeletonName="";
    };
    class uns_pm63_base: Default
    {
        skeletonName="uns_pm63_skel";
        sectionsInherit="Default";
        sections[]=
        {
            "zasleh","magazine","bolt","trigger"
        };
        class Animations
        {
            class reload_magazine_hide
               {
                type="hide";
                source="reloadMagazine";
                   selection="magazine";
                minValue=0;
                maxValue=1;
                hideValue = 0.1538461538;
                unhidevalue = 0.46153;
               };
            class unloaded_magazine_hide
            {
                type = "hide";
                source = "hasMagazine";
                selection = "magazine";
                hideValue=0.1;
            };
            class reload_magazine_hinge
               {
                type="translation";
                source="reloadMagazine";
                   selection="magazine";
                minValue=0.1230769230;
                maxValue=0.153846153;
                axis="magazine_axis";
                begin = "bolt_axis_begin";
                end =  "bolt_axis_end";
                offset0 = 0;
                offset1 = -1.5;
            };
            class reload_magazine_hinge2
               {
                type="translation";
                source="reloadMagazine";
                   selection="magazine";
                begin = "bolt_axis_begin";
                end =  "bolt_axis_end";
                minValue=0.46153846153;
                maxValue=0.5076923076;
                axis="magazine_axis";
                offset0 = 0;
                offset1 = 1.5;
            };                
            class trigger
            {
                type = "rotationZ";
                source = "reload";
                selection = "trigger";
                axis = "trigger_axis";
                minValue = 0;
                maxValue = 1;
                angle0 = "rad 0";
                angle1 = "rad -30";
            };
            class bolt
            {
                type = "translation";
                source = "reload";
                selection = "bolt";
                axis = "bolt_axis";
                begin = "bolt_axis_begin";
                end = "bolt_axis_end";
                memory = 1;
                minValue = 0;
                maxValue = 1;
                offset0 = 0;
                offset1 = 1;
            };
            class bolt_empty: bolt
            {
                source = "isEmpty";
            };
            class Charging_handle_reload_begin  
            {
                type="translation";
                source="reloadMagazine";
                memory = 1;
                selection="bolt";
                axis="bolt_axis";
                minValue = 0.6;
                maxValue = 0.7;
                minPhase = 0.6;
                maxPhase = 0.7;
                offset0 = 0;
                offset1 = -1;
            };
            class Charging_handle_reload_end: Charging_handle_reload_begin  
            {
                minValue = 0.8;
                maxValue = 0.99;
                minPhase = 0.8;
                maxPhase = 0.99;
                offset1 = 1;
            };            
            class MuzzleFlashROT
            {
                type="rotationX";
                source="ammoRandom";
                sourceAddress="loop";
                selection="zasleh";
                axis="barrel_axis";
                centerFirstVertex="true";
                minValue=0;
                maxValue=4;
                angle0="rad 0";
                angle1="rad 360";
            };
            class muzzleflash_hide
            {
                type="hide";
                source="hasSuppressor";
                selection="zasleh";
                minValue = 0.0;
                maxvalue = 0.25;
                hideValue = 0.01;
            };
        };
    };
    class uns_pm63: uns_pm63_base
    {
        skeletonName="uns_pm63_stock_skel";
        sectionsInherit="uns_pm63_base";
        sections[]=
        {
            "stock1","stock2","grip"
        };
        class Animations: Animations
        {
            class BaseRotation
            {
                type = "rotation";
                selection = "";
                source="";    
                axis="";
                memory = 1;
                begin = 0;
                end = 1;
                minValue = 0;
                maxValue = 1;
                angle0 = 0;
                angle1 = 1;
            };    
            class stock_fold1: BaseRotation
            {
                source="isSelected";
                selection = "stock1";
                axis = "stock1_axis";
                minValue=0.7;
                maxValue=0.8;
                angle0 = "rad 5.06";
                angle1 = "rad 0";        
            };
            class stock_fold2: stock_fold1
            {
                selection = "stock2";
                axis = "stock2_axis";
                angle0 = "rad -90";
                minValue=0.7;
                maxValue=0.8;
            };    
            class stock_translate
            {
                source="isSelected";
                type = "translation";
                selection = "stock1";
                axis = "stock_axis";
                begin = "stock_axis_begin";
                end = "stock_axis_end";
                memory = 1;
                minValue = 0.2;
                maxValue = 0.7;
                offset0 = -0.8; //check
                offset1 = 0;
            };
            class grip_fold: stock_fold1
            {
                selection = "grip";
                axis = "grip_axis";
                angle0 = "rad 95";
                angle1 = "rad 0";
                minValue=0.9;
                maxValue=1;
            };    
        };
    };
    class uns_pm63f: uns_pm63
    {
        sectionsInherit = "uns_pm63";
        sections[] = {};
        class Animations: Animations
        {
            class BaseRotation
            {
                type = "rotation";
                selection = "";
                source="";    
                axis="";
                memory = 1;
                begin = 0;
                end = 1;
                minValue = 0;
                maxValue = 1;
                angle0 = 0;
                angle1 = 1;
            };    
            class stock_fold1: BaseRotation
            {
                source="bipod";
                selection = "stock1";
                axis = "stock1_axis";
                minValue=0.7;
                maxValue=0.8;
                angle0 = "rad 5.06";
                angle1 = "rad 0";        
            };
            class stock_fold2: stock_fold1
            {
                selection = "stock2";
                axis = "stock2_axis";
                angle0 = "rad -90";
                minValue=0.7;
                maxValue=0.8;
            };    
            class stock_translate
            {
                source="bipod";
                type = "translation";
                selection = "stock1";
                axis = "stock_axis";
                begin = "stock_axis_begin";
                end = "stock_axis_end";
                memory = 1;
                minValue = 0.2;
                maxValue = 0.7;
                offset0 = -0.8; //check
                offset1 = 0;
            };
            class grip_fold: stock_fold1
            {
                selection = "grip";
                axis = "grip_axis";
                angle0 = "rad 95";
                angle1 = "rad 0";
                minValue=0.9;
                maxValue=1;
            };    
        };
    };    
    class uns_pm63p: uns_pm63f
    {
        skeletonName = "uns_pm63_stock_skel";
        sectionsInherit = "uns_pm63";
        sections[] = {};
        class Animations: Animations
        {
            class BaseRotation
            {
                type = "rotation";
                selection = "";
                source="";    
                axis="";
                memory = 1;
                begin = 0;
                end = 1;
                minValue = 0;
                maxValue = 1;
                angle0 = 0;
                angle1 = 1;
            };    
            class stock_fold1: BaseRotation
            {
                source="bipod";
                selection = "stock1";
                axis = "stock1_axis";
                minValue=0.71;
                maxValue=0.8;
                angle0 = "rad 0";
                angle1 = "rad -5.06";        
            };
            class stock_fold2: stock_fold1
            {
                selection = "stock2";
                axis = "stock2_axis";
                angle1 = "rad 90";
                minValue=0.7;
                maxValue=0.8;
            };    
            class stock_translate
            {
                source="bipod";
                type = "translation";
                selection = "stock1";
                axis = "stock_axis";
                begin = "stock_axis_begin";
                end = "stock_axis_end";
                memory = 1;
                minValue = 0.2;
                maxValue = 0.7;
                offset0 = 0;
                offset1 = 0.95;
            };
            class grip_fold: stock_fold1
            {
                selection = "grip";
                axis = "grip_axis";
                angle0 = "rad 0";
                angle1 = "rad -95";
                minValue=0.9;
                maxValue=1;
            };    
        };
    };
};

Share this post


Link to post
Share on other sites

that was my problem

 

what are you trying to do exactly? translating the selection camo somewhere?

is camo a standalone bone? or is it part of another selection? it sounds like a selection named for skin type, rather than for moving.

 

I'm having my launcher mislining on back (the model is really thin) so I'm moving the model inside OB to align with the back. After that I am going to move the model back to original position with isSelected animation source.

 

Here's the initial bug report that I received: https://github.com/FinModA3/development/issues/31

There's picture included about the problem.

Share this post


Link to post
Share on other sites

i dont get the 2 skeletons, is the 2nd one for stock only?

initially i was using the base class to separate the animated stock version from the models i hadn't yet animated, to animate the stock in one and not in the other, then i sorted out each of them after the first one was working, the split is a "development artifact"!

Share this post


Link to post
Share on other sites

I'm having my launcher mislining on back (the model is really thin) so I'm moving the model inside OB to align with the back. After that I am going to move the model back to original position with isSelected animation source.

 

Here's the initial bug report that I received: https://github.com/FinModA3/development/issues/31

There's picture included about the problem.

ok you could maybe try making two copies of the launcher, "selected_launcher" and "unselected_launcher" and have them hide or unhide according to value of isselected. translation may work better though as placing the weapon on the ground nullifies the isselected, and both parts would show.

 

this is my LAW

class CfgSkeletons
{
	class Default
	{
		isDiscrete=1;
		skeletonInherit="";
		skeletonBones[]={};
	};
	class uns_m72_LAW_skel: Default
	{
		skeletonBones[]=
		{
			"law","",
			"law_closed","",
			"Rmagazine","law",
			"trigger","law"
		};
	};
};
class CfgModels
{
	class Default
	{
		sectionsInherit="";
		sections[]={};
		skeletonName="";
	};
	class uns_m72_LAW_base: Default
	{
		skeletonName="uns_m72_LAW_skel";
		sectionsInherit="Default";
		sections[]=
		{
			"law",
			"law_closed",
			"trigger",
			"Rmagazine"
		};
		class Animations
		{
			class trigger
			{
				type = "rotationZ";
				source = "reload";
				selection = "trigger";
				axis = "trigger_axis";
				minValue = 0;
				maxValue = 1;
				angle0 = "rad 0";
				angle1 = "rad -15";
			};		
			class unloaded_magazine_hide
			{
				type = "hide";
				source = "hasMagazine";
				selection = "Rmagazine";
				hideValue = 0.1;
			};
			class magazine_hide: unloaded_magazine_hide
            {
                source="reloadMagazine";
                minValue=0;
                maxValue=1;
                hideValue=0.15;
                unhideValue=0.46153846153;
            };
			class mag_empty: unloaded_magazine_hide
            {
                source="isEmpty";
                animPeriod=0;
                hideValue=0.1;
            };
			class law_open_hide
            {
                type="hide";
                source="isSelected";
                selection="law";
                minValue = 0;
                maxvalue = 0.7;
                hideValue = 0;
                unhideValue = 0.6;
            };
			class law_closed_hide
            {
                type="hide";
                source="isSelected";
                selection="law_closed";
                minValue = 0;
                maxvalue = 0.7;
                hideValue = 0.6;
            };			
		};
	};
	class uns_m72l: uns_m72_LAW_base{};
	class uns_m72e: uns_m72_LAW_base{};
};

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

×