[TUTORIAL] X Rebirth - Modding Guide

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

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

Post Reply
User avatar
Observe
Posts: 2665
Joined: Fri, 30. Dec 05, 18:47

[TUTORIAL] X Rebirth - Modding Guide

Post by Observe » Sat, 16. Nov 13, 02:28

X Rebirth - Modding Guide

The following contains information that may be of interest to those involved in modding this game.

Note: It would be a massive understatement to say this guide barely scratches the surface of what can be done in modding this game! I will add and refine content to this guide as time permits.

The example mod has a separate forum discussion here: Transcend - Lost Colony.

----------------------------------------------------------------------------------

Installing Mods (manually)

Most of you will not be modding the game but simply use them.
The game's mod folder will be something like...

\Steam\steamapps\common\x_rebirth\extensions\

You probably have to create the "extensions" folder but then you can just drag and drop custom mod folders in there.

Just to verify, the end result would look like...
\Steam\steamapps\common\x_rebirth\extensions\AwesomeMod_v2\content.xml

That's it. Next time you launch the game, check if the new "extension" is enabled.

----------------------------------------------------------------------------------

Preface

Modding, as it relates to X Rebirth, means modifying the game by creating new or altered content. This guide focuses primarily on working with xml files to control various aspects of the game.

Mods for Rebirth are considered game extensions, and mod content goes in the \extensions directory. Available extensions are listed in the extensions sub-menu found in the Start Menu. Individual extensions can be activated or deactivated.

Possible mods can be as simple as changing specific game visuals (example highway tube color) to creating new additions to the universe map, to writing custom AI and/or Mission Director scripts.

Creating new models (meshes) for the game is beyond the scope of this guide, and will be covered separately.

Modding activities for X Rebirth fall into several general categories, including (but not limited to):

1. Materials and Effects
2. Universe (map)
3. Mission Director and AI Scripts
4. Model meshes (not covered here)

There are many Rebirth files that will be of interest to modders. Here are some important file locations:

\aiscripts - Contains script for controlling various aspects of AI (fight, move, mine, etc).
\extensions - This is where your distributed mods go
\index - components.xml and macros.xml. There are two important files that reference other files and locations.
\libraries - Files defining a variety of game elements.
\maps - Map files for Galaxy, clusters, Highways and zones
\md - Mission files using Mission Director
\t - Language files

Important:

To merge or not to merge - that is the question. Changes to the game (mods) must never alter the core game files. Otherwise, there is no way to separate multiple mods which may be affecting changes to common files. This means that all your changes must go in mod extension files and be applied in the correct manner.

When your mod is active, the game will examine your mod directory structure to see if your mod contains files located and named the same as those being used by the core game. If the game finds a "core" file in your mod, it will need to know what to do with the information.

Standard XML files are merged at one level below the root node, so your file should only contain the additional entries you want to introduce.

It is also possible to use a different XML file format in mods. This is known as patch format, and it uses the XML Patch standard to define changes to the base file. This is more powerful as it can directly modify the base XML document, adding, altering and removing nodes and attributes.

One common requirement is to change or replace a template or macro with your own. This is achieved by adding your own index entry for the required macro name (in an index file, the defined behavior is for later entries of the same name to replace earlier ones, and since the base file entries are loaded first your mod entry will overwrite whatever is in the base file) and redirecting it to a template or macro definition in your mod. From there you can change pretty much anything about the template or macro, including properties, meshes and so on.

Notes:

Please refer to the Appendix (link soon) for a description of the Component Model and the Universe Structure. It is important to have a basic understand of these concepts.

You may need to extract the core game files (cat/dat) to examine and better understand what you need to do to affect the changes you are interested in for your mod. This is accomplished by using the Egosoft XRCatTool.exe.

For sake of clarity, it has been pointed out, that the word "Cluster" used in this guide, may not be familiar to players; because in-game, the word used is "System". However, for the purpose of this guide, I use "Cluster", because that is how it is referred to in the various files that you will be working with as a modder.

Contents:

