Jump to content
Sign in to follow this  
AlexVestin

Help. Is there a simple guide on how to retexture?

Recommended Posts

I'm in need of help. I've looked all over, but I can't seem to find a tutorial on how to retexture a unit or weapon. There's alot of reskins made for all kinds of things like vehicles, units and planes, but no real info on how to do it. I've checked the ArmA2 Editing section without finding anything related to the subject.

Let's say I want to retexture the XM8, how would I go on about doing that, and then make it into a standalone addon too so I can have both my retextures ones and the original?

Could someone maybe write up a very basic and simple 1,2,3 step guide? All help is apprecciated!

Share this post


Link to post
Share on other sites

First, you might look at some of the addons that have been retextured, as well as the original addons, find out who did them, and email them asking them how they went about learning to texture.

You might also want to think about just learning to "texture" as opposed to "retexturing," as everyone that makes a model and paints it had to learn somewhere.

If you typed "retexture" into the search forums here, it might not give you as many tuts as would just searching for "texture tutorial." I don't have the links at the moment, but try places like www.ofpec.com under their editing section and tutorials. I think you should look at google for things such as UV mapping, rvmats, etc, as I think all of these things are necessary for texturing a model either for the first time or making them the way you want texture wise.

AND, last but not least, don't forget to ask for permission before messing around with other people's intellectual property. :)

Good Luck

Share this post


Link to post
Share on other sites

I agree with Raptor 6, you should learn to texture first. If you understand how textures are created, and what makes good textures, retexturing existing models is far easier given the provided materials that come with one (normal maps, etc).

Share this post


Link to post
Share on other sites

My Advice would be start out learning with Johnnys SF MLOD Pack he thankfully made aviable to the community.

It includes PSD Files for all needed Textures such as the _co and _nohq files of his SF Soldiers.

Just taking a look into the files and realizing how they are made and operated might help you understand a basic method of texturing things for later use on 3d models.

Share this post


Link to post
Share on other sites

Here is a basic rundown:

1. Unpack the .pbo file that contains the gun you want to modify. Arma 2 weapons are in addons\weapons.pbo or addons\weapons2.pbo and Arma AO guns are in expansion\addons\weapons_e.pbo

2. use an unrapify program to convert the config.bin (unreadable) into a config.cpp (readable).

3. find and copy the class entry that defines your gun.

example is the M8 carbine, found in weapons2.pbo:

       class m8_carbine : m8_base
       {
               scope = public;
               value = 6;
               model = "\ca\weapons2\m8_carbine\m8_carbine";
               picture = "\CA\weapons2\data\W_m8_carbine_CA.paa";
               UiPicture = "\CA\weapons\data\Ico\i_regular_CA.paa";
               displayname = $STR_DN_XM8;
               muzzles[] = {this};

               class Library
               {
                       libTextDesc = $STR_LIB_XM8;
               };
               descriptionShort = $STR_DSS_XM8;
               dexterity = 1.8;
       };

Make a new folder in your main arma2 directory, name it something like @Alexmods

Make a new folder in that directory called AddOns

Make a new folder in that directory called AlexXM8

In that folder, make a new .txt file and rename it config.cpp

It should be mainarma2folder> @Alexmods> AddOns> AlexXM8> config.cpp

Paste the class info into the new config.cpp.

3. Because you are making a copy of an existing gun, you don't have much to do. All you have to do is inherit the existing class and make a new one.

Since you are only changing the model, anything that you won't be changing can be removed. Edit your new config.cpp to this:

       class m8_carbine;
       class Alex_m8_carbine : m8_carbine
       {
               model = "\ca\weapons2\m8_carbine\m8_carbine";
               picture = "\CA\weapons2\data\W_m8_carbine_CA.paa";
               UiPicture = "\CA\weapons\data\Ico\i_regular_CA.paa";
               displayname = "My XM8";
       };

note that the picture and uipicture entries would let you change the picture of the weapon in the gear selection menu, and the displayname is the name in game. Find the model in the directory defined in the model = "" entry and put it in your AlexXM8 folder. Change:

               model = "\ca\weapons2\m8_carbine\m8_carbine";

