View Single Post
Old 04-05-09, 02:42 PM   #1013
skwasjer
The Old Man
 
Join Date: Apr 2007
Location: Netherlands
Posts: 1,547
Downloads: 26
Uploads: 3
Default

Quote:
Originally Posted by keltos01 View Post


S3D does not look in the texture directory but the .dat's directory for the texture !!!

I had to create a new separate dir with the gun.dat and the occlu and texture to test the .dat...

keltos
It does, but the search routines are a bit different from the game because S3D also has to take into account your mod directory. However, the local directory where the .DAT resides takes precedence over the global texture folder. Not only that, S3D takes this into account:

* Search local folder in your mod: <MODS>\<Your mod>\Data\<Folder with Dat-file>
* Search local folder when MOD is installed in game: Data\<Folder with Dat-file from your mod>
* Search global texture folder in your mod: <MODS>\<Your Mod>\Data\Textures\TNormal\tex
* Search global texture folder: Data\Textures\TNormal\tex

Additionally, S3D obviously also looks for internal textures.

As you can see, it's a little bit more complex than it appears

Conflicts can happen when the material is not set up correctly, like Nisgeis indicates, or when textures with the same name are used (and worse, stored in more than one of the locations mentioned above), resulting in incorrect representation in the 3D viewer. There's more odd scenario's possible when mods are intermixed, enabled over eachother, etc. where you expect a texture to show up, but S3D can't find it because it's outside its search path, or if S3D finds another (old one) first.

A good example of unexpected texture loaded is the prop_black.tga which comes with each airplane. The game has that file in the global texture folder but also each plane has it as internal texture. Replacing the internal texture will not yield expected result as the global texture is still used (it takes precendence over internal textures, although it makes more sense if it didn't). Only after removing the global texture will you see the new internal one.

I tried to best match the game load behavior but since mods during design time generally reside in their own \MODS location, I had to deviate from the game it's method of loading and resolving textures. That and the fact that it's not documented by Ubisoft how textures are resolved, all I could do was guess/test and try to come as close as possible.
skwasjer is offline   Reply With Quote