This guide demonstrates various methods that can be used to modify the game. For the purpose of "learning by doing", this guide is written in the form of a tutorial involving various examples of additions to the Universe map and other alterations.

Part One: Images and Effects

Example 1: Create a mod extension

Example 2: Change a material effect color

Example 3: Create a custom billboard advertisement

Part Two section A: Universe Editing

Example 4: Add a new cluster

Example 5: Add a new Sector

Example 6 Working with zones

Part Two section B: Universe Editing

Example 7: Highways and Super Highways

Example 8: Working with Regions

Example 9. Create a custom cluster background material

Example 10. Create a custom Planet texture material

Part Three: Bringing the Universe to life

Example 11: Working with Jobs (AI spawning)

Example 12: Working with Mission Director

Conclusion

Appendix

Make-up of the universe

Content.xml


Suggested software and reference materials:

1. Visual Studio Express (free) or similar XML Editor.
2. Image Editor such as Photoshop (free CS2 version) with DDS Plug-in or Gimp (plugin here ).
3. 7-Zip File Manager (or other) for extracting core image files
4. Egosoft XR Catalog Tool for extracting core game data files
5. XML Patch document standard RFC 5261.
6. HHD Free Hex Editor (or equiv).
7. Official Mission Director Guide

Examples

Part One: Extensions, Images and Effects

Example 1: Create a mod extension

Before we do anything else, we first need to establish a folder location for our mod files.

1. There is a game folder named extensions located off the game root directory. You may need to create this directory if it doesn't already exist.

2. Download the mod file osr_universe containing the examples referred to throughout this guide and extract into the game extensions folder. Your directory structure will look like this:

Code: Select all

X Rebirth
  extensions
    osr_universe
      assets
      index
      libraries
      maps
      md
3. Open the content.xml file in the osr_universe directory with your xml editor. Here you will see various text fields for author, description and a few other things related to identifying your mod and providing information displayed in the extensions sub-menu of the game.

4. The most basic mod extension consists of a single mod directory and content.xml. Such a mod wouldn't actually do anything, but it would show in the menu and could be activated and deactivated there.

Example 2: Change a material effect color

Here we will change the default local highway tube color from yellow to blue.

1. Open the file material_library.xml located in extensions\osr_universe\libraries

2. If you have extracted the game data files (using XRCatTool.exe), you can open the core game material_library.xml for comparison with the one included in our example file.

3. In the core game file (not the example file), search for the string "highway_tube" in material_libary.xml. You will see the material definition for the highway tube effect. It looks something like this code snippet:

Code: Select all

 <material name="highway_tube" shader="shaderfx\high\XU_highway_tube.fx" blendmode="additive" preview="none">
      <properties>
.....
        <property type="Color" name="color_tint" r="180" g="200" b="120" a="255" value="(color 180 200 120)"></property>
......
      </properties>
      <variations></variations>
    </material>
In this case, all I want to do is change the color-tint property of an existing material definition. If I wanted to create a new material, I could simple add a single new entry in my mod version of this file, and the game would find it appended at the end of the material_libary.xml definitions.

However, since I don't want to add or merge a new entry, I will use the "patch" method to modify the existing definition as follows (refer to XML Patch standard RFC 5261 to understand how this is done):

Code: Select all

 <diff>
  <!-- Changes Tube Color from yellow to blue -->
  <replace sel="/materiallibrary/collection[@name='effects']/material[@name='highway_tube']/properties/property[@name='color_tint']">
    <property type="Color" name="color_tint" r="120" g="124" b="200" a="255" value="(color 33 13 98)"></property>
  </replace>
</diff>
This new version of material_libary.xml differs from the standard file as follows:

a). Notice the <diff> root node. This instructs the game that I am applying some "difference" to the existing core definitions. Using <replace sel> we search for the values we are changing. In this case, we are changing the color_tint for this effect.

b). Our patch file contains ONLY the changes we are making . It does NOT include all the other entries (if it did, the game would get confused because of double entries).