to

               model = "\AlexXM8\m8_carbine";

note that models are .p3d files.

You need to add a patch class to your config.cpp in order for arma 2 to use it. Add to the very top:

class CfgPatches
{
       class AlexXM8_patch
       {
               units[] = {};
               weapons[] = {};
               requiredVersion = 1.0;
               requiredAddons[] = {};
};
};

At this point you should be able to use a pbo packing tool to make it into a .pbo file. There is a million threads about how to install addons, so I won't go into that. In the mission editor, place a unit and add this to his command line:

removeallweapons this; this addmagazine "30Rnd_556x45_G36";this addweapon "Alex_m8_carbine"

Your new weapon is in the game, now you just have to edit the model and retexture it

End of Part 1

------------------------------------------------------------------------

Part Deuce

4. I'm not sure if there is any easier way or a program to do this, but I guess you just open the model with a hex editor, and search for all the textures that the model uses. search for .paa, .pac and .rvmat files. Find all these files in their respective directories and move them to your AlexXM8 directory.

5. Figure out what textures need to be edited. You need the bis tools to open any of the texture files. If you are just changing the guns color, you don't need to change the textures for the optics for example. This is where its completely up to your texture editing skills, there must be some good tutorials out there. For the sake of example, lets just say you had to retexture the \weapons2\m8_carbine\data\m8_grey_co.paa file.

6. Once the m8_grey_co file has been edited and reconverted back into a .paa file, you have to edit the model with a hex edit to change the file path.

Replace all instances of

\weapons2\m8_carbine\data\m8_grey_co.paa

with

\AlexXM8\m8_grey_co.paa

Make sure to back up everything, I think you may need to preserve the same number of characters when hex-editing the paths. If you need to, put your new textures in a folder so that it is easier to keep track of it.

\weapons2\m8_carbine\data\ uses 26 characters.

\AlexXM8\my_new_retexture\ uses 26 characters.

Only change instances of m8_grey_co.paa. Any good hex program should be able to do this.

6. Pack the folder into a .pbo and load it in Arma2 again, and your gun should be sporting the new textures!

Edited by Sakura_Chan
  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Would have been nice if hiddenSelections worked on weapons; that way, you could retexture weapons without a new model, like you can (some of the) vehicles.

---------- Post added at 02:49 ---------- Previous post was at 02:40 ----------

4. I'm not sure if there is any easier way or a program to do this, but I guess you just open the model with a hex editor, and search for all the textures that the model uses. search for .paa, .pac and .rvmat files. Find all these files in their respective directories and move them to your AlexXM8 directory.

MoveObject should be able to do that. I used it myself to replace textures on my own models. Should also work on binarised files, if I am not mistaken.

It allows you to specify a list of replacements in a file, something like:

path\of\original\texture.paa path\to\new\texture.paa

It can also list all the paths it finds in a file.

Share this post


Link to post
Share on other sites

Great I knew there was something like that out there. It has been a few years since I retextured something :3

Share this post


Link to post
Share on other sites
First, you might look at some of the addons that have been retextured, as well as the original addons, find out who did them, and email them asking them how they went about learning to texture.

You might also want to think about just learning to "texture" as opposed to "retexturing," as everyone that makes a model and paints it had to learn somewhere.

If you typed "retexture" into the search forums here, it might not give you as many tuts as would just searching for "texture tutorial." I don't have the links at the moment, but try places like www.ofpec.com under their editing section and tutorials. I think you should look at google for things such as UV mapping, rvmats, etc, as I think all of these things are necessary for texturing a model either for the first time or making them the way you want texture wise.

AND, last but not least, don't forget to ask for permission before messing around with other people's intellectual property. :)

Good Luck

Well, the 'texturing' part is not the problem at all. The process of getting the files ingame is the tricky area.

Garry's Mod AlexVestin?

Indeed!

Here is a basic rundown:

