[SOLVED] How to add NEW textures?

The place to discuss scripting and game modifications for X Rebirth.

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

Ginger470
Posts: 158
Joined: Sun, 20. Jun 04, 03:24
x2

[SOLVED] How to add NEW textures?

Post by Ginger470 »

Anyone found out how to add new textures? Not replace existing, but completely new refs?

Thanks :)

[Solved]

Solution:

Copy the mesh files (lod & collision) of the item you want to reskin into the directory it came from NOT into the extensions folder

eg: X Rebirth/assets/interiors...

if it doesn't exist, just create it...just be sure to follow the original folder structure ;)

NOT X Rebirth/extensions/yourMod/assets

You can then follow Observe's methods for pointing the refs to the right place in the scripting sticky :)

YAYAYAYAYAYAY!
Last edited by Ginger470 on Tue, 21. Jan 14, 12:22, edited 1 time in total.
brammie
Posts: 100
Joined: Thu, 19. Dec 13, 23:26

Post by brammie »

dunno yet,

been working on a viewer for everything and just started on that. figured out how the icons work and just saw that thee textures pretty much work the same, eg the materials for some door

Code: Select all

					<part name="part_main">
						<lods>
							<lod index="0">
								<materials>
									<material id="1" ref="interiors.int_tile_01"/>
									<material id="2" ref="interiors.int_tile_02"/>
and the effects.glass_indoor_02 refers to an entry in the material lib ()

Code: Select all

    <material name="glass_indoor_02" shader="shaderfx\high\XU_glass.fx" blendmode="alpha8" preview="none">
      <properties>
        <property type="BitMap" name="diffuse_map" value="assets\fx\textures\glass_indoor_02_diff"></property>
        <property type="BitMap" name="specular_map" value="assets\fx\textures\glass_indoor_spec"></property>
so there you can add textures (blending and such)

so should be possible to add them in the material lib and refer to them
in the parts
Ginger470
Posts: 158
Joined: Sun, 20. Jun 04, 03:24
x2

Post by Ginger470 »

That's what I thought also .... but if you change the ref in the component xml file and define the new ref in the materials it's still a no go. The model will default to its original texture.

What's interesting is if you open up the lod() model in a hex editor, you can see the ref is in there also ... but I've not been able to save a working edited version that points to a different ref. Keeps getting a 'render error: missing .ccp file' or some such.

I gotta be missing something???
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

it would be useful to write down the exact error. did you refer to your new texture with the full relative path from the XR root directory? (including Extensions/YourExtension/)
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)
User avatar
YorrickVander
Posts: 2769
Joined: Tue, 29. Oct 13, 21:59
x4

Post by YorrickVander »

From historical experience of this kind of editing (Freelancer modding community, trying to get past some Frontier : First Encounters issues) it's important not to change the size of the binary you're editing - ie new filenames in this case will need to be the same length or shorter, with extra bytes 0'd over in case of shorter. Once compiled the code will reference particular locations for data + code jumps so changing the length of the file will break it.
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.
Ginger470
Posts: 158
Joined: Sun, 20. Jun 04, 03:24
x2

Post by Ginger470 »

Path is correct and byte-lengths are the same :) (I can get the texture to show if I use an existing ref).

But if I use the new ref with the hex edited model, the object doesn't display.

The errror:

Error: c:\\dev\\x4\\X4\\s_d3d\\renderdevice.cpp(1750): [RenderDevice::SetShaderToDevice] invalid shader handle!
Ginger470
Posts: 158
Joined: Sun, 20. Jun 04, 03:24
x2

Post by Ginger470 »

Solved. See first post :roll:
User avatar
YorrickVander
Posts: 2769
Joined: Tue, 29. Oct 13, 21:59
x4

Post by YorrickVander »

Nice one Ginger :) Look forward to seeing what you add.
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

even though this works it is imo not a good method.. can you quickly put together a Extension which demonstrates what you want to do? (quickly testable in a new Game or alternately a save would be nice)
I will have a look how this can be done using the extension folder only :)

(i would give you a Plush Jeb for your CP for that ;) :D )
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)
Ginger470
Posts: 158
Joined: Sun, 20. Jun 04, 03:24
x2

Post by Ginger470 »

Hey uni_trader...

This is still new to me so I have to go through my notes and see if I can recreate a simpler version. I honestly appreciate any help.

At this time I've added a new effect which adds a new connection and uses a new texture. It works fine (I can add/remove_effect as it should be). The only problem is really the texture path...

Meant to see what the Jeb was about -- love it!

If you're looking for work ;) (other than the texture path thing) I have two outstanding issues:

1. I can't locate 'stars'/'suns'/'planets' in a cluster tried find_object and find_object_component with classes, tags and macros. Even just cycled through ALL the names of the objects and didn't see anything.

Seems that some of the distant suns are just light sources, but it'd be great to find a way to return this info

2. And this may be related.... I'm trying to get the playership's max velocity. I can see it's there in the macro, but I can't find a way to pull this info.

If we can figure out how to reference a macro's attributes that'd open up so many things (asssuming it's possible from within the md).
docwho83
Posts: 168
Joined: Mon, 15. Jun 09, 23:10
x4

Post by docwho83 »

I did not really change anything but I managed to make a repair drone. Copy file information unit_player_interceptor_drone_data and rename it unit_player_repair_drone_data and added it to an extensions mod.

No repaint done or hex done. Maybe be why the T window for lunching said drone claims Assassin URV.

I am still trying to find the UI information to mod so I have it read Repair URV instead.

Return to “X Rebirth - Scripts and Modding”