Note: The original core game files should never be changed. All you are doing is creating modified versions and putting them in your extension folder/s.

The following image shows how this change looks in the game:
Image


Example 3: Create a custom billboard advertisement

Let us see what is involved in replacing one of the existing billboard ads.

First, it is a good idea to extract the existing game textures associated with ads. This way, we can see which image we need to replace. Note: you will need to have the extracted game files available (XRCatTool.exe).

1. Identify one of the existing billboards that you want to replace.

2. Locate folder \assets\fx\textures\ads\ads

3. Extract all the .gz files into some directory for viewing

4. Using a command prompt, navigate to the extraction directory

5. Type the following command: rename *.* *.dds. This will give all the files their dds image extension (for that is what they are).

6. Using your dds capable image editor, locate and open the image that corresponds to the billboard ad you want to replace.

8. Create and save a new .dds image that exactly matches the size, channels, etc of the one you are replacing. In my example, I have named this image as: ads_osr_01.dds

9. Remove the .dds extension from your new image. Note: This isn't necessary, but I'm doing it to match the results of the extraction tool.

10. Using 7-Zip (or equivalent), create an archive with .gz extension containing your new image. Name this archive: ads_osr_01.gz. ] This file is located in \extensions\osr_reborn\assets\fx\textures\ads

11. Open the provided example file libraries\material_library.xml and notice the following:

Code: Select all

 
<!-- Replace ads-plamacells with Observe Space Research advertisement -->
  <replace sel="/materiallibrary/collection[@name='ads']/material[@name='ads_plasmacells']/properties/property[@name='diffuse_map']">
    <property type="BitMap" name="diffuse_map" value="extensions\osr_universe\assets\fx\textures\ads\ads_osr_01"></property>
  </replace>
Here I am replacing the normal definition for the plasma cell advertisement with one of my own specifying my custom image.

Note: If you don't want to replace all instances of the standard billboard image, you would need to create a custom billboard mesh (or modify the material reference in an existing mesh) and change the macro reference to use your mesh instead of the normal one. This technique will be used in a subsequent example.

Example custom billboard:
Image
Last edited by Observe on Sat, 17. Dec 16, 20:20, edited 16 times in total.

User avatar
Observe
Posts: 2665
Joined: Fri, 30. Dec 05, 18:47

Post by Observe » Sat, 16. Nov 13, 02:31

Part Two section A: Universe Editing

Here we will be adding a new section to the standard galaxy. Having a custom area on the map separate from the standard game, can be useful as a modders "sandbox" for trying out new ideas without interfering with the rest of the game.

In this example, I copied and modified parts out of the existing map files (Omicron Lyrae) into my custom files. In the beginning, this may be easier (and quicker) than creating everything from scratch.

Note: Refer to the Appendix for a description of the Universe Structure to understand the various elements involved.

Example 4: Add a new Cluster

1. Open file galaxy.xml in extensions\osr_universe\maps\XU_ep1_universe

2. Open the core game galaxy.xml for comparison.

3. Notice we are using the patch method as we did previously; except in this case, we are using <add> instead of <replace>. This means we are adding a new connection to the galaxy for our custom Cluster (Cluster_OSR_macro)

Code: Select all

 <?xml version="1.0" encoding="utf-8"?>
<diff>
  <add sel="/macros/macro[@name='XU_EP1_universe_macro']/connections">
    <connection name="Cluster_OSR_connection" ref="clusters">
      <offset>
        <position x="1000000000" y="0" z="-1000000000" />
      </offset>
      <macro ref="Cluster_OSR_macro" connection="galaxy" />
    </connection>
  </add>
  
  <add sel="/macros/macro[@name='XU_EP1_universe_macro']/connections">

    <connection name="ClusterGate04" ref="destination" path="../cluster_A_connection/Cluster_A_Sector02_connection/tzoneCluster_A_Sector02_Zone107_connection/clustergate_connection888">
      <macro connection="destination" path="../../../../../Cluster_OSR_connection/Cluster_OSR_Sector08_connection/tzoneCluster_OSR_Sector08_Zone87_connection/clustergate_connection666" />
    </connection>

  </add>
