question about changing existing ships

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

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

JMCorp
Posts: 1446
Joined: Thu, 21. Apr 05, 21:48
x4

question about changing existing ships

Post by JMCorp » Mon, 13. Jun 05, 17:47

ok, if this answer is in the forum already i cant find it. so be gentle. i've been searching since sunday noon for how to do this and either i'm blind or the answer isn't here yet.

in the cats for the game some ships are packaged as .BOB files. for instance, the discoverer. lets say i want to change one of these ships that is packaged as a .BOB file. for the ships that are .pbd i can jsut x2tool them out to a .BOD file but the .BOB file doesn't decomress?

how do i get the .BOB file into a .BOB file so i can change the disco?

ShadowX
Posts: 173
Joined: Wed, 24. Mar 04, 20:49
x2

Post by ShadowX » Mon, 13. Jun 05, 20:20

I guess .bob files cannot be converted to .bod. You can probably edit them with hex editor but you can also remake that ship from scratch.

Since discoverer doesn't contain too many v-bodies it is quite easy to make it with current knowledge of text-editor ship making.

If you haven't modified any ships yet, it's good to take one ready body file and modify it as you want. For example Pirate Orinoco exists as .bod file in cut\ folder - 04207.bod.

Useful tool is BODViewer, I use it for checking new parts and their default orientation.

All parts you need for discoverer can be found from Earthpilot's ship-part list

All v-bodies can be found from Earthpilot's List of 3d-bodies, this list is useful to use with bodviewer.

Important information about scene file(.bod) editing can be found here.

Ok, here's the orinoco file:

/===============================================================
/ 3D Scene Information from 3ds file: F:\src\xtract\export\04207.3ds
/===============================================================
/ 3dsload version Dec 12 2002 14:31:14

VER: 3;

P 0; B 106; C 1;
{ 2; -3200; -1400; 2600; 0.249944; 0.000000; 0.000000; -1.000000; -1; -1; } // 0
P 1; B -1;
{ 8; 6000; 3200; -3400; 0; 0; 2200; 0.000000; -1; -1; } // 0
P 3; B 904;
{ 2; 0; -200; -400; 0.000000; 0.000000; 0.000000; 0.000000; -1; -1; } // 0
P 4; B 106; C 1;
{ 2; 3300; -1400; 2600; 0.249944; 0.000000; 0.000000; -1.000000; -1; -1; } // 0
P 5; B 905;
{ 2; -1300; 100; -4600; 0.000000; 0.000000; 0.000000; 0.000000; -1; -1; } // 0
P 6; B 905;
{ 2; 1300; 100; -4600; 0.000000; 0.000000; 0.000000; 0.000000; -1; -1; } // 0
P 7; B 940;
{ 2; 0; 0; 0; 0.000000; 0.000000; 0.000000; 0.000000; -1; -1; } // 0
P 8; B 757; C 1;
{ 2; 0; -200; 1600; 0.000000; 0.000000; 0.000000; 0.000000; -1; -1; } // 0

Reason for taking Orinoco file is that it has two main guns making it quite easy to change.

Tships reveals that discoverer cockpit is 4th body of the scene so P 5; B 905; has to be changed to P 5; B 915; C 1; also guns of the ship must be in 1st at 0 position and 2nd at 2 position and they use same bodies as orinoco(106). C 1 defines that it's body for Cockpit 1 and Maingun/turret 1.

Here we are now:

===============================================================
/ 3D Scene Information from 3ds file: F:\src\xtract\export\04207.3ds
/===============================================================
/ 3dsload version Dec 12 2002 14:31:14

VER: 3;

