Got a prob adding a new Ship (not mod'ing an existing one)

The place to discuss scripting and game modifications for X²: The Threat.

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

-logical- Chimp
Posts: 45
Joined: Sun, 22. Feb 04, 00:57
x2

Got a prob adding a new Ship (not mod'ing an existing one)

Post by -logical- Chimp »

I've browsed through this forum, and the xscripting one, and read most of the articles on modifying the Tships file.

I've also read Revens tutorial on adding a new ware.

However, im having problems adding a new ship.
so far, i have:
1) added a new entry to the Tships file. (a modified mamba).
2) added a new language file, containing a definition for the new ware. (IDs were xxx1, xxx2 - which should be ship name, ship description, i think)
3) used the above ID for the entry in the Tships file.
4) edited the TWaresT file, and changed the ID of the 'NEW_6' entry at the bottom to use the above ID.

X2 starts OK, and i can load saved games etc.

however, i then ran into problems when i tried to use the script editor to add the new ship. the problem: the new ship didn't show up in the wares list, so i couldn't add it, or create a new instance of it.

Im guessing my problem stems from the fact that a Ship is not a regular ware, and thus is referenced in some way other than the TWares files.

I took a look around, but couldn't see any file that contained that sort of information. Nor could i find the files that controlled what wares were sold by each factory, or the definitions for shipyards/docks.

Baring Reven magically releasing his 3rd tutorial (which was going to cover this area, i think) does anyone have any pointers on which files to look in - either for adding ships to the game, so i can reference them from a script, or for adding the new ship direct to the shipyard, so i can just buy one :)

(for reference, the new ship works fine if i actually replace the mamba with it, but that is not my intention. the new ship is only a slight tweak to the mamba, but i would like it to remain unique. if i modify the mamba directly, every split who gets himself a mamba from now on will have my modified version. modifications involve: 1 extra shield, but less hull strength, more gun mounts (4, instead of 2), but less cargo space. slightly increased top speed. standard 'i wanna slightly-super ship' type mod, i guess)
-logical- Chimp
Posts: 45
Joined: Sun, 22. Feb 04, 00:57
x2

Post by -logical- Chimp »

as a further note:

after adding an init script to make sure my text file gets loaded, I attempted to use the 'Create Ship' function to just create an instance of my new ship. Using this function, i am able to see the list of ships, and my new one does not show up.

I take this to mean that as well as adding an entry to the TShips file, and adding entries into my language file, i either need to modify another file(s) to reference the new ship, or there is something wrong with the definition of the new ship. (seeing as it was generated using the latest info about the tships format, as documented in posts in this forum, its probably something in one of the unknown columns).

EDIT: Following The_Rocks advice, i have cross-posted to xscripting.com. http://www.xscripting.com/modules.php?n ... opic&t=756
Last edited by -logical- Chimp on Fri, 5. Mar 04, 11:05, edited 1 time in total.
The_Rock
Posts: 4088
Joined: Wed, 6. Nov 02, 20:31
x2

Post by The_Rock »

Have you tried posting here for help?

Some very talented individuals who post there.. :wink:
"How very touching his meaningless death was. But this fight was never for mortals".
-logical- Chimp
Posts: 45
Joined: Sun, 22. Feb 04, 00:57
x2

Post by -logical- Chimp »

another update:

It was pointed out in the xscripting forum that i had overlooked the 2nd number on the first line of the TShips file, which related to the number of entries in the file.

Unfortunately, incrementing that number did not cause my new ship to become available. still - i guess its one less thing to worry about later.

Further experimenting has turned up something else.

If i set my new ship to use the ID of the mamba, and set the mamba to use my new ships id, the game still uses the old mamba, except that it no longer has a name (its called ReadFile-something-or-other). The stats match the original ship though, so im certain its picking up the old ship.

I think this is further proof that there is an extra identifier in there, but i cant see what it is. (its not the SS_SH_S_M3 bit, as i changed that as well when i changed the IDs).
-logical- Chimp
Posts: 45
Joined: Sun, 22. Feb 04, 00:57
x2

Post by -logical- Chimp »

Now that 1.3 is out, will that mean i can add a new ship definition to the end of the TShips file, or are we still stuck with overwritting an existing ship ?

also, i have looked through the modding docs - the TShips section, while confirming a lot of columns, still leaves a couple undefined - does that mean they aren't used ?

and will we be able to request clarification on a couple of terms:
ship scene / ship main scene / gun scene

and does the 'class' for each turret (in the converted version 14 Tships file) tie to the 'class' of the cockpit ? (ie a turret with class=1 would be controlled from the view where class=1 ?)

EDIT
BodyID/BodyID2 for turrets
the BodyID = is that the point in the 'ship model' (ship main scene?) where the turret should be mounted ?
the BodyID2 = the point in the 'Turret model' (gun scene?) where the gun gets mounted ?
and BodyID2=-1 - does -1 mean that the gun is part of the turret model, instead of a separate model ?
-logical- Chimp
Posts: 45
Joined: Sun, 22. Feb 04, 00:57
x2

Post by -logical- Chimp »

while im trying to sort out the new information, a quick note:

i have added a new ship definition to the end of the TShips file (and updated the line counter) - the ship is still not available.

i guess the 'add your own ships' part of this patch only applies to adding replacement models for the existing ships.

while there are unused ships in the TShips file that can be overwritten, this is still a bit of a pain, as it puts a fixed limit on the number of ship types that can be added :(
Captain Data
Posts: 201
Joined: Thu, 12. Feb 04, 23:40
x2

Post by Captain Data »

Maybe it's the same problem as for the "you can't add NEW visible sectors to your galaxy". There must be a second file for the ships, maybe some kind of descriptionfile or an INI-like file.

The other possibility: The ships are hardcoded, that means you can MODIFY the ships, but cannot add new ships without going deeper in that game (or it's totally impossible).
-logical- Chimp
Posts: 45
Joined: Sun, 22. Feb 04, 00:57
x2

Post by -logical- Chimp »

and therein lies the problem...

im working on a ship customisation mod (ie you take a mamba to a dock, and ask for it to be reconfigured as an interceptor, for example).

however, because of the way the game works, i would have to add 30+ ships to the TShips file (based on 2 variants for each fighter). (this being the only way i can change shield type, guns, etc).

i certainly hope there is a way to do this, as currently there is only 1 variant for each ship. i cant help but think that the Split would have made a variant with more guns, but no cargo space (as an example) for rapid in-system defence. or perhaps the Argons would have modified a few Disco's by removing the guns, and packing bigger engines, to make a rapid military courier ship.

I want it so that, instead of seeing a mamba (i like that ship, ok :p) on screen, and immediately knowing all its capabilities, i want to have to think 'is it a fast interceptor, targetting me - or a heavy bomber, targetting my cap-ship. I want to have to consider whether the pilot has made it more nimble, at the expense of out-right speed.

of course, unless i can randomise the ships that the AI buy (so that it has the chance of making one of my variants instead of the stock mamba), the above paragraph will remain a pipe-dream. but i still want to add the ships, even if only for myself :D

Return to “X²: The Threat - Scripts and Modding”