</diff>
3. Additionally, we have added connection for a jumpgate between our new Cluster and the rest of the galaxy.

4. Open file extensions\osr_universe\index\macros.xml. Here you see we have defined path definitions for our map files. These are referenced by various other files.

5. Open file extensions\osr_universe\index\macros.xml. Here you see a path defining where the various assets (models) for our Cluster can be found.

6. Open file extensions\osr_universe\maps\XU_ep1_universe\osr_clusters.xml.

This defines Cluster_OSR_macro] and establishes location references for Sector/s and Zone/s that will be contained within it. Notice here you can change the Cluster name, music, and other attributes.

Note: I initially based my new Cluster on the existing Cluster C (Omicron Lyrae). If you look in the example extensions\osr_universe\assets\environments\cluster directory, you will see several files. These where essentially copied from the core game Cluster C files, reduced, modified and renamed to suit my mod. If you examine those files, you will see how they differ from the original.

7. Open file extensions\osr_universe\assets\environments\cluster\cluster_osr.xml. This file defines planet meshes, textures, lighting, nebulae and a host of other global characteristics for this Cluster. We will be returning to this file in detail later.

Example 5: Add a new Sector

1. Open file extensions\osr_universe\maps\XU_ep1_universe\osr_sectors.xml. This connects our custom Sector (Cluster_OSR_Sector08_macro) which is referenced in file osr_clusters.xml, and it defines the position for the various Zones contained within it. You can also specify the Sector music, description and other attributes in this file.

Example 6 Working with Zones

1. Open file extensions\osr_universe\maps\XU_ep1_universe\zones.xml. Here you see I am performing a <diff> patch to zones.xml to add a jump-gate connection so we can connect one of our custom Zones with one in a Xenon Sector.

2. Open file extensions\osr_universe\maps\XU_ep1_universe\osr_zones.xml. This file defines the content of the Zones contained within the Sector we have created. Here you can place various objects such as stations, ships, gates, debris and other components.

While the contents of this file was largely based on Zone information from Cluster C, you will notice I added a new Zone (Pirate Haven) tzoneCluster_OSR_Sector08_Zonepirate_macro. The position coordinates for this new Zone were determined by approximation based on where I wanted it located in relation to the other Zones.

Custom Zone layout:
Image
Last edited by Observe on Sat, 17. Dec 16, 20:00, edited 3 times in total.

User avatar
Observe
Posts: 2665
Joined: Fri, 30. Dec 05, 18:47

Post by Observe » Sat, 16. Nov 13, 02:32

Part Two section B: Universe Editing

Example 7: Highways and Super Highways

Since the example mod (osr_universe) contains only one sector, I don't need Super Highways. These can be added to our custom cluster by examining how this is done in existing Cluster C files for reference.

I haven't looked into the details of defining splinetube position attributes. If you look at file extensions\osr_universe\maps\XU_ep1_universe\osr_zonehighways you will see this is a copy of the Cluster C section in the core zonehighways.xml file.

You could copy any existing splinetube definition into your custom zonehighways file, and you would have the associated local highway layout. Regardless of how you derive you zone highways, you will probably want to make sure your zones locations correspond to where the highways go. No doubt tools for the modding community will become available for "building" zone highway and superhighway layout designs.

It is also possible to create a sector containing zones, but having no highways. This can provide some interesting (and fun) gameplay opportunities when you have to fly around the sector without the convenience of highways.

Example 8: Working with Regions

Regions primarily (but not always) define resources for zones. Resources can include asteroids, gas, plasma, ice, etc for mining.

Region definitions are also used for establishing foggy areas. These do not necessarily containing minable resources.
There are two files associated with regions: extensions\osr_universe\maps\XU_ep1_universe\osr_clusters.xml and extensions\osr_universe\libraries\region_definitions.xml.

In osr_clusters.xml you will see each Zone has a "region ref" which points to a region definition in region_definitions.xml. Region resource distribution is crucial for a functioning economy.