P 0; B 106; C 1;
{ 2; -3200; -1400; 2600; 0.249944; 0.000000; 0.000000; -1.000000; -1; -1; } // 0
P 1; B -1;
{ 8; 6000; 3200; -3400; 0; 0; 2200; 0.000000; -1; -1; } // 0
P 3; B 106; C 1;
{ 2; 0; -200; -400; 0.000000; 0.000000; 0.000000; 0.000000; -1; -1; } // 0
P 4; B 106; C 1;
{ 2; 3300; -1400; 2600; 0.249944; 0.000000; 0.000000; -1.000000; -1; -1; } // 0
P 5; B 915; C 1;
{ 2; -1300; 100; -4600; 0.000000; 0.000000; 0.000000; 0.000000; -1; -1; } // 0
P 6; B 905;
{ 2; 1300; 100; -4600; 0.000000; 0.000000; 0.000000; 0.000000; -1; -1; } // 0
P 7; B 940;
{ 2; 0; 0; 0; 0.000000; 0.000000; 0.000000; 0.000000; -1; -1; } // 0
P 8; B 757; C 1;
{ 2; 0; -200; 1600; 0.000000; 0.000000; 0.000000; 0.000000; -1; -1; } // 0

Green = Cockpit
Red = main guns

As you have probably noticed 4th body doesn't mean a body with P 4; definition, it is 4th body from the beginning of the file(0 being the very first body).

Ok, rest is up to you since other v-bodies are not linked to TShips, alternatively you could place cockpit and main guns where ever you want and change TShips.

Next we place reference body 940. Since -1 is not needed(don't even know what is it for) we replace it with 940.
This
P 1; B -1;
{ 8; 6000; 3200; -3400; 0; 0; 2200; 0.000000; -1; -1; } // 0
we change to this:
P 1; B 940;
{ 2; 0; 0; 0; 0.0; 0.0; 0.0; 0.000000; -1; -1; } // 0
-This defines the targeting reticle location when targeting this ship and center when looking from outside view-

We still need engines, burners, turning jets and position lights.

Engines:
We change this
P 4; B 106; C 1;
{ 2; 3300; -1400; 2600; 0.249944; 0.000000; 0.000000; -1.000000; -1; -1; } // 0
to this
P 4; B 55;
{ 2; 3300; -1400; 2600; 0.249944; 0.000000; 0.000000; -1.000000; -1; -1; } // 0
and this
P 6; B 905;
{ 2; 1300; 100; -4600; 0.000000; 0.000000; 0.000000; 0.000000; -1; -1; } // 0
to this
P 6; B 55;
{ 2; 1300; 100; -4600; 0.000000; 0.000000; 0.000000; 0.000000; -1; -1; } // 0

burners:
We change this
P 7; B 940;
{ 2; 0; 0; 0; 0.000000; 0.000000; 0.000000; 0.000000; -1; -1; } // 0
to this
P 7; B 770;
{ 2; 0; 0; 0; 0.000000; 0.000000; 0.000000; 0.000000; -1; -1; } // 0
and this
P 8; B 757; C 1;
{ 2; 0; -200; 1600; 0.000000; 0.000000; 0.000000; 0.000000; -1; -1; } // 0
to this
P 8; B 770;
{ 2; 0; -200; 1600; 0.000000; 0.000000; 0.000000; 0.000000; -1; -1; } // 0
You can add position lights and turning jets at your discretion since there are quite many of them and finding their exact locations and placing them will take some time.

This is what we have so far:

/===============================================================
/ 3D Scene Information from 3ds file: F:\src\xtract\export\04207.3ds
/===============================================================
/ 3dsload version Dec 12 2002 14:31:14

VER: 3;

P 0; B 106; C 1;
{ 2; -3200; -1400; 2600; 0.249944; 0.000000; 0.000000; -1.000000; -1; -1; } // 0
P 1; B 940;
{ 2; 0; 0; 0; 0.0; 0.0; 0.0; 0.000000; -1; -1; } // 0
P 3; B 106; C 1;
{ 2; 0; -200; -400; 0.000000; 0.000000; 0.000000; 0.000000; -1; -1; } // 0
P 4; B 55;
{ 2; 3300; -1400; 2600; 0.249944; 0.000000; 0.000000; -1.000000; -1; -1; } // 0
P 5; B 915; C 1;
{ 2; -1300; 100; -4600; 0.000000; 0.000000; 0.000000; 0.000000; -1; -1; } // 0
P 6; B 55;
{ 2; 1300; 100; -4600; 0.000000; 0.000000; 0.000000; 0.000000; -1; -1; } // 0
P 7; B 770;
{ 2; 0; 0; 0; 0.000000; 0.000000; 0.000000; 0.000000; -1; -1; } // 0
P 8; B 770;
{ 2; 0; -200; 1600; 0.000000; 0.000000; 0.000000; 0.000000; -1; -1; } // 0

So the thing left is positioning and turning of parts. Positioning is very easy and turning is quite hard. Only things we need to turn are other side's engine and gun(since we don't add turning jets). Turning in this case is easy since we only need 180 degrees rotation which can be accomplished by changing this
{ 2; 0; 0; 0; 0.000000; 0.000000; 0.000000; 0.000000; -1; -1; } // 0
to this
{ 2; 0; 0; 0; 0.500000; 0.000000; 0.000000; 1.000000; -1; -1; } // 0