1. Unpack the .pbo file that contains the gun you want to modify. Arma 2 weapons are in addons\weapons.pbo or addons\weapons2.pbo and Arma AO guns are in expansion\addons\weapons_e.pbo

2. use an unrapify program to convert the config.bin (unreadable) into a config.cpp (readable).

3. find and copy the class entry that defines your gun.

example is the M8 carbine, found in weapons2.pbo:

       class m8_carbine : m8_base
       {
               scope = public;
               value = 6;
               model = "\ca\weapons2\m8_carbine\m8_carbine";
               picture = "\CA\weapons2\data\W_m8_carbine_CA.paa";
               UiPicture = "\CA\weapons\data\Ico\i_regular_CA.paa";
               displayname = $STR_DN_XM8;
               muzzles[] = {this};

               class Library
               {
                       libTextDesc = $STR_LIB_XM8;
               };
               descriptionShort = $STR_DSS_XM8;
               dexterity = 1.8;
       };

Make a new folder in your main arma2 directory, name it something like @Alexmods

Make a new folder in that directory called AddOns

Make a new folder in that directory called AlexXM8

In that folder, make a new .txt file and rename it config.cpp

It should be mainarma2folder> @Alexmods> AddOns> AlexXM8> config.cpp

Paste the class info into the new config.cpp.

3. Because you are making a copy of an existing gun, you don't have much to do. All you have to do is inherit the existing class and make a new one.

Since you are only changing the model, anything that you won't be changing can be removed. Edit your new config.cpp to this:

       class m8_carbine;
       class Alex_m8_carbine : m8_carbine
       {
               model = "\ca\weapons2\m8_carbine\m8_carbine";
               picture = "\CA\weapons2\data\W_m8_carbine_CA.paa";
               UiPicture = "\CA\weapons\data\Ico\i_regular_CA.paa";
               displayname = "My XM8";
       };

note that the picture and uipicture entries would let you change the picture of the weapon in the gear selection menu, and the displayname is the name in game. Find the model in the directory defined in the model = "" entry and put it in your AlexXM8 folder. Change:

               model = "\ca\weapons2\m8_carbine\m8_carbine";

to

               model = "\AlexXM8\m8_carbine";

note that models are .p3d files.

You need to add a patch class to your config.cpp in order for arma 2 to use it. Add to the very top:

class CfgPatches
{
       class AlexXM8_patch
       {
               units[] = {};
               weapons[] = {};
               requiredVersion = 1.0;
               requiredAddons[] = {};
};
};

At this point you should be able to use a pbo packing tool to make it into a .pbo file. There is a million threads about how to install addons, so I won't go into that. In the mission editor, place a unit and add this to his command line:

removeallweapons this; this addmagazine "30Rnd_556x45_G36";this addweapon "Alex_m8_carbine"

Your new weapon is in the game, now you just have to edit the model and retexture it

End of Part 1

------------------------------------------------------------------------

Part Deuce

4. I'm not sure if there is any easier way or a program to do this, but I guess you just open the model with a hex editor, and search for all the textures that the model uses. search for .paa, .pac and .rvmat files. Find all these files in their respective directories and move them to your AlexXM8 directory.

5. Figure out what textures need to be edited. You need the bis tools to open any of the texture files. If you are just changing the guns color, you don't need to change the textures for the optics for example. This is where its completely up to your texture editing skills, there must be some good tutorials out there. For the sake of example, lets just say you had to retexture the \weapons2\m8_carbine\data\m8_grey_co.paa file.

6. Once the m8_grey_co file has been edited and reconverted back into a .paa file, you have to edit the model with a hex edit to change the file path.

Replace all instances of

\weapons2\m8_carbine\data\m8_grey_co.paa

with

\AlexXM8\m8_grey_co.paa

Make sure to back up everything, I think you may need to preserve the same number of characters when hex-editing the paths. If you need to, put your new textures in a folder so that it is easier to keep track of it.

\weapons2\m8_carbine\data\ uses 26 characters.

\AlexXM8\my_new_retexture\ uses 26 characters.