Example 9. Create a custom Cluster background material

Here we will create a custom background for our new cluster. Clusters use various meshes with embedded material references.

In our example, we could simply change the material definition (in material_library.xml). The trouble is, doing so, would also replace the background being used for Omicron Lyrae (which our example is loosely based on).

Until such time as we have modeling tools available to us, there is a "trick" we can use to create a new unique mesh pointing to our custom background texture. Since the mesh files are in binary format, we will need a Hex Editor to make the necessary changes.

1. Open file extensions\osr_universe\assets\environments\cluster\cluster_osr.xml. Search for string "part_bg". You will see this part has a material id ref=environments.cluster_c_bg2. The game doesn't actually use the material reference specified here (as far as I know). Instead, the game uses whatever material reference is embedded in the mesh file.


2. Using your Hex Editor (I am using HHD Free Hex Editor), open file extensions\osr_universe\assets\environments\cluster\cluster_osr_data\part_bg-lod0.xmf.


3. Near the top of this file, you will see text string "environments.cluster_c_bg". This references the entry in material_library.xml.

4. Change the text string to "environments.cluster_c_bg2" (no quotes). All we've done is add the character '2' to the end of the existing string.

Note: Be careful when working with binary files in this manner. You don't want to change the file size. This means you don't want to add or remove any data. When you add the '2' to the end of the string, you are simply replacing a zero byte with hex 32 (ascii value for '2').


5. Save the file. You probably should rename this file and change the reference in the cluster definition (cluster_osr.xml), so that it never gets confused with the original, but I'm not doing that in this example.


6. Open extensions\osr_universe\libraries\material_library.xml. You will see we've added an entry for "cluster_c_bg2", which has reference to our diffuse_map and diffuse2_map custom images (osr_cluster_c_bg_red_diff and osr_cluster_c_bg_green_diff).

The above changes will provide a unique custom background for our cluster.

Example 10. Create a custom Planet texture material

Currently, there are a limited variety of planets for use in the game. Here, we will create a new planet texture to give our cluster a unique appearance. The methods we will be using are similar to what we did for changing the background material.

1. extensions\osr_universe\assets\environments\cluster\cluster_osr.xml. Search for text "part_GeoSphere01". This is the planet mesh we are using in our cluster.

2. Open extensions\osr_universe\assets\environments\cluster\cluster_osr_data\part_geosphere01-lod0 .xmf in your Hex Editor. You will see I've changed the material reference to "environments.cluster_osr_gaslike_planet".

3. Open extensions\osr_universe\libraries\material_library.xml. You will see I have a material definition for "cluster_osr_gaslike_planet" pointing to my custom diffuse_map image.

Example custom background and custom planet:
Image
Last edited by Observe on Sat, 17. Dec 16, 20:00, edited 3 times in total.

User avatar
Observe
Posts: 2665
Joined: Fri, 30. Dec 05, 18:47

Post by Observe » Sat, 16. Nov 13, 02:33

Part Three: Bringing the Universe to life

Example 11: Working with Jobs (AI spawning)

Without AI 'life', our new cluster won't have much action going on in it. This primarily has to do with what is known as 'Jobs'.

Coming up with custom Jobs is a tricky balancing act! If you have too many Jobs, you will degrade game performance - because each Job must run its own script in the background. This takes computer memory and CPU resources (and possibly also GPU because of rendering requirements if you have too many ships in view). On the other hand, if you have too few Jobs, your economy may fail, and your custom area may be a bit too 'lifeless'.

There are two files responsible for specifying what types, and how many different traders, enemy, and various other ships will be spawned and operating within our custom area.

1. Open extensions\osr_universe\libraries\jobs.xml. Here you see I am using the Patch method (<diff>) to add Jobs for my custom area.

There are several attributes each Job can have. An individual Job can be limited to operating in a specific zone, sector, or anywhere in the galaxy. It is possible to specify ships in different ways, the owner, location, script, and various other characteristics.