Parts in the left side of ship should be ok, so we apply this change to all needed right side objects. ...and we also remove all unnecessary rotation which were used in Orinoco.

Placing of new parts:
{ 2; 0; 0; 0;
First zero here is right/left(-) movement
Second zero here is up/down(-) movement
Third zero here is forward/backward(-) movement

This is as far as I go, it's a good practice to place all the parts right,
I added also part information here:

/===============================================================
/ 3D Scene Information from 3ds file: F:\src\xtract\export\04207.3ds
/===============================================================
/ 3dsload version Dec 12 2002 14:31:14

VER: 3;

/right gun
P 0; B 106; C 1;
{ 2; 3200; 0; 2600; 0.500000; 0.000000; 0.000000; 1.000000; -1; -1; } // 0
/reference body
P 1; B 940;
{ 2; 0; 0; 0; 0.0; 0.0; 0.0; 0.000000; -1; -1; } // 0
/left gun
P 3; B 106; C 1;
{ 2; -3200; 0; 2600; 0.000000; 0.000000; 0.000000; 0.000000; -1; -1; } // 0
/right engine
P 4; B 55;
{ 2; 2500; 0; 0; 0.500000; 0.000000; 0.000000; 1.000000; -1; -1; } // 0
/main cockpit
P 5; B 915; C 1;
{ 2; 0; 0; 0; 0.000000; 0.000000; 0.000000; 0.000000; -1; -1; } // 0
/left engine
P 6; B 55;
{ 2; -2500; 0; 0; 0.000000; 0.000000; 0.000000; 0.000000; -1; -1; } // 0
/right burner
P 7; B 770;
{ 2; 2500; 0; -1000; 0.000000; 0.000000; 0.000000; 0.000000; -1; -1; } // 0
/left burner
P 8; B 770;
{ 2; -2500; 0; -1000; 0.000000; 0.000000; 0.000000; 0.000000; -1; -1; } // 0

As you try this, you will see that modifications needed are quite minimal.

Just overwrite your 04169.bod from cut\ folder or save as for example cut\44444.bod and change argon discoverer scene in tships from 4169 to 44444.


Ooops...this wasn't suppose be a guide :roll:

JMCorp
Posts: 1446
Joined: Thu, 21. Apr 05, 21:48
x4

Post by JMCorp » Mon, 13. Jun 05, 20:47

haha i do that too :) spend an hour typing a reply that was supposed to be a 5 second thing. but dont worry i appreciate much the assistance.

i had planned on trying to rebuild the disco from scratch like you suggested but i couldn't find the ship parts list you link because it was on the german forum haha. i gotta do that for any ship that is BOB'd since i'm doing something very evil with my ships.

