Transferring a ship from one mod to another

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

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

BlackArchon
Posts: 1016
Joined: Wed, 4. Feb 04, 17:37
xr

Transferring a ship from one mod to another

Post by BlackArchon » Sun, 26. Jul 15, 18:52

Hi guys,

I want to use ships from XRM in LU, and I want to start with the X2 ones. After observing the game files with X3 Editor 2, I stated that I have to do the following (please correct me when something is wrong):

- I have to copy the ships from objects\ships\OldShips from XRM to LU (this folder contains many files like argon_old_M1, argon_old_M1_scene and so on)
- Questions: do I have to copy XRM's cockpit scene file, or can I use LU's cockpit scene files? What is exactly the content of an cockpit scene file?
- I have to copy the ships' entries from TShips, and I have to edit the laser and missile bitmasks to fit for LU
- all other files mentioned in a ship's TShips line also have to be copied to LU
- I have to create an entry in mov\00044.xml for the new ship

Have I forgotten something?

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

Post by Cycrow » Sun, 26. Jul 15, 21:32

Depending on the ship, you may also need to get data from CutData, Animations, Dummies and Components and add those into the mod files.

if the ship uses custom textures, you will also have to copy those

BlackArchon
Posts: 1016
Joined: Wed, 4. Feb 04, 17:37
xr

Post by BlackArchon » Sun, 26. Jul 15, 22:10

Is there another way to see which additional data is necessary than to simply try it and see if there are any problems?

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

Post by Cycrow » Sun, 26. Jul 15, 22:13

You could use the Creator from the Plugin Manager. It can detect all the data connected with a ship automatically and extract from the mod.

then you can import it into the other mod, either by installing it via the plugin manager, or merging the ship data manually


BlackArchon
Posts: 1016
Joined: Wed, 4. Feb 04, 17:37
xr

Post by BlackArchon » Mon, 27. Jul 15, 21:52

I almost successfully integrated a ship from XRM to LU. The ship's stats, default wares and the weapon layout (there are plausible weapons installed on the main guns as well as in the turrets - I guess this is Litcube's work) are all fine. I can move and shoot with my front cannons.
However, neither I can fire a weapon in my turret, nor my turret itself can. It has a compatible weapon installed, but when I hit the fire button, nothing happens.

What can cause this behaviour?

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

Post by Cycrow » Tue, 28. Jul 15, 09:45

that would be missing entries from Components, which will define the position of the guns.

without it, they will be placed at 0,0,0 (centre of the ship)
as they are inside the model, they cant fire

BlackArchon
Posts: 1016
Joined: Wed, 4. Feb 04, 17:37
xr

Post by BlackArchon » Tue, 28. Jul 15, 18:32

Thanks for the hint! I exported this one ship with the "Export" button in Package Creator V1.30. This was the result: http://s000.tinyupload.com/index.php?fi ... 8093614917

So I guess the missing data for the turrets aren't within this ZIP file?

----

To use the ship in LU, I copied the content of this ZIP file to my X3 directory with LU installed. Additionally I appended the TShips entry (from XRM) to LU's file.

There are two differences between XRM's TShips entry of this ship and the one in pluginmanager.txt.
The first difference is the cockpit index - in XRM's entry it is 27, 28 and 28 while in pluginmanager.txt it's SS_COCKPIT_A_REAR_M6(27), SS_COCKPIT_A_RILE_M6(28) and SS_COCKPIT_A_RILE_M6(28). Ok, obviously these are additional hints for the Package Creator.
The second difference is the hull strength - in pluginmanager.txt it's only one third of its original value. Why is this? If you use a diff tool to compare these two TShips entries you will see that better.

XRM's TShips entry:

Code: Select all

0;0;0.113333;0.115;0.1;SG_SH_M6;80004;53879;4100;101;1;220;5;2800;112;247;ships\OldShips\argon_old_M6_scene;ships\argon\cockpits\argon_m6_cp_scene;268437517;7;13875;0.02453;3;3;16391;9;9;6;900;1375;0;27;2;28;4;28;3;0;0;0;0;0;0;0;3;1;165000;40;41;50;8;21;OBJ_SHIP_M6;4;1;0;ships\props\cameradummy;8;2;1;ships\props\cameradummy;9;3;2;ships\props\cameradummy;11;4;3;ships\props\cameradummy;13;4;1;4;1;4;1;1;ships\props\invisible_weapon;3;;-1;2;1;ships\props\invisible_weapon;4;;-1;3;1;ships\props\invisible_weapon;5;;-1;4;1;ships\props\invisible_weapon;6;;-1;5;1;2;1;5;1;ships\props\Sx2_dummy;7;ships\props\Sx2_body;0;6;1;3;1;6;1;ships\props\Sx2_dummy;10;ships\props\Sx2_body;0;7;1;4;1;7;1;ships\props\Sx2_dummy;12;ships\props\Sx2_body;0;1;148505;1;1;0;148505;333;0;0;SS_SH_OA_M6;
Entry from pluginmanager.txt:

