Jump to content
ahmedslimkw

(SOLVED) How to configure cfgFaces

Recommended Posts

@Velocity-Overdrive - let us know if you're still having issues, I'll setup a sample for you :) And welcome to the wonderful world of Arma modding and script writing! :D

  • Like 1

Share this post


Link to post
Share on other sites

@Velocity-Overdrive - let us know if you're still having issues, I'll setup a sample for you :) And welcome to the wonderful world of Arma modding and script writing! :D

Thanks for the welcome! Il definitely let ya all know if I need any help :) Hopefully once KokaKola gets online I could learn a thing or two from his help :D

Share this post


Link to post
Share on other sites

Okay mate, let me see if I can break it down a bit for you - I remember starting out with configs, and it can be very intimidating if you're not too familiar with coding etc. (I had no idea what I was doing at the time, and the poor suffering souls on this forum helped me through, lol!)

 

You know some of the below already, but I'll post it here for future users too :P

 

First thing's first, we need a config.cpp file. Open up a notepad document and enter something similar to the following:

class CfgPatches
{
	class Name_of_your_Mod
	{
		units[]={};
		weapons[]={};
		requiredVersion=1;
		requiredAddons[]=
		{
			"a3_map_stratis",
			"a3_map_altis"
		};
	};
};

Make a note of the braces (e.g. { and }). These represent a subsection, so to speak. Therefore, for every opening brace (or {) you will, at some point, need to close it with a closing brace (or }). In the example above, which you will usually find at the beginning of most mod configs, there are 3 x { and 3 x }. Indeed, if we were to stop our config here, we would not run into any errors, as the braces are effectively closed and the config information is encased within them. 

 

Next, we need to define your custom head. To do this, we need to add an entry into the cfgFaces directory. Here is a simple example I prepared earlier (the text in red with the forward slashes, is a comment, and can be left in the code without causing errors):

class CfgFaces // Defines the config directory
{
    class Default
    {
        class Custom;
    };
	class Man_A3: Default // Defines the config sub-directory
	{
		class WhiteHead_01; // Defines the actual face we wish to edit. In this case, think of it as the base class, from which you want to work. Each of the different faces in Arma 3 has a unique classname. If you want to inherit certain properties from an existing face, you will need to enter the relevant classname here.        class Steinacher_Killed: WhiteHead_01
                
                class New_Face_01: WhiteHead_01 // 'New_Face_01' is the classname we wish to give our face - feel free to change it, by all means. Avoid spaces. Don't forget, you'll need to add the classname it's inheriting from afterwards (New_Face_01 : Whitehead_01), which needs to be defined (like above ^^). 
                {
                        displayname="New Face 01"; // Between the quotation marks, add the name of your face. This is how it will appear in the Virtual Arsenal etc. This can also begin with the prefix '$STR' (e.g. "$STR_New_Face_01"); but that's for localization purposes, I won't get bogged down in those details here. I only mention it, in case you see it elsewhere and wonder what it's all about.
                        dlc="My_Amazing_Mod"; // You'll probably just want to delete this line. But if you want your face to have a DLC symbol, you'll need to add another config entry. Let's not worry about this right now! 
                        texture="Path_to_my_Texture.paa"; // This is a very important line! Be sure to check it for typos. An example path to the texture file could look something like this: "\Resist\Heads\Data\Steinacher_co.paa". This would mean, we have a PBO entitled 'Resist', with a folder in it entitled 'Heads', and a folder in that entitled 'Data', and, finally, in that, a .paa file entitled 'Steinacher_co.paa'. I would recommend adding the '_co' suffix for the main colour texture you've created. 
                        head="DefaultHead_A3"; // The actual model for your custom face. For instance, if you used Stavrou's head, with the pony tail, the physical shape of the head would be different and therefore, would have a different entry here. Most just use the default head defined here.
                        identityTypes[]={}; // This is used to identify which units will have your custom face by default; you can leave it alone, it's not really important for what you're trying to achieve.
                        author="Kydoimos"; // Your name goes here :) 
                        material="Path_to_my_Material.rvmat"; // This is another very important line! Depending on just how good you want your face to look, you may want to add a custom RVMAT, with accompanying specular (SMDI) and normal map (NOHQ) textures. Though a vital part of custom faces, I really can't go into too much detail here, as it's quite an in-depth subject and an art form in its own right! If you've only made minor changes to an existing face texture, you should be able to get away with inheriting the standard RVMAT - which you can do by deleting this line entirely. 
                        textureHL="\A3\Characters_F\Heads\Data\hl_white_bald_co.paa"; // Path to texture for hands and legs (HL). You shouldn't need to change this.
                        materialHL="\A3\Characters_F\Heads\Data\hl_white_bald_muscular.rvmat"; // Path to material (RVMAT) for hands and legs (HL). You shouldn't need to change this.
                        textureHL2="\A3\Characters_F\Heads\Data\hl_white_bald_co.paa"; // Second path (anyone know why there's an HL2?) to texture for hands and legs (HL). You shouldn't need to change this.
                        materialHL2="\A3\Characters_F\Heads\Data\hl_white_bald_muscular.rvmat"; // Second path (anyone know why there's an HL2?) to material for hands and legs (HL). You shouldn't need to change this.
                        materialWounded1="Path_to_Face_Material_when_Wounded.rvmat"; // Path to a wounded face texture. I'd recommend using the same path as the 'material=' path for your face, if you want an easy ride. Add a wounded texture if you fancy getting a bit more creative.
                        materialWounded2="Path_to_Face_Material_when_Wounded.rvmat"; // Second path to a wounded face texture (again, not too sure why we have two; though I'm sure some bright spark will let me know! :D)
        };
    };
};