Only change instances of m8_grey_co.paa. Any good hex program should be able to do this.

6. Pack the folder into a .pbo and load it in Arma2 again, and your gun should be sporting the new textures!

Thanks you! I haven't read through it all in detail, but I'm pretty sure this'll help! This is the exact kind of info that should be stickied somewhere!

Thank you once again for taking the time to write that up.

All replies to this thread have been much appreciated!

Edited by AlexVestin

Share this post


Link to post
Share on other sites

Welcome to BIF, hopefully your work will be as good here as it is in Garry's Mod.

Share this post


Link to post
Share on other sites

I get the error:

No entry 'bin\config.bin/CfgWeapons.Alex_m8_carbine'.

if I place a soldier in the editor with your provided init line and try to preview the mission.

Here's how my folders look like:

Alex_XM8/config.cpp
Alex_XM8/m8_carbine/m8_carbine.p3d
Alex_XM8/m8_carbine/data/m8_grey_co.paa

Here's my config:

class CfgPatches
{
class Alex_XM8_patch
{
	units[] = {};
	weapons[] = {};
	requiredVersion = 1.0;
	requiredAddons[] = {};
};
};
class m8_carbine;
class Alex_m8_carbine : m8_carbine
{
	model = "\Alex_XM8\m8_carbine";
	picture = "\CA\weapons2\data\W_m8_carbine_CA.paa";
	UiPicture = "\CA\weapons\data\Ico\i_regular_CA.paa";
	displayname = "My XM8";
};

On all addons I've checked, there's a "Config.bin" file. My config is just a "Config.cpp". Could that make any difference? I did use a hex editor to change te texture paths to the new one in the .p3d model file.

Do I need to provide any other kind of info to make it easier to help?

/EDIT

I just noticed my Config was a .ccp instead of a .cpp

Going to fix that, but I don't think that is the problem.

Edited by AlexVestin

Share this post


Link to post
Share on other sites

BUMP, instead of creating a new thread. Same topic. Still not getting this to work.

Would this work if I wanted to just have set of copied XM8's ingame?

To just make them "hexed" if people are familiar with the term.

My folder setup looks like this:

GR_XM8_pack\config.bin
GR_XM8_pack\GR_XM8\m8_carbine.p3d
GR_XM8_pack\GR_XM8\m8_carbineGL.p3d
GR_XM8_pack\GR_XM8\m8_compact.p3d
GR_XM8_pack\GR_XM8\m8_SAW.p3d
GR_XM8_pack\GR_XM8\m8_Sharpshooter.p3d

Check my config:

class CfgPatches
{
       class GR_XM8_pack_patch
       {
               units[] = {};
               weapons[] = {};
               requiredVersion = 1.0;
               requiredAddons[] = {};
};
};
class m8_carbine;
class XM8 : m8_carbine
{
	model="\GR_XM8\m8_carbine";
	picture="\CA\weapons2\data\W_m8_carbine_CA.paa";
	UiPicture="\CA\weapons\data\Ico\i_regular_CA.paa";
	displayname="XM8";
};
class m8_carbineGL;
class XM8_XM320 : m8_carbine
{
	model="\GR_XM8\m8_carbineGL";
	picture="\CA\weapons2\data\W_m8_carbineGL_CA.paa";
	UiPicture="\CA\weapons\data\Ico\i_regular_CA.paa";
	displayname="$STR_DN_XM8_GL";
};
class m8_compact;
class XM8_Compact : m8_carbine
{
	model="\GR_XM8\m8_compact";
	picture="\CA\weapons2\data\W_m8_compact_CA.paa";
	UiPicture="\CA\weapons\data\Ico\i_regular_CA.paa";
	displayname="$STR_DN_XM8_COMPACT";
};
class m8_sharpshooter;
class XM8_Sharpshooter : m8_carbine
{
	model="\GR_XM8\m8_sharpshooter";
	picture="\CA\weapons2\data\W_m8_sharpshooter_CA.paa";
	UiPicture="\CA\weapons\data\Ico\i_sniper_CA.paa";
	displayname="$STR_DN_XM8_LONG";
	};
};
class m8_SAW;
class XM8_SAW : m8_carbine
{
	model="\GR_XM8\m8_SAW";
	picture="\CA\weapons2\data\W_m8_SAW_CA.paa";
	UiPicture="\CA\weapons\data\Ico\i_mg_CA.paa";
	displayname="$STR_DN_XM8_SAW";
};
};

