Jump to content
Dex.

How do i animate a headgear?

Recommended Posts

Hello everyone.

I need help on how I can manage to animate a headgear, in this case a helmet. So what i’m trying to do is to make the face part rotate and then to slide to a given position.
I have these axis called:
face_open_stage1_axis

face_slide_axis

mask.

 

Everything works fine in OB but when I pack it, it gives me a lot of warning. But no error. And when i test it ingame the helpmet is betwen the characters legs.

I figured that the problem is that I don't know where to put the selection of the bone in the model.cfg. I tried a lot of things but no results. 

When I pack everything without the face_open selection inside the bone list it works great ingame.

 

Picture 1 = Selections.

 

Picture 2 = Memory Lod.

 

Config.cpp

Spoiler

class CfgPatches
{
   	class Dex_Iron_Man_Mask {
    weapons[] = {};
    requiredVersion = 0.1;
    requiredAddons[] = {"A3_Characters_F"};
    };
};
class cfgWeapons {
	class ItemCore;    // External class reference
	    class InventoryItem_Base_F;    // External class reference
	    class HeadgearItem;
	    class dex_iron_man_mask_f : ItemCore {
	    scope = 2;
	    weaponPoolAvailable = 1;
		displayName = "Iron Man";
		picture = "\Iron_man\data\icon.paa";
		model = "\Iron_man\Model\dex_iron_man_mask_f.p3d";
		class ItemInfo : HeadgearItem
		{
			mass = 50;
			uniformModel = "\Iron_man\Model\dex_iron_man_mask_f";
			modelSides[] = {0};
			armor = 10*0.5;
			passThrough = 0.8;
        };
    };
    class UserActions
	{
		class Open_mask
		{
			displayName = "Open Face";
			position = "Mask";
			radius = 2;
			onlyForPlayer = 1;
			condition = "this animationSourcePhase ""Open_face_mask"", ""slide_face_back""  == 1";
			statement = "this animationSource [""Open_face_mask"", ""slide_face_back"",0];";
			shortcut = "LeanRight";
		};
		class Close_mask: Open_mask
		{
			displayName = "Close Face";
			condition = "this animationSourcePhase ""slide_face_back"", ""Open_face_mask""  == 0";
			statement = "this animationSource [""slide_face_back"", ""Open_face_mask"",1];";
		};
	};
	class AnimationSources
	{
		class Open_face_mask
		{
			source = "user";
			animPeriod = 2;
			initPhase = 1;
		};
		class slide_face_back: Open_face_mask {};
	};
};
class cfgMods
{
	author = "[FTP] Dex";
	timepacked = "051020202228";
};

 

 

 

Model.Cfg

Spoiler

 


