How to create name for your ship
This tutorial will show you how to create a name (text entry) for new ship you've just added into TShips.txt.
All game texts are located in Text resource files. You must create new XML file and add a new record there.
- Create new file in directory
[X3TC directory]\twith any text editor and name it
<your number>-L<language code>.xml
- <your number> is a random four digit number which will be unique to you and your project(s). Check this list of X3 game objects already in use (you have to scroll down).
- <language code> is three digit language code: i.e. English is 044.
Example of file name with English code: 0001-L044.xml - this is build-in file name and you cannot use it for new file.
- Open the file in your text editor and copy the following code into it.
<?xml version="1.0" encoding="utf-8" ?> <language id="44"> </language>
- Save the file.
- Now run X3 Editor 2 and open the created file in Text resource editor.
- Right click on the left part of the window and select New.
- In the ID field, enter 17 and press OK.
- You have now created new page with id 17. This is where all object names are stored.
- Select the newly created page and right click on the right part of the window. Select New.
- In the ID field, enter unique string identifier which is not yet used. To find this out, click Plugins->Text resource editor in X3 Editor 2 and look at page 17.
- Enter the desired text and press OK.
- Save the file.
- Now open your TShips.txt and change the Name ID property to your string ID and save the file.
Final step is to instruct the game to actually load your new text resource file. To do so, you must create a simple game script:
- Run the game and open script editor (tutorial).
- Create new script and name it
Where <your name> is your name or nickname, so you and others can identify your scripts.
- The script will only contain single instruction: Load text
The ID argument is the four digit number of the text resource file you have just created (1 in our example).
- Save the script and exit the game. The game automatically calls all scripts beginning with setup. upon startup.
- Start the game again and you should see the new ship name.
- Note: X3 Editor 2 will load any new text resource files regardless if there is loading script for them or not. After you create/modify text resource file, just restart X3 Editor 2 to see the changes in TShips file or elsewhere.
The original content of this article was imported from DeadlyDa and doubleshadow's X-Wiki.