[How to] Add new object ID names/Desc to t files (Solved)

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

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

Post Reply
StevieLeeCole
Posts: 40
Joined: Fri, 10. Jul 15, 18:31
x4

[How to] Add new object ID names/Desc to t files (Solved)

Post by StevieLeeCole » Thu, 12. Aug 21, 00:11

This

Code: Select all

<?xml version="1.0" encoding="utf-8" ?>
<language id="44">
<page id="350017" title="Boardcomp. objects" descr="">
 <t id="5385">Argon Chain Gun</t>
 <t id="5386">The Argon Chain gun is a multi-barrel development of the tried and true IRE; attaining accuracy and consistent rate of fire with efficient use of energy for medium fighters or point defense applications.</t>
 <t id="5803">Commodity Logistics Software MK1</t>
 <t id="5804">This software supports the pilot in coordinating his internal production logistics. It will collect orders of the different consumers inside your enterprise and coordinate those with chosen suppliers. Therefore it is possible to deliver the products from several suppliers of a single resource to different consumers.</t>
 <t id="5813">Commodity Logistics Software MK2</t>
 <t id="5814">This software allows the pilot to plan a route. The pilot is instructed to follow a given route and the corresponding commodity transfer orders for each intermediate stop. This enables the pilot to fulfil special tasks within the company or even at different stations. The route will be followed repeatedly until the pilot receives new orders.</t>
 <t id="5863">Turbo Booster MK1</t>
 <t id="5864">The Turbo Booster MK1 allows your smaller ships to travel at faster speeds while it's engaged. It requires energy cells to keep it running.</t>
 <t id="5903">Turbo Booster MK2</t>
 <t id="5904">The Turbo Booster MK2 allows your capital class ship to travel at faster speeds while it's engaged. It requires energy cells to keep it running.</t>
</page>
is the beginning of an existing t file (0010-L044.pck) that I hijacked to add a custom weapon name to. I figured out by trial and error that the description needs to be the id immediately after the name id. The weird thing is that when I try to add any more names (with IDs that aren't already taken of course) it breaks everything. Does anyone know the "proper" way to do this? I tried something like this

Code: Select all

<language id="44">
<page id="998817" title="Boardcomp. objects" descr="">
 <t id="5385">Argon Chain Gun</t>
 <t id="5386">The Argon Chain gun is a multi-barrel development of the tried and true IRE; attaining accuracy and consistent rate of fire with efficient use of energy for medium fighters or point defense applications.</t>
 <t id="5385">OTAS Medium Particle Accelerator</t>
 <t id="5386">The MPA is an............</t>
 <t id="5887">Etc</t>
 </page>
 <page id="350017" title="Boardcomp. objects" descr="">
 <t id="5803">Commodity Logistics Software MK1</t>
 <t id="5804">This software supports the pilot in coordin
 
(e.g. adding a new page entry with it's own ID) and it doesn't work either.
I think I may have figured out how to do this! If my hunch is correct, I will post simple step-by-step instructions for anyone else trying to add a custom object who is running into problems with adding ID Name / Description into the text files.
Last edited by StevieLeeCole on Fri, 13. Aug 21, 00:02, edited 1 time in total.

StevieLeeCole
Posts: 40
Joined: Fri, 10. Jul 15, 18:31
x4

Re: Adding new names to t files

Post by StevieLeeCole » Thu, 12. Aug 21, 02:44

Got it! For others who experience same frustration: After adding "new" object to game (e.g. weapon, shield, ship) and needing to create new name ID and description.
1. Go to the "t" folder in whatever version you are modifying
2. Create a blank xml file
3. Name the file "0004-L044.xml"; this will automatically be loaded into game without need to write a script to read it in! If you want to write a script to read it in, it is like two lines, then you can name it whatever you like.
4. Use the following as a template, the description ID always immediately follows the name ID numerically.

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<language id="44">
  <page id="17" title="Boardcomp. objects" descr="">
    <t id="5385">Argon Chain Gun</t>
    <t id="5386">The Argon Chain gun is a multi-barrel development of the tried and true IRE; attaining accuracy and consistent rate of fire with efficient use of energy for medium fighters or point defense applications.</t>
    <t id="5387">Phase Repeater Light</t>
    <t id="5388">The phase repeater light is the result of a collaboration between Boron scientists and OTAS engineers to develop a weapon with reduced energy consumption and greater range with minimal loss of power.</t>
    <t id="5389">OTAS Medium Particle Accelerator</t>
    <t id="5390">Another OTAS marvel, the MPA provides a medium weapon power profile by accelerating dense particles to extreme velocities at good range.  Slow rate of fire limits utility against some target types.</t>
    <t id="5391">Boron Star Borer</t>
    <t id="5393">This Boron beam weapon provides a power hungry but devastating beam weapon suitable for close range engagement.</t>
  </page>
</language>
5. Once this game data is loaded (in X3 Editor 2, reload game data), you can now just add new items in appropriate files (e.g. TLaser, TBullets) and select the name ID and it will populate for you!
6. Have fun! You WILL need to start a new game before the new stuff is available. To add to game without scripting, just add in manually to WareTemplate.pck (in "maps" folder, if you can't find).
7. Be very careful with unintended format changes using text editor. I would recommend using Notepad++ or an XML editor outside of X3 Editor 2 for this or unless you are really careful you may run into problems.

Post Reply

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