2. Open extensions\osr_universe\libraries\quotas.xml. This file determines which type of NPC's will be present on stations operating in your custom cluster. Without this file, your stations will be empty of NPC's.

Example 12: Working with Mission Director

Learning Mission Director (MD) is beyond the scope of this guide. There are official documents available on using Mission Director, and this subject will need to be dealt with separately. Suffice to say, Mission Director is extremely flexible and powerful. It can be used not only for creating game missions, but also for affecting a wide variety of conditions within the universe.

Contained within the example mod, is a sample MD file extensions\osr_universe\md\osr_universe.xml. This file is a bit of a hodge-podge of things I was doing while developing this guide and the accompanying example mod, but you might want to look at it for some ideas. Here are a few of the key features of the code in this particular MD file:

a). When playing the game in "free mode" (not the campaign), you will be warped to a zone in the new cluster. In the code, you will see <event_cue_signalled cue="md.Setup.GameStart" />. This triggers the associated code to run as soon as the game has started.

b). Player ship (Skunk) is loaded with various weapons and ammo, and the player is given 51 million credits.

c). All the zones within the custom sector are set to 'known'. This means they show up on the map without having visited them.

d). Two stations are spawned with <create_station> along with station defense ships.

e). Several player-owned Capital ships are spawned with <create_ship>. These are assigned to a group.

f). If you command the big Capital ship (Arawn) to move somewhere, the other 2 Capital ships will escort it as a convoy. If the destination is within the sector, these ships will fly there (not jump). If outside the sector, these ships will jump via the nearest gate. As a convoy, these ships will defend themselves and perform other actions. You will see various things being done in the code related to how this convoy operates.

g). NPC's Commander, Engineer, and Defense Control NPC's are created for each of the Capital ships. In addition, an Upgrade Trader is placed on the docking-bay of the Arawn. Also, an engineer is assigned to the player ship. This engineer will disembark from the Skunk, and will be present on the platform. When the Skunk leaves the dock, the engineer is transferred back to the Skunk.

I encourage you to learn at least some of the rudiments of working with Mission Director. You will find the knowledge useful in your Rebirth modding adventures!
Last edited by Observe on Sat, 16. Nov 13, 02:46, edited 2 times in total.

User avatar
Observe
Posts: 2665
Joined: Fri, 30. Dec 05, 18:47

Post by Observe » Sat, 16. Nov 13, 02:33

Conclusion

Modding X Rebirth may at first seem like a daunting task if you don't even know where to start, or where the various modable files reside, or how to create a basic mod. Hopefully, this guide will be useful as an introduction to some of the ways this game can be modified.

It is possible some of the procedures outlined in this guide, will be replaced by superior methods as more knowledge is gained about modding Rebirth, and as future modding tools may become available.

Please let me know if you notice any serious omissions and/or incorrect statements within this guide that could lead the reader astray, or if you know of simpler ways of doing things.

Happy modding!

Thanks
Last edited by Observe on Sat, 16. Nov 13, 02:49, edited 2 times in total.

User avatar
Observe
Posts: 2665
Joined: Fri, 30. Dec 05, 18:47

Post by Observe » Sat, 16. Nov 13, 02:33

Appendix

The Component Model:

All objects in the game are part of the Component Model System.
A Component is the base class of many other things in the game, from Asteroids to Zones; Ships, Stations, Turrets, Bullets, Storage Modules and Docking Bays.

There are now many more types of objects in the universe and each large object can contain many different types of ‘Children’ changing how it behaves and functions
A station for example can have a dockingbay class object, capable of holding XL Ships. It also can have Turrets all over its surface, or Missile Launchers. There is little standing between us and adding Engine class objects to a Station.

The Component Model system is very powerful and will give us a vast range of possibilities for each object.

Universe Structure:

The structure of the environments the player explores is different to previous X-Games.

Clusters

Clusters are huge non-interact-able environments containing Sectors. These are scenes on a cosmological scale, containing Suns, Planets, Moons and other large objects.
Previous X Games usually represented a Star System with a single sector and far away planets. X Rebirth will allow travel between multiple ‘Sectors’ within a Cluster.