Code: Select all

0;0;0.113333;0.115;0.1;SG_SH_M6;80004;53879;4100;101;1;220;5;2800;112;247;ships\OldShips\argon_old_M6_scene;ships\argon\cockpits\argon_m6_cp_scene;268437517;7;13875;0.02453;3;3;16391;9;9;6;900;1375;0;SS_COCKPIT_A_REAR_M6(27);2;SS_COCKPIT_A_RILE_M6(28);4;SS_COCKPIT_A_RILE_M6(28);3;0;0;0;0;0;0;0;3;1;55000;40;41;50;8;21;OBJ_SHIP_M6;4;1;0;ships\props\cameradummy;8;2;1;ships\props\cameradummy;9;3;2;ships\props\cameradummy;11;4;3;ships\props\cameradummy;13;4;1;4;1;4;1;1;ships\props\invisible_weapon;3;;-1;2;1;ships\props\invisible_weapon;4;;-1;3;1;ships\props\invisible_weapon;5;;-1;4;1;ships\props\invisible_weapon;6;;-1;5;1;2;1;5;1;ships\props\Sx2_dummy;7;ships\props\Sx2_body;0;6;1;3;1;6;1;ships\props\Sx2_dummy;10;ships\props\Sx2_body;0;7;1;4;1;7;1;ships\props\Sx2_dummy;12;ships\props\Sx2_body;0;1;148505;1;1;0;148505;333;0;0;SS_SH_OA_M6;
What am I missing?

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

Post by Cycrow » Tue, 28. Jul 15, 19:19

im unable to download the file, NOD32 is blocking the site and wont let me override

The differences with the plugin manager version, is that it uses the String id instead, which is then replaced when you install it with the plugin manager.

if it uses custom cockpits, these entries will be added onto the end of the TCockpits file. then it uses the String id to find the new position of those within the file. Otherwise it can end up pointing at the wrong cockpit entries

you can just replace those with the correct numbers.

i've no idea why the hull strength will be different, unless you goto Customise ship, those values should remain the same as the original mod.

Is it possible that you are not looking in the correct TShips, ie theres another one somewhere in the directory that changes the hull strength?

I've noticed its not output all the entries when exporting. Originally i had it create all the T files when you extract it, will have to look at adding that back.
I will add those entries into the pluginmanager.txt file for the next release.

That ship does have a number of Component entries, you can view them in the Creator.

You could try using the plugin manager to install the ship. Either in a seperate directory (then copy the changes over), or straight into LU.
Despites LU saying the plugin manager wont work, i see no reason why that would be the case, i have tested custom ships in LU and they do work fine.

Otherwise wait until i have a new version that will include all this stuff in to export (should hoepfully be the weekend)

BlackArchon
Posts: 1016
Joined: Wed, 4. Feb 04, 17:37
xr

Post by BlackArchon » Tue, 28. Jul 15, 19:42

I uploaded the file to another location, this should be better: http://blubb.najut.org/lu/centaur_mk1_neu.zip

And I also found the reason for the different hull strengths: When I created the ZIP file, I was using that cat/dat file of part 2 from XRM. I forgot that I'm also using a hull pack which increases the hull strengths. So when loading the ship from the VFS, it has the correct value. So your assumption that I wasn't using the correct TShips was correct. :)

So you mean if I extract the ship with the Package Creator to XSP format and importing this with the Plugin Manager in LU it will work?

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

Post by Cycrow » Tue, 28. Jul 15, 19:56

it should work yeah, save the imported ship to an xsp. Then run the Plugin Manager, set the active directory to you LU install, set it to modified mode then install the XSP.

make sure you close the Plugin Manager before starting the game, and it should add the ship into the game

BlackArchon
Posts: 1016
Joined: Wed, 4. Feb 04, 17:37
xr

Post by BlackArchon » Tue, 28. Jul 15, 20:10

I just tested it: It works fine, all turrets can fire! :)
Since all my X3 installs are version controlled, I can also see what exactly has changed. Especially TCockpits looks interesting, because there is no such entry in the ZIP. Most probably this was missing.