This is the best I could make of what I've been told.

This part is what makes me wonder:

class m8_carbine;
class XM8 : m8_carbine

Edited by AlexVestin

Share this post


Link to post
Share on other sites

You'll probably get more and better response in the Addons editing section....moving, fasten your seat belts.

:EDITH:

Some little info:

config.bin == config.cpp

Whenever you open addons, they usually are binarized (BinPBO can binarize). Binarized addons are easier and faster for the game to load. In this process, the config.cpp is converted into config.bin(arized).

Simple as that. :D

Edited by [FRL]Myke

Share this post


Link to post
Share on other sites

Ah, thank you for the move.

I need a response on this, cause I don't know at all what to try.

What I'm trying to do right now is get the XM8's working ingame. Afterwards I'll retexture them. For now, just get them ingame.

I'm uncertain on how "class" works, and how "Displayname" works. "Displayname" seems to link them to an already existing setup for the rifle, or is that the "class"? I'm really confused on this.

What can I do to make the things I've got in my post above, work ingame as a copied XM8 with the same stats and everything as the original?

/ I made it a config.ccp now, and I got this error when using BinPBO, this is the log:

Error reading binary file 'p:\projects\ghostmod\@ghostmod\addons\gr_xm8_pack\config.cpp'
Config : some input after EndOfFile.
Error 3 while parsing
Error in config p:\projects\ghostmod\@ghostmod\addons\gr_xm8_pack\config.cpp
Config : some input after EndOfFile.
Error 3 while parsing
Error in config p:\projects\ghostmod\@ghostmod\addons\gr_xm8_pack\config.cpp
Cannot load font core\data\fonts\lucidaconsoleb8
Fonts file \core\data\fonts\lucidaConsoleB8 not found
Cannot load font core\data\fonts\lucidaconsoleb11
Fonts file \core\data\fonts\lucidaConsoleB11 not found
<model = "p:\projects\ghostmod\@ghostmod\addons\gr_xm8_pack\GR_XM8\m8_carbine.p3d">

Edited by AlexVestin

Share this post


Link to post
Share on other sites

You're missing "CfgWeapons".

It should be formatted something like this.

class CfgPatches {
class M16a3 {
	Units[] = {};
	weapons[] = {"M16a3"};
	requiredVersion = 1.60;
	requiredAddons[] = {"CAWeapons"};
};
};

class CfgWeapons {
class M16a2;

class M16a3 : M16a2 {
	displayname = "My M16a3";
	descriptionshort = "Full auto M16";
	class Library {
		libtextdesc = "The full auto version of the M16a2.";
	};
               class Semi : Mode_SemiAuto {
		AiRateOfFire = 1;
		ReloadTime=0.0667;
		AiRateOfFireDistance = 550;
		Dispersion = 0.00175;
		MaxRange = 500;
		MaxRangeProbab = 0.1;
		MidRange = 200;
		MidRangeProbab = 0.5;
		MinRange = 0;
		MinRangeProbab = 0.7;
		Recoil = "scar_lrecoil";
		Recoilprone = "scar_lrecoilprone";
		Begin1[] = {"\ca\weapons\sound\m16.wav",1.77828,1,1100};
		SoundBegin[] = {"begin1",1};
	};
	class FullAuto : Mode_FullAuto {
		AiRateOfFire = 1;
		ReloadTime=0.0667;
		AiRateOfFireDistance = 550;
		Dispersion = 0.00175;
		MaxRange = 500;
		MaxRangeProbab = 0.1;
		MidRange = 200;
		MidRangeProbab = 0.5;
		MinRange = 0;
		MinRangeProbab = 0.7;
		Recoil = "scar_lrecoil";
		Recoilprone = "scar_lrecoilprone";
		Begin1[] = {"\ca\weapons\sound\m16.wav",1.77828,1,1100};
		SoundBegin[] = {"begin1",1};
	};
};
};

