How to create a mod using X3 ModManager

The place to discuss scripting and game modifications for X³: Reunion.

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

Post Reply
doubleshadow
Posts: 671
Joined: Fri, 12. Mar 04, 09:14
x3

How to create a mod using X3 ModManager

Post by doubleshadow » Wed, 14. Dec 05, 13:15

What is mod

A mod (modification) is a catalog file (if you don't know what is catalog) similar to those provided as part of the game. Those are the files with extensions .cat and .dat located in the main X3 directory (like 01.cat/01.dat, 02.cat/02.dat,...)

What a mod can do

A mod cannot do anything on its own. A mod is a way to alter things in X3 in a standardized manner.

If you want to modify or add some file in X3, put it in a mod instead of modifying the original file. The advantage is clear - your game files will be left untouched and you will be able to switch between different mod files.

How do mods work

This cannot be fully explained without getting into basics of how X2/X3 filesystem works. Maybe I will write this sometime. All you really need to know is that any files in active mod always takes precedence when X3 is loading the files. That means that anything you put in the mod will "overwrite" (or override) any other files with same names which can be possibly located in other catalogs.

How to create a mod using X3 ModManager and how to put TShips into it

Getting the right program

First thing you will need is some program which will allow you to work with the catalogs.

There are two branches of such programs:

The official one (which is really not anything you want to mess with)

And the unofficial ones made by people which had nothing better to do then to make someone elses work for free.

X3 ModManager is one of these programs. It was made by me :D

Follow this thread to get it.

Extracting the orignal TShips file

Run X3 ModManager (X3MM) and click the Open button. Select catalog 05.cat located in your main X3 directory.
NOTE: This is valid only for X3 version 1.2 - future versions may have (and likely will) the "valid" TShips file located in another catalog (with higher number)
Now you should see list of files inside the catalog. Search for file named "types\TShips.pck". You can use the Filter button and type *tships*

Now right click on the TShips file and select Extract. A dialog will appear when you can specify where to extract the file. Type any location you like (c:\ will do the work :) ). Uncheck the Preserve file paths option as you don't want to create the directories. Click OK. Now you should have the TShips somewhere on your disk.

Creating new mod

Click the New button. A dialog will appear. Make sure that the directory is set to [x3 dir]\mods and type the name of your new catalog (example: mytest.cat). Press Open. You will now see empty window (no files). Check that the mod file is really in your [x3 dir]\mods directory (look at X3MM caption).

Now open your file manager (Explorer or something) and locate the TShips file which we extracted before. You can now drag the file from your file manager and drop it ower the file window in X3MM. Or you can click the Add button in X3MM and select the file.

A dialog will appear. Now you can specify a "directory" under which you want to place the file. It this case type types (because the file was originaly located in types directory). Check that the Compress files option is set to check compression filter and press OK. The file should appear in the window named "types\TShips.pck".

That's it - you have your mod with "your" file inside :)

Remember that when overriding files you must use the same path as in the original files. You cannot put file types\TShips as TShips into your mod and expect it to work. The extensions of the files (or more propery the types of the files) are a bit tricky. Check Tricky part about file overriding in catalogs.

What now?

Now you can edit the TShips with X3 Editor and change things you want. Just doubleclick on the file or run X3E and open the file from your catalog.

How to activate a mod

Click the Mode button so you will see list of catalogs on the left side of X3MM. You should also see your new mod if you placed it in the correct directory. Right click on the catalog name and select Activate mod. The name should now be displayed in bold and there will be word Active appended after the catalog name in X3MM caption.

Of course you can also activate the mod via the Select Mod Package button in the X3 startup window.

Tricky part about file overriding in catalogs

Maybe you already encountered a problem that X2/X3 didn't used your version of file placed in catalog (mod) even if the mod was active.

This is because X2/X3 has a file type priority list:

from highest priority to lowest:

packed binary files (pbb)
binary files (bob)
packed files (pck, pbd)
plain files (txt, bod, xml)

That means if you want to override TShips.pck then your TShips must also be packed. If you use TShips.txt it will not work because X2/X3 will find .pck version in another catalog and will use it.

That's mainly issuse when overriding scenes and models. If the scene/model is in bob, you must also have it in bob (or in pbb). But in X3 that doesn't matter imho as you can simply add new file names instead of overriding the original files.

Note that I'm not sure about the priority of bob <> pbb - it's just my guess.
Last edited by doubleshadow on Wed, 14. Dec 05, 16:21, edited 1 time in total.

User avatar
Lazza
Posts: 192
Joined: Sun, 29. Dec 02, 09:33
x3

Post by Lazza » Wed, 14. Dec 05, 15:44

Thanks for the above, DoubleShadow, just what I needed - Clear, precise instructions!

Augustini
Posts: 1239
Joined: Tue, 13. Dec 05, 22:55
x4

Post by Augustini » Sat, 18. Feb 06, 12:15

Whenever i try to add the any files to my experimental mod, i get "file empty".

Why is that?

doubleshadow
Posts: 671
Joined: Fri, 12. Mar 04, 09:14
x3

Post by doubleshadow » Mon, 20. Feb 06, 08:58

augustini wrote:Whenever i try to add the any files to my experimental mod, i get "file empty".

Why is that?
Download the newest version - there was a bug :oops:

Post Reply

Return to “X³: Reunion - Scripts and Modding”