And that's pretty much it! You just need to make sure you have the right files in the right places. RVMATs are going to be something else you'll want to look at too - I'll do an example for one another night, should you need it.

 

Good luck!

  • Like 1

Share this post


Link to post
Share on other sites

Alright i can't get it to work...

 

Anyway here are some little improvements:

class CfgPatches {
 class Renegade { // << CHANGE THIS
  units[] = {};
  weapons[] = {};
  requiredVersion = 0.1;
  requiredAddons[] = {};
 };
};

class CfgFaces 
{
 class Default; // held in engine's ca_bin
 class Man: Default
 {
  class Default; // held in ca_chars
  class sotirisFace: Default // << CHANGE THIS
  {
      author = "Velocity-Overdrive";
      displayname = "Sotiris";
      name = "Sotiris"; // every class, different string name
      texture = "\Renegade\Data\Sotiris.paa"; // This needed enclosing in quotation marks and a preceeding back-slash
      head= "m_white_04"; //classname in cfgHeads
      material= "\Renegade\data\m_white_04.rvmat";
      disabled = false; // always TRUE for inherited camo faces
  };
 };
};

These improvements make it not work, of course, but they are needed to make your addon a bit better...

 

 

@Kydoimos it would be great if you could post the samples, thanks for that!

 

Nevermind, i was typing while you already posted it...

  • Like 1

Share this post


Link to post
Share on other sites

Okay mate, let me see if I can break it down a bit for you - I remember starting out with configs, and it can be very intimidating if you're not too familiar with coding etc. (I had no idea what I was doing at the time, and the poor suffering souls on this forum helped me through, lol!)

 

You know some of the below already, but I'll post it here for future users too :P

 

First thing's first, we need a config.cpp file. Open up a notepad document and enter something similar to the following:

class CfgPatches
{
	class Name_of_your_Mod
	{
		units[]={};
		weapons[]={};
		requiredVersion=1;
		requiredAddons[]=
		{
			"a3_map_stratis",
			"a3_map_altis"
		};
	};
};
Make a note of the braces (e.g. { and }). These represent a subsection, so to speak. Therefore, for every opening brace (or {) you will, at some point, need to close it with a closing brace (or }). In the example above, which you will usually find at the beginning of most mod configs, there are 3 x { and 3 x }. Indeed, if we were to stop our config here, we would not run into any errors, as the braces are effectively closed and the config information is encased within them. 

 

Next, we need to define your custom head. To do this, we need to add an entry into the cfgFaces directory. Here is a simple example I prepared earlier (the text in red with the forward slashes, is a comment, and can be left in the code without causing errors):

class CfgFaces // Defines the config directory
{
	class Man_A3: Default // Defines the config sub-directory
	{
		class WhiteHead_01; // Defines the actual face we wish to edit. In this case, think of it as the base class, from which you want to work. Each of the different faces in Arma 3 has a unique classname. If you want to inherit certain properties from an existing face, you will need to enter the relevant classname here.        class Steinacher_Killed: WhiteHead_01
                
