Jump to content
Sign in to follow this  
liukang168

Custom Unit problems: config.cpp & model.cfg

Recommended Posts

Hi folks,

for some reasons I cant make the A3 engine use my infantry model.

So I used a self made model, everything works in oxygen with textures etc.

The model shows up if I delcare it being a static item, but I would like to use it as a soldier ofcourse.

Maybe someone would be so kind as to tell me what i made wrong in my config.cpp and model.cfg

Config.cpp

class CfgPatches
{
          class myclass
          {
                       units[]={};
                       weapons[]={};
                       requiredVersion = 1;
                       requiredAddons[]={};
           };
};
class CfgVehicleClasses
{
           class myclass
           {
                        displayName="my_unit";
           };
};



class CfgVehicles
{
class B_Soldier_base_F;
class myclass: B_Soldier_base_F
{
	model="\myclass\myclass.p3d"; 
	scope=2;
	displayName="my_unit";
	hiddenSelections[]=
	{
		"Camo"
	};
};
};

and for the model cfg i only changed the bottom part to:

class CfgModels
{
class Default
{
	sectionsInherit="";
	sections[] = {};
	skeletonName = "";
};
class myclass : Default  <-------------- CHANGED!
{
	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[] =
	{
		"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","personality","hl", "injury_head"
	};
	skeletonName = "OFP2_ManSkeleton";
};
};

Thanks for any help.

---------- Post added at 13:58 ---------- Previous post was at 13:51 ----------

the unit shows up when I delcare it as a crate, but when I use it as a unit it just shows me the standard soldier

Edited by liukang168

Share this post


Link to post
Share on other sites

You are inheriting from class B_Soldier_base_F, try adding "A3_Characters_F" to requiredAddons[]={}; so your config knows where to find this external class.

Share this post


Link to post
Share on other sites

hi guys im trying to get a config file for a unit that i made... i got ittextured and weighed in object builder all i need is the config files to get it in game, i dont know much about programing and i was thinking to replace the p3d and the display name to make it work... thanks for any info or directions...!!!

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
Sign in to follow this  

×