To answer your question, using this example, M16a2 is the base class (Which everything in my weapon is taken from, unless I give it different properties.). "M16a3" is my weapon's class, which the game uses to keep track of things. Display name is just a label so the end user knows what it is.

Think of the class-name as the folder you have your Lua stuff in, only you can call on other folders and base your Lua files off of them.

Edited by b00ce

Share this post


Link to post
Share on other sites

Well. Thanks to that, I think I've made some progress understanding atleast! I still get a weird error ingame, though. If I type in the init line:

removeallweapons this; this addweapon "XM8"

It tells me exactly this:

Cannot open object gr_xm8_pack\gr_xm8\m8_carbine.p3d (magic)

If I try to use the XM8 compact I get this:

Cannot open object gr_xm8_pack\gr_xm8\m8_compact.p3d

Only the first one had the "(Magic)" part there.

Here's my config and what it looks like now:

class CfgPatches
{
class GR_XM8_pack
{
	units[]={};
	weapons[]={xm8,xm8_xm320,xm8_compact,xm8_sharpshooter,xm8_lmg};
	requiredVersion=1.6;
	requiredAddons[]={"CAweapons2"};
};
};

class CfgWeapons
{
class m8_carbine;
class xm8 : m8_carbine
{
	displayname="XM8 Carbine (Gray)";
	model="\GR_XM8_pack\GR_XM8\m8_carbine";
	picture="\CA\weapons2\data\W_m8_carbine_CA.paa";
	descriptionShort="Standard Carbine.";
	class Library
	{
		libTextDesc="XM8 Standard carbine version.";
	};
};
class m8_carbineGL;
class xm8_xm320 : m8_carbineGL
{
	displayname="XM8 XM320 (Gray)";
	model="\GR_XM8_pack\GR_XM8\m8_carbineGL";
	picture="\CA\weapons2\data\W_m8_carbineGL_CA.paa";
	descriptionShort="Carbine W/ GL";
	class Library
	{
		libTextDesc="XM8 Standard carbine version with attached XM320 grenade launcher.";
	};
};
class m8_compact;
class xm8_compact : m8_compact
{
	displayname="XM8 Compact (Gray)";
	model="\GR_XM8_pack\GR_XM8\m8_compact";
	picture="\CA\weapons2\data\W_m8_compact_CA.paa";
	descriptionShort="Short version.";
	class Library
	{
		libTextDesc="XM8 Compact version with shortened barrel.";
	};
};
class m8_sharpshooter;
class xm8_sharpshooter : m8_sharpshooter
{
	displayname="XM8 Sharpshooter (Gray)";
	model="\GR_XM8_pack\GR_XM8\m8_sharpshooter";
	picture="\CA\weapons2\data\W_m8_sharpshooter_CA.paa";
	descriptionShort="Long version.";
	class Library
	{
		libTextDesc="XM8 Sharpshooter version with lengthened barrel.";
	};
};
class m8_SAW;
class xm8_lmg : m8_SAW
{
	displayname="XM8 LMG (Gray)";
	model="\GR_XM8_pack\GR_XM8\m8_SAW";
	picture="\CA\weapons2\data\W_m8_SAW_CA.paa";
	descriptionShort="LMG version.";
	class Library
	{
		libTextDesc="XM8 Light machine gun version with drum mag, lengthened barrel and bipod.";
	};
};
};

Help is still greatly appreciated!

/EDIT

I just changed:

	model="\GR_XM8_pack\GR_XM8\m8_carbine";

to:

	model="P:\PROJECTS\GhostMod\@GhostMod\AddOns\GR_XM8_pack\GR_XM8\m8_carbine";

And it seems to work.. Why is that so?

Edited by AlexVestin

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  

×