Clusters contain Sectors which are connected via Sector Highways. Only when inside a Sector Highway, will the player be moved though a Cluster, with the Planets and Suns moving past.

Sectors

Sectors are large areas with a scale of several hundred KM. Similar in scale to Sectors of previous X Games, they usually are placed in an area of interest such as Planetary Orbit or within an Asteroid Belt.
Sectors contain several smaller areas of space called ‘Zones’. Unlike previous X-Games, it is important to note that objects are not placed on Sector co-ordinates. Instead, co-ordinates are based on the Zone (see below).

The player can fly from one end of a Sector to another seamlessly, passing though Zones as they go. To reduce travel time, there are Zone highways connecting points of interest.

Zones

Zones are areas of interest within Sectors. Zones are the co-ordinate space which most objects are placed inside, making them functionally comparable to the old X-Game sectors. The main difference is size. Zones are usually around 50km cubed in size.

Not all of the Sector is covered by a predefined Zone however. In ‘open space’, the Playership will have a temporary Zone around it. A zone will typically contain a set of Stations, Highway Entries/Exits and Ships.

Highways

Highways are a means of traveling great distances in a short amount of time, replacing SETA (SINZA). There are two types; Regular Highways and Super Highways.
Regular Highways move you to a different Zone, moving you though a Sector. The player can also fly manually between Zones.
Super Highways move you to a different Sector, moving you though a Cluster.

While Regular Highways don’t ‘loop’ onto themselves, they may take a very long path though a sector, making much of it available in a short amount of time.

Highways can be entered or left at any point, with the highway slowing down near areas of interest to aid departing ships.

Inside the highway, there are several lanes for ships to travel in. The player can speed up travel in a highway by getting into the ‘slipstream’ of passing ships and matching their speed.

Regions

A Region is a special area which can be defined for a Cluster. A region takes care of generating special dynamic objects such as Asteroid fields, Nebula, Fog and Scrap Fields. A region is capable of displaying ‘fake’ objects and environments, which become more real in the players area.
A comparable system in X3 was the mini Asteroids which became interact-able on approach.

Miscellaneous Notes:

content.xml

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<content id="GZ_Run" name="Run" date="" version="102" save="false" enabled="true">
  <text language="44" name="Run" description="Run fasta. In stations." author="Gazz" />
  <text language="49" name="Lauf!" description="Erhoeht die Geh...schwindigkeit in Stationen." author="Gazz" />
</content>
  • The version number (version="1.0") is an integer and divided by 100.
    A value of 102 will be displayed as 1.02.
  • ID needs to be a unique ID but doesn't have to be a number.
    Simply add a tag for your name and there is basically no chance of collision with another modder's work - ever.
  • The save="false" parameter (or save="0") will prevent your mod to be "recorded" in the savegame.
    It should be used when your mod only changes graphical settings or game values, that have no lasting effect on the game. (like the player's run speed in stations...)

    With save="false" the user can disable the mod (or delete the whole folder!) and the savegame will not be invalidated.
  • <content>-node has an enabled-Parameter which when set to "false" turns mods off by default.

    One possible use for that:
    Supply multiple versions of your mod, such as "no cockpit" plus "a little bit of cockpit".
    All of them are disabled by default and the user only enables the one he wants.
Last edited by Observe on Sat, 23. Nov 13, 17:49, edited 2 times in total.

User avatar
jack775544
Posts: 1117
Joined: Tue, 13. Dec 11, 09:27

Post by jack775544 » Sat, 16. Nov 13, 03:20

Nice guide Observe. :)
Great to see such detailed tutorials already.
1940s - Various "computers" are "programmed" using direct wiring and switches. Engineers do this in order to avoid the tabs vs spaces debate.

User avatar
r4m0n
Posts: 12
Joined: Thu, 15. Dec 11, 19:48

Post by r4m0n » Sat, 16. Nov 13, 03:25

