Do textures in tex/true need to be declared somewhere?

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

Post Reply
bounty_hunter66
Posts: 550
Joined: Tue, 15. Aug 06, 13:36
x4

Do textures in tex/true need to be declared somewhere?

Post by bounty_hunter66 » Thu, 28. Oct 21, 14:20

Hello,

I am trying to mod laser muzzle flashes(Launch effects) but I ran into a problem.

Let's take the HEPT laser as an example:

-I made my own bitmap texture file called "1237.jpeg" and placed it in tex/true
-inside the bod file (that is referenced in the scene file that is used for effect 24 used by HEPT), I changed the number representing the reference to the texture file(original is 376), to the name of my own texture file(1237)
-however it did not work, when firing the gun in the game, the effect is just a black mass

Instead if I leave the material reference as the original one(376) and instead simply replace the file tex/true/376.jpeg with my own image, then it works.

Do i need to declare new textures I add in tex/true somewhere in an XML file in order for the game to pick them up?

Please help !

Thanks

User avatar
Zeron-mk7
Posts: 571
Joined: Sat, 23. Feb 08, 12:38
x3

Re: Do textures in tex/true need to be declared somewhere?

Post by Zeron-mk7 » Tue, 2. Nov 21, 16:44

Do i need to declare new textures I add in tex/true somewhere in an XML file in order for the game to pick them up?
As far I know (if remember correctly), there are no such file, must be correctly defined texture name/number into the 3D bod file and mod cat/dat address to texture, like "tex/true/" for numbered textures.
Instead if I leave the material reference as the original one(376) and instead simply replace the file tex/true/376.jpeg with my own image, then it works.
Check if correctly texture name is written into the bod file in the textures parameters.
Image

bounty_hunter66
Posts: 550
Joined: Tue, 15. Aug 06, 13:36
x4

Re: Do textures in tex/true need to be declared somewhere?

Post by bounty_hunter66 » Tue, 2. Nov 21, 19:43

Hello,

Thanks for your reply.

The HEPT bullet launch effect is "24". Effect "24" is composed from 3 effects. Let's look at the first one just as an example(it's the green "flame" of the HEPT laser), it points to scene file 4252

Scene file 4252 looks like this:

Code: Select all

/===============================================================
/ 3D Scene Information from 3ds file: f:\src\xtract\export\04252.3ds
/===============================================================
VER: 3;
P 0; B 444;
  { 2;  0; 0; 0;  0.000000; 0.000000; 0.000000; 0.000000;  75;  1; } // 0
  { 18;  0.500000; 0.000000; 0.000000; -1.000000;  75;  2; } // 1
  { 18;  0.500000; 0.000000; 0.000000; -1.000000;  -1;  -1; } // 2
So it uses body file 444. Looking into body file 444 we see(truncated, content is longer):

Code: Select all

/===============================================================
/ Automatically generated bodyfile. from 3ds file: f:\src\xtract\export\00444.3ds
/===============================================================



MATERIAL3: 0;376; 150;150;150;  150;150;150;  229;229;229; 49;100;10;0; 1;1;0; 100; 0;0; 0;0; 


1000; / Automatic Object Size

/Center: 0, 0, 1031
-10085; 0; 98969; /0 (ex 2)
-10084; 0; -489; /1 (ex 0)
10086; 0; 98969; /2 (ex 3)
10085; 0; -489; /3 (ex 1)
0; -10085; 98969; /4 (ex 6)
0; -10084; -489; /5 (ex 4)
0; 10086; 98969; /6 (ex 7)
That first line "MATERIAL3: 0;376;". 376 is the name of the texture file it uses. I tried changing that to the name of my texture file(pretty sure I put it correctly). But I put it exactly as "1237".
As far I know (if remember correctly), there are no such file, must be correctly defined texture name/number into the 3D bod file and mod cat/dat address to texture, like "tex/true/" for numbered textures.
Do you mean I have to give it the full path ?

Like:

Code: Select all

MATERIAL3: 0;tex/true/1237; 150;150;150;  150;150;150;  229;229;229; 49;100;10;0; 1;1;0; 100; 0;0; 0;0; 

bounty_hunter66
Posts: 550
Joined: Tue, 15. Aug 06, 13:36
x4

Re: Do textures in tex/true need to be declared somewhere?

Post by bounty_hunter66 » Wed, 3. Nov 21, 15:09

Writing it with the full path as "tex/true/1237" or even with the file extension "1237.jpg" will cause X3 to crash when I fire the weapon . So this is out of the question. The only way it works is to write it as only the filename(without extension)

I am 100% sure I am writing the name of my texture correctly. I know this because when I import my body file into 3ds max, it loads correctly with my custom texture. It simply refuses to display correctly in game.

What is strange is that this only happens with objects that are part of scenes. This never happens when I mod "bullet" objects for example.

Any ideas?

User avatar
Zeron-mk7
Posts: 571
Joined: Sat, 23. Feb 08, 12:38
x3

Re: Do textures in tex/true need to be declared somewhere?

Post by Zeron-mk7 » Wed, 3. Nov 21, 17:00

If into the BOD file texture parameters are like this, with MATERIAL3:

Code: Select all

MATERIAL3: 0;39; 16;46;14;  51;141;45;  229;229;229; 0;0;25;5; 0;0;0; 100; 0;0; 0;0;
39.jpg texture will loaded automatically only from tex/true/ folder, in that case don't need to write address to texture in bod file, you need to put your texture in the mod with address to texture - tex\true\39.jpg

If you have MATERIAL6: in the bod file, then you need to write address to texture - environments\asteroids\asteroids_02_diff.dds and put texture in the mod also in the same address environments\asteroids\asteroids_02_diff.dds.

Code: Select all

MATERIAL6: 0; 0x2000000; 1; ... t_DiffuseTexture;SPTYPE_STRING;environments\asteroids\asteroids_02_diff.dds; ...
I'm not sure about how it is in X3, but in the X2, all textures numbers in tex/true/ folder are hardcoded in game engine, only vanilla texture numbers working in the game, all other new texture numbers simply not working into the game.
Maybe try to change BOD file texture parameters to MATERIAL6:, simply copy 1 texture parameter from any other vanilla BOD file and change texture address and save your texture to DDS format.
example:

Code: Select all

MATERIAL6: 0;2;effects\explosions\exp_p1_diff.tga; 0;0;0; 255;255;255; 255;255;255; 1;100;10;0; 1;0;0; 100; NULL;0; NULL;0; NULL;0; NULL;0; NULL;0;
If still not working, then send me your test mod link in PM, I will try to help.
Image

bounty_hunter66
Posts: 550
Joined: Tue, 15. Aug 06, 13:36
x4

Re: Do textures in tex/true need to be declared somewhere?

Post by bounty_hunter66 » Wed, 3. Nov 21, 18:51

Yeah, I was afraid of that. If they are hardcoded in X2 then they most likely are in X3 as well. The symptoms I am experiencing certainly point in that direction.

Interesting idea to change MATERIAL3 to MATERIAL6. I will try that now.

bounty_hunter66
Posts: 550
Joined: Tue, 15. Aug 06, 13:36
x4

Re: Do textures in tex/true need to be declared somewhere?

Post by bounty_hunter66 » Thu, 4. Nov 21, 17:40

Hey, it worked ! I changed the material to MATERIAL6 and it's working. It looks different than MATERIAL3, but I guess I need to fiddle around with the material settings to get it to look just right.

Thank you ! :D

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”