User Tools

Site Tools


Sidebar

Torchmodders Site


Wiki Navigation

textureoverride_vs_texturereplace_1

Texture Override vs. Texture Replace (How, When and Why)

by Anarch16sync

Well, this is my first real tutorial, so bear with me for a second, more than a tutorial it is a reference to the difference between this two properties in the units editor.

First, these two properties have the function to replace the texture of a model in-game, so using this we don't need to have multiple meshes to use different material. Normaly this doesn't really matter, since one or two extra meshes won't bloat the mod size, but for the sake of optimization this should be the way to go.

Now,

How to use these properties

Like in a lot of things there are two ways to do this, one is to edit the unit .dat file directly with notepad, notepad+ or the text editor of your preference, and the other way is using the GUTS Units editor.

A. For TextureOverride:

1. Direct edit .DAT file

Editing the .dat file directly, the line that needs to be re-writen is:

<STRING>TEXTURE_OVERRIDE:media\models\monsters\mirka\mirka2.dds

and point it to the new texture to use, in this case to the second Mirka texture.

2. In Guts

We need to go to: Data Editors, Units and then the type of unit we want to edit since all the editors have the field for this option.

  • In the Items editor and the props, the field is in the top zone, under the mesh field.
  • In the Monster editor and the player editor, the field is in the “Files” tab.

Now, just like in the dat file this field should be filled with the relative direction of the texture file

Now lets see the results:

Left we have the normal mirka with the texture defined in the material file, and right we have the one with the textureoverride string added, both using the same mesh.

Now, let's see how to use TextureReplace.

B. For Texture Replace

1. Direct edit .DAT file

If we want to edit the .dat file directly, the code will be:

	[TEXTURE_REPLACE]
		<STRING>NAME:sturm_melee_mat
		<STRING>TEXTURE:media/models/monsters/Corrupted_Sturmbeorn/C_sturm_melee/sturm_melee2.dds
	[/TEXTURE_REPLACE]

In the NAME field, we need to write the internal material name . This is the name of the material that appears inside the .material file (open it with notepad++ or other text editor to see it). Just like in TextureOverride, in the TEXTURE field we use the relative direction of the new texture file.

2.In GUTS

Just like with TextureOverride we need to go to any of the units editor, and there to the “TextureReplace” tab, there we find a table with both fields, MATERIALNAME and TEXTUREFILE.

And the results are:

Left we have the Sturmbeorn with the TextureReplace strings, and right we have the normal sturmbeorn, with the original texture defined in the material file.

Now, you are going to say… “Both do the same thing, DUH!” But you can't use them in every mesh, well you can't use TextureOverride in every mesh. So that makes for the second part of this… when to use one or the other.

To be Continued

textureoverride_vs_texturereplace_1.txt · Last modified: 2014/09/09 09:51 by phanjam