Ship Creator/Installer and X3 Editor

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

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

Post Reply
SpuddyMcFuddy2
Posts: 56
Joined: Thu, 10. Nov 05, 11:53
x3

Ship Creator/Installer and X3 Editor

Post by SpuddyMcFuddy2 » Sun, 10. Dec 06, 20:39

Hello,

I am currently attempting to replace the Argon ships in the game with a fleet of B5 ships. I have edited all the appropriate ships IDs so that they are the sames as the ones they are replacing ie SS_SH_A_M2 - which is the Argon Titan and replaced it with my Omega Destroyer. This seemed to work; except for the odd thing that my starting ship changed; I had to delete the Titan with X3 editor in the ShipCreator.cat TShips file. When I added another ship to the game replacing the M6 with 'my' M6; the Argon M2 was back.

In fact every time I edit the TShips file; if I edit again by adding or removing ships using the ShipInstaller; it returns all the old ships I have deleted; including about 100 or so ships called - N/A SHIPCREATOR and then either DELETED or DISABLED or SPACER after it. No matter how many times I delete the entries I don't want within TShips, Ship Installer replaces them. It even replaced the 100 or so shipcreator files which I had to manually delete as you can only select one entry at a time.

The frustrating thing is; when I replace a shipe with one of my own it seems to work other than having a different ship at startup; the more ships I add the further it gets from the proper M4 startup. It went from an M4 (no mod) M5 with one ship changed thru and Elephant and eventually a Colossus! Nice for flogging at the start of a game; but considering I am supposed to be in a Buster - it seems a bit odd. I don't know if this is solely a ShipInstaller problem or just they way I am doing it; can anyone help me? I really want my B5 ships replacing the Argon ones - I am raring to see a Omega bearing down on some Centauri or Narn destroyer!

Please help
Aspiring to have the time to play.

7 year old boys (still) don't understand it's not a game; its a way of lfestyle.

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22227
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Sun, 10. Dec 06, 21:52

the ship creator mod is designed to be auto created, when ever you load the program it will auto create it based on the base mod. What you need to do.

is create a new mod with TShips from the original game, then make ur changes with that. Then set that as the base mod, the shipcreator mod will be created with that TShips that you edited with any extra ships installed on top of it.

the spacer entries are a buffer, this allows the basse TShips to had lots of ships added without changing the ids of the installed ships. The Disabled and Deleted entries are when you disable or delete ships from the game.

This is so when a ship is delete, it doesn't remove it from TShips and effecting the position id of all the ships that come after it

SpuddyMcFuddy2
Posts: 56
Joined: Thu, 10. Nov 05, 11:53
x3

Post by SpuddyMcFuddy2 » Sun, 10. Dec 06, 22:40

Erm; silly question but - how do I create a new mod?
Aspiring to have the time to play.

7 year old boys (still) don't understand it's not a game; its a way of lfestyle.

SpuddyMcFuddy2
Posts: 56
Joined: Thu, 10. Nov 05, 11:53
x3

Post by SpuddyMcFuddy2 » Sun, 10. Dec 06, 23:32

actually, more importantly why does my starting ship change when I replace the ships?
Aspiring to have the time to play.

7 year old boys (still) don't understand it's not a game; its a way of lfestyle.

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22227
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Mon, 11. Dec 06, 01:28

when you replace the ship, do u delete the existing one then add a new entry at the end ?

if so, then u've changed all the ids of the ships that come after it. So any thing thats used in scripts and things will now be pointing to the wrong ship

SpuddyMcFuddy2
Posts: 56
Joined: Thu, 10. Nov 05, 11:53
x3

Post by SpuddyMcFuddy2 » Mon, 11. Dec 06, 06:58

What I do is add the ship, then delete the ship that it replaces; which way should I do it?
Aspiring to have the time to play.

7 year old boys (still) don't understand it's not a game; its a way of lfestyle.

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

Post by doubleshadow » Mon, 11. Dec 06, 09:34

SpuddyMcFuddy2 wrote:Erm; silly question but - how do I create a new mod?
How to create a mod using X3 ModManager and how to put TShips into it