class CfgSkeletons
{
	class Default
	{
		isDiscrete = 1;
		skeletonInherit = "";
		skeletonBones[] = {};
		};
		class OFP2_ManSkeleton
		{
		isDiscrete = 0;
		skeletonInherit = "";
		skeletonBones[] =
		{
			"face_open","",
			"Pelvis","",
			"Spine","Pelvis",
			"Spine1","Spine",
			"Spine2","Spine1",
			"Spine3","Spine2",
			"Camera","Pelvis",
			"weapon","Spine1",
			"launcher","Spine1",
			//Head skeleton in hierarchy
			"neck","Spine3",
			"neck1","neck",
			"head","neck1",
			//New facial features
			"Face_Hub","head",
			"Face_Jawbone","Face_Hub",
			"Face_Jowl","Face_Jawbone",
			"Face_chopRight","Face_Jawbone",
			"Face_chopLeft","Face_Jawbone",
			"Face_LipLowerMiddle","Face_Jawbone",
			"Face_LipLowerLeft","Face_Jawbone",
			"Face_LipLowerRight","Face_Jawbone",
			"Face_Chin","Face_Jawbone",
			"Face_Tongue","Face_Jawbone",
			"Face_CornerRight","Face_Hub",
			"Face_CheekSideRight","Face_CornerRight",
			"Face_CornerLeft","Face_Hub",
			"Face_CheekSideLeft","Face_CornerLeft",
			"Face_CheekFrontRight","Face_Hub",
			"Face_CheekFrontLeft","Face_Hub",
			"Face_CheekUpperRight","Face_Hub",
			"Face_CheekUpperLeft","Face_Hub",
			"Face_LipUpperMiddle","Face_Hub",
			"Face_LipUpperRight","Face_Hub",
			"Face_LipUpperLeft","Face_Hub",
			"Face_NostrilRight","Face_Hub",
			"Face_NostrilLeft","Face_Hub",
			"Face_Forehead","Face_Hub",
			"Face_BrowFrontRight","Face_Forehead",
			"Face_BrowFrontLeft","Face_Forehead",
			"Face_BrowMiddle","Face_Forehead",
			"Face_BrowSideRight","Face_Forehead",
			"Face_BrowSideLeft","Face_Forehead",
			"Face_Eyelids","Face_Hub",
			"Face_EyelidUpperRight","Face_Hub",
			"Face_EyelidUpperLeft","Face_Hub",
			"Face_EyelidLowerRight","Face_Hub",
			"Face_EyelidLowerLeft","Face_Hub",
			"EyeLeft","Face_Hub",
			"EyeRight","Face_Hub",
			//Left upper side
			"LeftShoulder","Spine3",
			"LeftArm","LeftShoulder",
			"LeftArmRoll","LeftArm",
			"LeftForeArm","LeftArmRoll",
			"LeftForeArmRoll","LeftForeArm",
			"LeftHand","LeftForeArmRoll",
			"LeftHandRing","LeftHand",
			"LeftHandRing1","LeftHandRing",
			"LeftHandRing2","LeftHandRing1",
			"LeftHandRing3","LeftHandRing2",
			"LeftHandPinky1","LeftHandRing",
			"LeftHandPinky2","LeftHandPinky1",
			"LeftHandPinky3","LeftHandPinky2",
			"LeftHandMiddle1","LeftHand",
			"LeftHandMiddle2","LeftHandMiddle1",
			"LeftHandMiddle3","LeftHandMiddle2",
			"LeftHandIndex1","LeftHand",
			"LeftHandIndex2","LeftHandIndex1",
			"LeftHandIndex3","LeftHandIndex2",
			"LeftHandThumb1","LeftHand",
			"LeftHandThumb2","LeftHandThumb1",
			"LeftHandThumb3","LeftHandThumb2",
			//Right upper side
			"RightShoulder","Spine3",
			"RightArm","RightShoulder",
			"RightArmRoll","RightArm",
			"RightForeArm","RightArmRoll",
			"RightForeArmRoll","RightForeArm",
			"RightHand","RightForeArmRoll",
			"RightHandRing","RightHand",
			"RightHandRing1","RightHandRing",
			"RightHandRing2","RightHandRing1",
			"RightHandRing3","RightHandRing2",
			"RightHandPinky1","RightHandRing",
			"RightHandPinky2","RightHandPinky1",
			"RightHandPinky3","RightHandPinky2",
			"RightHandMiddle1","RightHand",
			"RightHandMiddle2","RightHandMiddle1",
			"RightHandMiddle3","RightHandMiddle2",
			"RightHandIndex1","RightHand",
			"RightHandIndex2","RightHandIndex1",
			"RightHandIndex3","RightHandIndex2",
			"RightHandThumb1","RightHand",
			"RightHandThumb2","RightHandThumb1",
			"RightHandThumb3","RightHandThumb2",
			//Left lower side
			"LeftUpLeg","Pelvis",
			"LeftUpLegRoll","LeftUpLeg",
			"LeftLeg","LeftUpLegRoll",
			"LeftLegRoll","LeftLeg",
			"LeftFoot","LeftLegRoll",
			"LeftToeBase","LeftFoot",
			//Right lower side
			"RightUpLeg","Pelvis",
			"RightUpLegRoll","RightUpLeg",
			"RightLeg","RightUpLegRoll",
			"RightLegRoll","RightLeg",
			"RightFoot","RightLegRoll",
			"RightToeBase","RightFoot"
		};
		// location of pivot points (local axes) for hierarchical animation
		pivotsModel="A3\anims_f\data\skeleton\SkeletonPivots.p3d";
	};
};
class CfgModels
{
	class Default
	{
		sectionsInherit="";
		sections[] = {};
		skeletonName = "";
	};
	class ArmaMan : Default
	{
		htMin = 60; // Minimum half-cooling time (in seconds)
		htMax = 1800; // Maximum half-cooling time (in seconds)
		afMax = 30; // Maximum temperature in case the model is alive (in celsius)
		mfMax = 0; // Maximum temperature when the model is moving (in celsius)
		mFact = 1; // Metabolism factor - number from interval <0, 1> (0 - metabolism has no influence, 1 - metabolism has full influence (no other temperature source will be considered)).
		tBody = 37; // Metabolism temperature of the model (in celsius)
		sections[] =
		{
		"osobnost","Head_Injury","Body_Injury","l_leg_injury","l_arm_injury","r_arm_injury","r_leg_injury","injury_body", "injury_legs", "injury_hands",
		"clan","clan_sign","Camo","CamoB","Camo1","Camo2","Eyes","personality","hl", "injury_head", "ghillie_hide","face_open"
		};
		skeletonName = "OFP2_ManSkeleton";
	};
	class dex_iron_man_mask_f : ArmaMan 
	{
		class Animations
		{
			class open_mask
			{
				type="rotation";
				source="Open_face_mask";
				selection="face_open";	
				axis="face_open_stage1_axis";	
				initPhase = 0.0;		
				minValue = 0.0;//rad -45.836624
				maxValue = 1.6;//rad 11.459156
				angle0 = 0.0;//rad 0.0;
				angle1 = -1.6;//rad 171.88734;
			};
			class Slide_mask_back
			{
				type="translation";
				source="slide_face_back";
				selection="face_open";	
				axis="face_slide_axis";	
				initPhase = 0.0;		
				minValue = 0.0;//rad -45.836624
				maxValue = 2.0;//rad 11.459156
				offset0 = 0.0;//rad 0.0;
				offset1 = 2.0;//rad 171.88734;
			};
		};
	};
};

 

Share this post


Link to post
Share on other sites

You have the named selections named but do you actually have them defined in the model?

The only reasons the model would be between the character's legs are:

  1. You haven't defined the named selections correctly in the model.
  2. The model.cfg isn't in the same directory as the model when you Binarize/Pack it.
  3. You aren't Binarizing the model and as such the model.cfg isn't being applied.

It might help to know what the warnings were that you got when packing.

Share this post


Link to post
Share on other sites

Like i said when i pack the mod without the animation parts it works great and everything works. But when i pack it with the animation parts it gives me this error:

14:31:55: Error: Bad entry count in model.cfg/CfgSkeletons/OFP2_ManSkeleton/ skeleton

and alot of these errors:

14:31:56: Warning: iron_man\model\dex_iron_man_mask_f.p3d:1, vertex: 3485, sum of weights is 200, should be 100

 

So im not sure what i need to do to be able to animate it.

Share this post


Link to post
Share on other sites

In hind sight I'm not even sure you can animate helmets. I can't find the thread on here now but I'm sure its been discussed before...

Share this post


Link to post
Share on other sites

If that is the case then no wonder i cant get it to work. Since I have done animations on vehicles and other things but never a headgear or anything conected the character 🙂

 

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

×