i had most of the other info already since i been slumming the forum here for a week reading everything i could find, but your post will really help the next guy out. you're the man!

User avatar
Moonraven
Posts: 968
Joined: Wed, 27. Aug 03, 11:13
x3

Post by Moonraven » Mon, 13. Jun 05, 21:07

@Shadow X

You can convert the files, not yet, but a utility is in progress do compile/decompile Bob/Bod files.
Gruß Moonraven
Wer lesen kann, ist ganz klar im Vorteil.
[ external image ]

JMCorp
Posts: 1446
Joined: Thu, 21. Apr 05, 21:48
x4

Post by JMCorp » Tue, 14. Jun 05, 01:25

update:

this is really really freaking HARD!! all y'all notepad modelers deserve major respect.

Harlock776
Posts: 2261
Joined: Wed, 9. Mar 05, 21:53
x2

Actually

Post by Harlock776 » Tue, 14. Jun 05, 21:37

Notepad is much easier for making rotating animated parts for ships. The most difficult part for using notepad is having to constantly repack a mod and load it in game to see a minor change in part position when making ships with notepad. I think I spent a day per ship when I made the first version of my mod and position lights were a big time waster lol.

There is now a bob to bod converter available thanks to Doubleshadow!!!

Here is the link to his site with the file...

http://www.doubleshadow.wz.cz/x2bc/index.php?p=about

With a tool like this I can cheat and animate rotating parts for my ships without making a huge cut file from 3dsmax hehe:-)

JMCorp
Posts: 1446
Joined: Thu, 21. Apr 05, 21:48
x4

Post by JMCorp » Tue, 14. Jun 05, 21:49

i'm having trouble getting a turret gun to fire. so i read through all of earthpilot's threads and i thought i understood it. anyway what i did to figure this out is make a test bod file for the disco with a cockpit, one gun and one turret. i still cant get the turret to fire, and i swear i'm doing everything right.

would someone that's done this take a look at these and see if they can figure out what i'm doing wrong? the guns fire forward but the rear gun will not fire.

this is the Tships.txt entry:
940;0;0.40000;0.33333;0.40000;7;3151;99900;8436;105;1;5;89;150;168;
202;14169;4511;16777219;3;0;3;0;5;2;5;15;50;109;2;0;0;0;0;0;0;0;0;0
;0;0;1;1;750;35;36;1;2;1;0;915;0;2;1;91;2;2;1;2;1;2;1;1;106;3;111;1;
2;1;106;3;111;1;3;1;2;1;3;1;91;16;89;1;26;400;25;1;0;SS_SH_A_M5;

and this is the bod file:
/===============================================================

/ 3D Scene new discoverer

/===============================================================

/ clay dough'd together by jmcorp

VER: 3;

/
/ 0, 0, 0, = center
/ right, up, forward
/





/==cockpit
P 1; B 915; C 1;

{ 2; 0; -0; -0; 0.000000; 0.000000; 0.000000; 0.000000; -1; -1; } // 0
/== reference body
P 2; B 940;
{ 2; 0;0;0; 0.000000;0.000000;0.000000;0.000000; -1;-1; } // 0
/==turret
P 3; B 91; C 2;
{ 2; 1;-136;-1967; 0.499985;0.000000;1.000000;0.000000; -1;-1; } // 0

/== gun left
P 4; B 106; C 1; N 106_1b;
{ 2; -4338;-537;680; 0.500046;0.000000;0.000000;1.000000; -1;-1; } // 0

*edit* put line breaks in that tships entry
Last edited by JMCorp on Tue, 14. Jun 05, 22:05, edited 1 time in total.

Harlock776
Posts: 2261
Joined: Wed, 9. Mar 05, 21:53
x2

missing

Post by Harlock776 » Tue, 14. Jun 05, 22:01

Where is part 0 in your file?

When using notepad make sure you make part 0 body 940 it's just easier and makes it possible to make some sort of ship template.