You don't want to "replace" a ship. You do want to *overwrite* a ship.
If you want for example Argon M6 to be something different, you make your own mod (see above) put TShips (and others) into it and then change the things you wanna change in the Argon M6 definition.

Chanage its Description ID so it will be called "My super ship", change its scene to point to your model, change its speed.

Do not change the ship class - the game expects a ship with certain index to have a certain class. Changing it may cause some side effects.

Why you don't want to replace a ship:
when X3 "needs" a ship, it will either look at certain hardcoded *index*, or it will look for specific *ship ID*.

When you start new game as "Bancrupt Assasin", X3 will spawn ship with index 14 - it doesn't care what the ship does look like, nor whether it is really a Split ship. That's why you must not mess with the ship indexes. You may however add ships at the end of the list (as Cycrow's program does), as this does not change indexes of the default "stock" ships.

Also scripts are using the ship index so script like:

Code: Select all

create ship "Argon M3"

is in reality stored as

Code: Select all

create ship 5
(well the real number is in fact a bit different...)

SpuddyMcFuddy2
Posts: 56
Joined: Thu, 10. Nov 05, 11:53
x3

Post by SpuddyMcFuddy2 » Mon, 11. Dec 06, 18:31

Ok, clearly doing something wrong.

I have made a new mod, it contains :
t directory with
449001.pck
types directory with
Components
Dummies
TCockpits
and
TShips
in it (all .pck)

and
ships directory with my 2 ships in.
in there own directories -
ships\Bab-5\Omega\omega_M2_scene.pbd
and its various other parts in the parts directory.

I have now gone into X3 Editor and changed the M2 Ship Scene entry for the one above, excluding the .pbd. However when I load the game, now there is nothing where there should be a big M2?! Where am I going wrong?

Also, how can I change the name from M2 Titan to M2 Omega or whatever?

And, if I change the image, and admittedly can change the stats of the ship; won't it have turrents, viewpoints etc; at the places of the original ship?

Thanks for any help! I certainly need it !
Aspiring to have the time to play.

7 year old boys (still) don't understand it's not a game; its a way of lfestyle.

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22227
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Mon, 11. Dec 06, 21:25

if you change the scene file to a new one, then it will display the models from the new scene file instead.

however, the cockpit and turret positions will most likly be in the wrong place.

to change the names, u have to edit the main text file, or create a new text file to override the original text

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

Post by doubleshadow » Tue, 12. Dec 06, 08:26

Try reading this: Troubleshooting Imported Ships.

If you see "nothing" when you spawn the ship then:

Check the scene file: it must be stored in objects directory (example: objects\doubleshadow\ships\MyShip_scene.bod)
The Ship scene entry in X3 Editor must contain the scene path without the objects part and extension (example: doubleshadow\ships\MyShip_scene)

Next you need to take a look inside the scene file. Open it in some text editor (Notepad will do) and check the object paths:

Example of scene path entry (taken from Deadly's Banshee):

Code: Select all

P 11; B ships\Deadly\Banshee-M4\props\hull; N ships\Deadly\Banshee-M4\props\hull;  // idx 11
{ 0x2002;  0; -97; 2490;  0.000000; 0.000000; 0.000000; 0.000000;  -1; 1; } // 0
Check Scene file syntax.

B ships\Deadly\Banshee-M4\props\hull is path to body file. It's relative to objects directory. It must point to an existing file (the full path to the above one would be objects\ships\Deadly\Banshee-M4\props\hull.bod (or bob/pbb)). The N ... is just a name from 3ds Max. It doesn't have any meaning and doesn't need to be in the scene at all.

This should (hopefully) help.

SpuddyMcFuddy2
Posts: 56
Joined: Thu, 10. Nov 05, 11:53
x3

Post by SpuddyMcFuddy2 » Tue, 12. Dec 06, 09:08

Way-hey; new destroyer !!! Nice!


It doesn't fire and it doesn't looks likes its even gonna fire but; it looks cool.

If I edit the Cockpits/Turrets/front lasers etc sections to match the one that the Ship Installer creates thereby making a replica of a correctly installed one manually... should it work or is there something else I need to have done?
Aspiring to have the time to play.

7 year old boys (still) don't understand it's not a game; its a way of lfestyle.

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22227
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Tue, 12. Dec 06, 12:35

if you want to put the ship into a mod manually from an XSP file, you can simply extract it, then copy the TShips line into your current TShips. If you have custom cockpits, u'll have to adjust these ids however to match.

to get the turrets working, what you first need to do is set each turret entry to the correct model in the scene files. Usually you have sectionsi n the scene file like ships\props\cameradummy, ships\props\turretdummy.

these models are basiscally the position the cameras/turrets should be placed. You need to set each of the currects to use one of these with the correct index.

once your turrets in place, you should be able to cycle the camera views between these turrets in game.

finally, u'll need to set all the gun positions, this is a little tricker, but it works in a simlar way, you need to set the correct model and idx for each of the guns for each of the turrets

SpuddyMcFuddy2
Posts: 56
Joined: Thu, 10. Nov 05, 11:53
x3

Post by SpuddyMcFuddy2 » Tue, 12. Dec 06, 15:13

You refer previously to changing the name and it needs to be done in the main text file; which is that?



Incidentally I now have a fully functioning Omega Destroyer replacing the Argon Titan - which is cool. Its fairly violent if you get it cross - heh heh


Thanks for all your help.
Aspiring to have the time to play.

7 year old boys (still) don't understand it's not a game; its a way of lfestyle.

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

Post by doubleshadow » Wed, 13. Dec 06, 08:58

SpuddyMcFuddy2 wrote:You refer previously to changing the name and it needs to be done in the main text file; which is that?
Text Resource Files are located in t directory. The main file would be 440001 for English version. However there is no main text file per se. You can add info into the 0001, or you can create another file named in sequence (440003 - 0002 is already used).

However the only correct way when making a redistributable mod is to make an xml file with your own unique number - like 440123 - and then create setup script which will load your xml file into the game.

The script looks like:

Code: Select all

LoadText <file number>
In the above case it would be:

Code: Select all

LoadText 123
The language code (44) is omitted.

Example of the xml file for your ship:

Code: Select all

<page id="17">
 <t id="1">My ship</t>
 <t id="2">My ship description</t>
</page>
Note that the text ID's must be globally unique (so you really cannot use 1 and 2 as I did here).

SpuddyMcFuddy2
Posts: 56
Joined: Thu, 10. Nov 05, 11:53
x3

Post by SpuddyMcFuddy2 » Wed, 13. Dec 06, 09:06

I have a new problem now;

I have now added 2 TP's, a TL and an M6, not including the M2 I already added - and excluding the fact taht the TP fired fighter drones at me, only the M2 fires back. I am a little confused as the new M6 has exactly the same details; turrets, guns etc, as what it is supposed to have; but if it wasn't for its fighter escort the M6 is quite a easy sitting duck target, as is the TL and TP's.

Am I do something wrong again!?
Aspiring to have the time to play.

7 year old boys (still) don't understand it's not a game; its a way of lfestyle.

SpuddyMcFuddy2
Posts: 56
Joined: Thu, 10. Nov 05, 11:53
x3

Post by SpuddyMcFuddy2 » Wed, 13. Dec 06, 20:44

What does cause the turrets not to fire anyway?
Aspiring to have the time to play.

7 year old boys (still) don't understand it's not a game; its a way of lfestyle.

fud
Posts: 9837
Joined: Wed, 25. Jan 06, 14:26
x3

Post by fud » Wed, 13. Dec 06, 20:50

Could be a couple different things, but the likely candidate is inaccurate indexing in TShips that corresponds with the scene file.

SpuddyMcFuddy2
Posts: 56
Joined: Thu, 10. Nov 05, 11:53
x3

Post by SpuddyMcFuddy2 » Thu, 14. Dec 06, 09:10

When I "overright" a ship using X3 Editor I install it using X3 Ship Manager Installer; then go into my mod and edit it manually therefor creating an exact copy of the Ship Installer version; which theoretically must be right.
I have had a look thru again at the M6 and I cannot see anywhere where there is a difference between then two; so what else can cause problems as the indexes all appear correct. Unless there is a problem with the original ship - the Monsoon (from an XSP package)
Aspiring to have the time to play.

7 year old boys (still) don't understand it's not a game; its a way of lfestyle.

Post Reply

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