Jump to content
Sign in to follow this  
Cunico

Define more than one member in a Model.cfg?

Recommended Posts

Trying to put to members in the model.cfg but not sure how to do that. Any help?

---------- Post added at 11:05 ---------- Previous post was at 10:16 ----------

Let me clear up what I am trying to do. I have "1" .p3d model with a texture...I duplicated that same model and textured it differently,but when I go in game one is floating and tthe other isn't as if it doesn't have a model.cfg. So, this is all thats keeping me from releasing these addons but its a pain in the butttt. Thansk for the help in advance.

Share this post


Link to post
Share on other sites

Probably because you didn't actually define it in the model.cfg.

EVERY model (p3d file) must have its own entry in the file, and the entry MUST = the file name.

class cfgModels
{
class default;
class CSJ_P38 : default
{
  ....
  ....
  ....
};
class CSJ_P38_2 : CSJ_P38
{
  ....
  ....
  ....
};
};

In this example there are 2 P3D files. CSJ_P38.p3d and CSJ_P38_2.p3d

RECOMMEND

If you only have 1 or 2 textures different between 2 models, don't actually copy the model, its easier to use built in engine features to swap textures on ONE model.

Steps:

In your model, name the faces that have the texture(s) you want to change. Call it something like "skin" (and "skin2", "skin3" etc)

In the section[] part of the MODEL.CFG add these definitions.

class cfgModels
{
class default;
class CSJ_P38: default
{
	sectionsInherit="";
	skeletonName="CSJ_P38Skeleton";
	sections[] = 		
	{
		"skin", "vrtule staticka","vrtule staticka"
		...
		...

Then in CONFIG.CPP, in your first CFGVehicle entry;

class I44_Plane_P38_S : Plane
{
scope = public;
displayName = "P-38 Model S";
model = "\CSJ_P38\CSJ_P38.p3d";
hiddenSelections[]={"skin"};
hiddenSelectionsTextures[] = {"\csj_p38\data\p38_skin_A.paa"};
...
...

Then in your second CFGVehicle entry;

class I44_Plane_P38_Z : I44_Plane_P38_S
{
displayName = "P-38 Model Z";
hiddenSelectionsTextures[] = {"\csj_p38\data\p38_skin_B.paa"};
};

Thats it. Thats the whole cfgvehicle entry for the second unit if the only difference is a texture. Much simpler.

Good luck.

  • Like 1

Share this post


Link to post
Share on other sites

Thanks Gnat, I eventually figured it out but I will use this for future reference. Much appreciated.

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  

×