Always make part 1 the main cockpit body and set your forward guns to be the next few parts. Anything after that should be turret cockpits. A good example of a decent cut file is the teladi firebird that skyroguen made it's linked in the sticky links at the top of the forum.

JMCorp
Posts: 1446
Joined: Thu, 21. Apr 05, 21:48
x4

Post by JMCorp » Tue, 14. Jun 05, 22:09

i think i just figured it out... testing it now

*edit* ok yep that was it. when copying the entries from the nova(with a working turret) i forgot to change the path ID in the turret gun to match the turret path id in Tships :oops:
Last edited by JMCorp on Tue, 14. Jun 05, 22:40, edited 1 time in total.

Legion400
Posts: 1380
Joined: Mon, 11. Oct 04, 22:47
x2

Re: Actually

Post by Legion400 » Tue, 14. Jun 05, 22:30

Harlock776 wrote:The most difficult part for using notepad is having to constantly repack a mod and load it in game to see a minor change in part position when making ships with notepad.

You can do it unpacked just have a 2ns game purely for modding and have all the unpacked files in the modding game.


Then all you do is change the bod file useing notepad then put the changed bod into the cut file and then start taht game.


I was able to almost finish the engines of my ship in 30mins using this technique (I have everything ether on or shortcuted on my desktop for quick access)



Hehe and im still a begginer :D
My Roid Table: Special Thx to Greyhawk for hosting
http://gr3yh4wk.50megs.com/Files/Table% ... 20v1.2.rar

ShadowX
Posts: 173
Joined: Wed, 24. Mar 04, 20:49
x2

Post by ShadowX » Tue, 14. Jun 05, 23:25

JMCorp wrote:940;0;0.40000;0.33333;0.40000;7;3151;99900;8436;105;1;5;89;150;168;
202;14169;4511;16777219;3;0;3;0;5;2;5;15;50;109;2;0;0;0;0;0;0;0;0;0
;0;0;1;1;750;35;36;1;2;1;0;915;0;2;1;91;2;2;1;2;1;2;1;1;106;3;111;1;
2;1;106;3;111;1;3;1;2;1;3;1;91;16;89;1;26;400;25;1;0;SS_SH_A_M5;

Did it work ok?

I spotted another thing:
This number should be 0, it defines the cockpit location inside the 91 turret/cockpit body. Now you should be able to fire at desired direction but the gun(which you see when you are using the turret) should be static, change this to 0 and it will follow the targeting reticle.

JMCorp
Posts: 1446
Joined: Thu, 21. Apr 05, 21:48
x4

Post by JMCorp » Wed, 15. Jun 05, 00:27

i got the turret to fire, but i wasn't paying attention to the gun... i'll have to check that.

Harlock776
Posts: 2261
Joined: Wed, 9. Mar 05, 21:53
x2

Unpacked games

Post by Harlock776 » Fri, 17. Jun 05, 00:16

Why I don't run any unpacked games...

I want to constantly test my mod before release and so having to repack it all the time insures that I will find any problems quickly.

If there are any packing errors I will notice them early on instead of after I release the mod.

This game is already buggy enough and it doesn't need any help to annoy me further lol.

Leaving as many parts of the game files untouched or default makes it easier to find out what the problem is when something goes wrong.

Oh yeah and it saves a lot of hard drive space too:-)

Legion400
Posts: 1380
Joined: Mon, 11. Oct 04, 22:47
x2

Post by Legion400 » Fri, 17. Jun 05, 07:53

Meh i ahve a 120gig HD


Im only making ships atm so its alright for me.


Havnt had any bugs yet but then i do check my ship in 1 sector, 1 sun,1 station and 1 ship uinverse and then i script in what im viewing.
My Roid Table: Special Thx to Greyhawk for hosting
http://gr3yh4wk.50megs.com/Files/Table% ... 20v1.2.rar

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