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.

First, lets look at TextureOverride, this one is pretty straight forward when it comes to use. It's going to work RIGHT only when the mesh doesn't have more than 1 texture image in the material file.

For example, lets look at the material file of our mirka:

Here we see that, the mirka has 2 submeshes, but both point to the same texture image, making it possible for textureoverride to work right…

Now, prepare your eyes, 'cause I'm going to show you, what happens when Textureoverrite doesn't work right… For this example, we are gonna use a lovely Mimic.

This is the material file for the big mimic mesh:

Ok, here is a big difference, again 2 submeshes but this time they point to different image files. So if we apply texture override to the mimic, this is what happens:

Left the mimic with the mimic_chest_rare_01.png applied, and right the one with chest_rare_01.png applied. Kind of ugly,mmm… one looks a bit cool… but, that's what happens when TextureOverride doesn't work.

And Now, let's talk a bit about TextureReplace, as far as my testing goes… It will always work.

This makes TextureReplace look like the better of the two, but textureoverride is important 'cause it is the string used when you make skins for starting pets, since they use a Texture_override_list.

Lastly, there is one thing neither of this options can achieve, and that is to change the material properties.

For example: You want to have 2 monster, for example Dog and Ghost Dog, and you want the Ghost dog to be translucent… It doesn't matter how much alpha you put in your texture file, if the material file doesn't have alpha properties, it won't work.

So you will need to make a clone mesh to use a new material file. And example of this in the game files is the phase beast and the Jackal. So you could check that up for reference on translucent materials.

And that is all folks, hope you enjoy it, and find it useful.

textureoverride_vs_texturereplace_1.txt · Last modified: 2018/10/01 14:38 by anarch16sync