Couldn't wait for a link, so I made my own .CAT extractor.
You can get a windows .NET executable here:http://www.r4m0n.net/uploads/XCatTool.exe
Source code: https://github.com/r4m0n/XR_CatTool

To run, create some folder to contain the extracted files, open a command prompt there and run XCatTool PathToFileWithoutExtension.
Example:

Code: Select all

G:\XR> MD extracted
G:\XR> CD extracted
G:\XR\extracted> XCatTool ..\01
After extracting all CAT files, you should be able to see all game files. Good luck with modding :-)

HammerSun
Posts: 85
Joined: Tue, 12. Dec 06, 13:15

Post by HammerSun » Sat, 16. Nov 13, 04:37

r4m0n wrote:Couldn't wait for a link, so I made my own .CAT extractor.
You can get a windows .NET executable here:http://www.r4m0n.net/uploads/XCatTool.exe
Source code: https://github.com/r4m0n/XR_CatTool

To run, create some folder to contain the extracted files, open a command prompt there and run XCatTool PathToFileWithoutExtension.
Example:

Code: Select all

G:\XR> MD extracted
G:\XR> CD extracted
G:\XR\extracted> XCatTool ..\01
After extracting all CAT files, you should be able to see all game files. Good luck with modding :-)
Wow, But when i run your program in command prompt, it stop working...
I've MS .net framwork 4.5 installed, should i install other version?

loubert
Posts: 182
Joined: Wed, 14. Dec 05, 23:39

Post by loubert » Sat, 16. Nov 13, 04:53

If anything needs to be stickied, this does.

User avatar
r4m0n
Posts: 12
Joined: Thu, 15. Dec 11, 19:48

Post by r4m0n » Sat, 16. Nov 13, 05:05

HammerSun wrote: Wow, But when i run your program in command prompt, it stop working...
I've MS .net framwork 4.5 installed, should i install other version?
I've built it with .NET 4.0, so it should work fine with yours. It currently doesn't do ANY checking on what you are passing it, the most likely cause for it to explode would be passing an invalid file.
Make sure you pass to it a path to the .CAT file without the extension, and that the .DAT file is together with it (as it should in the game folder).
You can try just running those 3 lines I quoted in the command prompt in the game folder and it should work. If it is still failing, try to post any info you get from the failure popup.

HammerSun
Posts: 85
Joined: Tue, 12. Dec 06, 13:15

Post by HammerSun » Sat, 16. Nov 13, 05:17

r4m0n wrote:
HammerSun wrote: Wow, But when i run your program in command prompt, it stop working...
I've MS .net framwork 4.5 installed, should i install other version?
I've built it with .NET 4.0, so it should work fine with yours. It currently doesn't do ANY checking on what you are passing it, the most likely cause for it to explode would be passing an invalid file.
Make sure you pass to it a path to the .CAT file without the extension, and that the .DAT file is together with it (as it should in the game folder).
You can try just running those 3 lines I quoted in the command prompt in the game folder and it should work. If it is still failing, try to post any info you get from the failure popup.
I've upgrade my .net runtime to 4.5.1
And it's working now, thank you man, it's awesome.

Aesran
Posts: 75
Joined: Mon, 26. Aug 13, 09:16

Post by Aesran » Sat, 16. Nov 13, 09:15

Yeat ! Great guide

User avatar
r4m0n
Posts: 12
Joined: Thu, 15. Dec 11, 19:48

Post by r4m0n » Sat, 16. Nov 13, 09:32

Random observations:
I've spent a few hours reading the game scripts and interface definitions, and I haven't found so far ANY way to get input events so we can add new hotkeys...
It looks like the UI section uses some Lua code, but it's getting distributed pre-compiled and on an unusual format, so I haven't been able to see how that part works.
If anyone gets any ideas on how to hook keys/buttons, let me know.

User avatar
Vayde
Posts: 843
Joined: Fri, 6. Feb 04, 22:02

Post by Vayde » Sat, 16. Nov 13, 10:55

John 8:32
Still life in the old dog yet...

Post Reply

Return to “X Rebirth - Scripts and Modding”