And I can imagine why Litcube doesn't like the Plugin Manager: it copies so many additional scripts to addon\scripts. Is the "Community Plugin Configuration", the "Hotkey Manager" and the "Ware Manager" really absolutely necessary?

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

Post by Cycrow » Tue, 28. Jul 15, 20:30

No, they are not necessary. However, many other scripts use them, which is why they are installed automatically.

They generally dont do anything unless you have other scripts installed however, so they shouldn't really effect the game

If you dont want them installed automatically, just delete the spk files from the Required Directory where you installed the Plugin Manager.

ie, C:\Program Files (x86)\Egosoft\X Plugin Manager\Required

anything in there is installed automatically.

The Plugin Manager library scripts are required for the installed ships. They load the plugin managers text file, as well as purging ships from the universe that you have since uninstalled. They also allow other scripts to access the custom ships by thier ID's (as custom ships will be in different positions in TShips from game to game so scripts cant use them directly)

For TCockptis, like the other files are auto generated, the zip file is only exporting the physical files, not the generated ones. I will add the generated files to the export as well in the next version (was just an oversight by me)

BlackArchon
Posts: 1016
Joined: Wed, 4. Feb 04, 17:37
xr

Post by BlackArchon » Wed, 29. Jul 15, 16:26

Thank you for your help! I'm looking forward to the next update. :)

BlackArchon
Posts: 1016
Joined: Wed, 4. Feb 04, 17:37
xr

Post by BlackArchon » Wed, 29. Jul 15, 20:38

I was always wondering where the rules for a ship's standard wares are defined. Can you give me a hint please? I googled for various terms to express this, but obviously I'm not using the correct words to find relevant information.

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

Post by Cycrow » Wed, 29. Jul 15, 21:05

you mean the equipment the ships get spawned with ?

Its either from the WareLists or its random. There are a few script commands that can equip ships, like add shield/weapons per value, or add default wares to ships.

These basically have a random chance of adding each of the common upgrades based on ship class.

This is hardcoded, so you cant edit this.

Ships spwaned from jobs can specify a WareList to use, which basically lists everything that should be added to the ship.

Some ships from jobs also have config scripts (also set from the jobs file) The config scripts are run when the ships are first created and can be used to add additional wares to the ships

BlackArchon
Posts: 1016
Joined: Wed, 4. Feb 04, 17:37
xr

Post by BlackArchon » Thu, 30. Jul 15, 16:56

Sorry, I wasn't clear enough. I spoke of the weapons (I know that the ship extensions are usually defined in WareLists). If I create a ship several times, it may have different installed weapons in its cargo bay. This is what I want to know: be it XRM or LU, there must be some rules for the game on how to outfit ships. So I should have a look at the jobs file? Ok...

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

Post by Cycrow » Thu, 30. Jul 15, 18:10

For weapons/shields, there are 2 ways to outfit a ship

one is the script command, add default wares, which will add a default selection of weapons. This is simply based on what weapons the ship can take.

The other is the add laser/shield by value. The value is a % chance of the best being added.
This is the method used by the jobs engine.

Essentially the weapons are ordered by rank (this is simply a hardcoded order).
There is a random check against the value for the top weapon, if it fails, it moves to the next weapon in the list and increases the chance. This continues until a weapon is picked. The higher the value, the more chance of having the top weapons installed

BlackArchon
Posts: 1016
Joined: Wed, 4. Feb 04, 17:37
xr

Post by BlackArchon » Sun, 2. Aug 15, 14:54

Thanks, another mystery of X3 explained. :)

I got a problem while I was transferring the Khaak Frigate from XRM to LU. The lighting effects aren't there, as well as the textures. Here is a screenshot of the ship from XRM: http://i.imgur.com/60bNsUr.png
And here from LU: http://i.imgur.com/pMUAIS4.png
The exported file from Package Creator 1.31 is there: http://blubb.najut.org/lu/Khaak_Frigate.zip
I did the same thing when transferring other ships from XRM, but here something is missing. What could be my error?

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

Post by Cycrow » Sun, 2. Aug 15, 15:48

sounds like its using custom textures and the creator isn't detecting those custom textures to extract this.

the most likely reason is that the mod files are in the compiled bob format, instead of the plain text bod format.

unfortunately the plugin manager doesn't currently support reading of the bob files so it cant detect textures from those models, those you will have to do manually.
Another option is to convert the model files in XRM from bod to bod so they can be analysed by the Creator

it is something i plan to implement at some point, but cant really say when that will be

Post Reply

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