                class New_Face_01: WhiteHead_01 // 'New_Face_01' is the classname we wish to give our face - feel free to change it, by all means. Avoid spaces. Don't forget, you'll need to add the classname it's inheriting from afterwards (New_Face_01 : Whitehead_01), which needs to be defined (like above ^^). 
                {
                        displayname="New Face 01"; // Between the quotation marks, add the name of your face. This is how it will appear in the Virtual Arsenal etc. This can also begin with the prefix '$STR' (e.g. "$STR_New_Face_01"); but that's for localization purposes, I won't get bogged down in those details here. I only mention it, in case you see it elsewhere and wonder what it's all about.
                        dlc="My_Amazing_Mod"; // You'll probably just want to delete this line. But if you want your face to have a DLC symbol, you'll need to add another config entry. Let's not worry about this right now! 
                        texture="Path_to_my_Texture.paa"; // This is a very important line! Be sure to check it for typos. An example path to the texture file could look something like this: "\Resist\Heads\Data\Steinacher_co.paa". This would mean, we have a PBO entitled 'Resist', with a folder in it entitled 'Heads', and a folder in that entitled 'Data', and, finally, in that, a .paa file entitled 'Steinacher_co.paa'. I would recommend adding the '_co' suffix for the main colour texture you've created. 
                        head="DefaultHead_A3"; // The actual model for your custom face. For instance, if you used Stavrou's head, with the pony tail, the physical shape of the head would be different and therefore, would have a different entry here. Most just use the default head defined here.
                        identityTypes[]={}; // This is used to identify which units will have your custom face by default; you can leave it alone, it's not really important for what you're trying to achieve.
                        author="Kydoimos"; // Your name goes here :) 
                        material="Path_to_my_Material.rvmat"; // This is another very important line! Depending on just how good you want your face to look, you may want to add a custom RVMAT, with accompanying specular (SMDI) and normal map (NOHQ) textures. Though a vital part of custom faces, I really can't go into too much detail here, as it's quite an in-depth subject and an art form in its own right! If you've only made minor changes to an existing face texture, you should be able to get away with inheriting the standard RVMAT - which you can do by deleting this line entirely. 
                        textureHL="\A3\Characters_F\Heads\Data\hl_white_bald_co.paa"; // Path to texture for hands and legs (HL). You shouldn't need to change this.
                        materialHL="\A3\Characters_F\Heads\Data\hl_white_bald_muscular.rvmat"; // Path to material (RVMAT) for hands and legs (HL). You shouldn't need to change this.
                        textureHL2="\A3\Characters_F\Heads\Data\hl_white_bald_co.paa"; // Second path (anyone know why there's an HL2?) to texture for hands and legs (HL). You shouldn't need to change this.
                        materialHL2="\A3\Characters_F\Heads\Data\hl_white_bald_muscular.rvmat"; // Second path (anyone know why there's an HL2?) to material for hands and legs (HL). You shouldn't need to change this.
                        materialWounded1="Path_to_Face_Material_when_Wounded.rvmat"; // Path to a wounded face texture. I'd recommend using the same path as the 'material=' path for your face, if you want an easy ride. Add a wounded texture if you fancy getting a bit more creative.
                        materialWounded2="Path_to_Face_Material_when_Wounded.rvmat"; // Second path to a wounded face texture (again, not too sure why we have two; though I'm sure some bright spark will let me know! :D)
        };
    };
};
And that's pretty much it! You just need to make sure you have the right files in the right places. RVMATs are going to be something else you'll want to look at too - I'll do an example for one another night, should you need it.

 

Good luck!

  

Alright i can't get it to work...

 

Anyway here are some little improvements:

class CfgPatches {
 class Renegade { // << CHANGE THIS
  units[] = {};
  weapons[] = {};
  requiredVersion = 0.1;
  requiredAddons[] = {};
 };
};

class CfgFaces 
{
 class Default; // held in engine's ca_bin
 class Man: Default
 {
  class Default; // held in ca_chars
  class sotirisFace: Default // << CHANGE THIS
  {
      author = "Velocity-Overdrive";
      displayname = "Sotiris";
      name = "Sotiris"; // every class, different string name
      texture = "\Renegade\Data\Sotiris.paa"; // This needed enclosing in quotation marks and a preceeding back-slash
      head= "m_white_04"; //classname in cfgHeads
      material= "\Renegade\data\m_white_04.rvmat";
      disabled = false; // always TRUE for inherited camo faces
  };
 };
};
These improvements make it not work, of course, but they are needed to make your addon a bit better...

 

 

@Kydoimos it would be great if you could post the samples, thanks for that!

 

Nevermind, i was typing while you already posted it...

Both of you are a star! Thanks a million! Will try it out and report in. Thank you for breaking it up and releasing some samples Kydoimos! With that people will find it very useful! And thanks KokaKola for your help! :D

It all makes sense now :)

Thanks a lot!

  • 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

×