How to move the cockpit (and laser)

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

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

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

How to move the cockpit (and laser)

Post by doubleshadow » Mon, 12. Dec 05, 12:06

Have you tried to move the cockpit part to to the front of ship to get rid of the supid "noses" and failed?

I did and failed as well. The reason why is easy. It is called types\Components.txt

This file hold position of all "special" parts in all bodies (meshes). Unlike X2, X3 does not use the "special" parts in mesh to determine the cockpit/laser positions. Instead it will look in the "component" file and use the position stored there. That's why moving the cockpit part "does nothing".

So I have to alter the "components" file?

No, you don't have to. Just move the cockpit/laser parts where you want them, export the body file and then delete the Components.txt file. X3 will re-create the file based on the body data and your cockpit/lasers position will be as you exported them.

Why I don't like the "components" file

I really don't see any reason why Egosoft did this. There can hardly be some performance gain as you can simply calculate all the positions "on the fly" while loading the mesh - that is when the corresponding ship (whatever) is being displayed.

Re-creation of the components file takes AGES to complete. At last at my computer (which is not really up to date anymore...). I don't understand why it takes so long to recreate the file. Hmm... as I'm thinking of it now, maybe I know why, but nevertheless I'm refusing to wait ages every time I move my cockpit.

I think that the components file can make problems when creating ship mods.

Example:
I will shift cockpit in my Dragon forward but Deadly will leave it as it is in his "Super duper X3 mod". I will use his mod which will have to include the compoennts file as well and the result will be that my changes to cockpit position will be lost because overwriten by Deadly's componenets file from his mod.

So just delete the compoenents file and you are ok...
No, that's not so easy. If you are running the "unpacked" game, then you can do it. If not then you hav problem because the components file is located in 04.cat and 05.cat (X3 ver 1.2) so you cannot delete it. Well you can, but the only way is by using X3ModManager to delete it from all the catalogs and mods. Then X3 will re-create it in types directory.

Anyway the good news is that the new DBOX2 have the ability to alter the components file directly, without need to delete anything.

Some more details:

What will happen if I create new model which is not listed in the components file?

X3 will place all the "special" parts in geometric center of the mesh.

Can I alter the file manually?

Yes but it is hard. The syntax is:

things in <> are mandatory
things in [] are optional/conditional

Code: Select all

<component group><number of records>
[body 1]
[body 2]
...
...
Body:

Code: Select all

<body ID><number of records>
[component 1]
[component 2]
..
..
Component:

Code: Select all

<flags><position>[rotation]
Position and rotation is stored as floats ranging from -1.0 to +1.0

Position:
The order is X Z Y (axis are world axis in 3ds max/gmax)

value of +1.0 means at the models bounds (in positive)
value of 0 means at model geometric center
value of -1.0 means at the models bounds (in negative)

The values are not in any units - they are just percentage of "something". The "something" is what I'm calling "major half-axis". You have to compute which axis of the model is the longest, then you divide it by 2 and you have the value.

Rotation - these values are always 0 (with 1 exception) and I believe that they are not used in reality because you cannot have the cockpit (or laser) rotated. That's because the exporter is doing something similar to "reset X-form" - i.e. there is no rotation part present in the models, just positions of their verts. But maybe this value is used in some way. Maybe you should be able to "rotate" the cockpit back :? I'll have to try it :)
Last edited by doubleshadow on Thu, 15. Dec 05, 09:47, edited 2 times in total.

Andras
Posts: 174
Joined: Thu, 26. Feb 04, 01:28
x3tc

Post by Andras » Mon, 12. Dec 05, 12:18

Hi

There IS a workaround for cockpit positions.

In bigger ships, simply place objects/v/939.bod in the .bod file at the position where you want your cockpit to be.

adress it in tships
0;1;939;X

X being the 'partnumber' of the 939 object placed in the .bod file.

The system will use the specified cockpit i.e. 4512 or 4500 for Argon M3 and place it at the position of the 939 object.


in smaller ships just move the ship parts accordingly :), let the cockpit stay at zero,zero,zero move the ship...

have fun

A.

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

Post by doubleshadow » Mon, 12. Dec 05, 12:49

Although this basicaly does what you want, it is not solving the problem.

The 939 part is "turret cockpit" - it was used in X2. It also uses the "cockpit" part. So the only thing you are doing is moving the problem to another body. What if I want to move the cockpit in the 939 :? :P

Not to mention that I definitely don't want 939 hanging around my ship's nose...
Better solution would be to use the "ships\props\cameradummy" part. It is smaller and basically designed to be used for such pusrpose, but it has the same problem - it is visible. I don't know whether it is another bug in X3 or what, but look for example at back of Split Mamba and you will see tiny little "something" floating just behind the upper rudder. That's the camera dummy.

Andras
Posts: 174
Joined: Thu, 26. Feb 04, 01:28
x3tc

Post by Andras » Mon, 12. Dec 05, 13:09

Ive mentioned bigger ships. In those i place the 939 INSIDE the ship body, where its not visible from outside.

It still allows looking out.

For me the advantage of using the 939 body is that i can move it , whereas the camerabody for the main cockpit seems to be frozen at zero/zero... i'd use the cameradummy if it werent so, cause its smaller.

regards

A.

User avatar
Gazz
Posts: 12430
Joined: Fri, 13. Jan 06, 17:39
x3tc

Post by Gazz » Mon, 6. Feb 06, 14:21

So I take it noone HAS actually moved the cockpits forward for us 3DS challenged folks? =)
Buying a big package like that (and learning to use it) just for this task...? I think not.

Gazz

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

Post by doubleshadow » Mon, 6. Feb 06, 16:23

Gazz wrote:So I take it noone HAS actually moved the cockpits forward for us 3DS challenged folks? =)
Buying a big package like that (and learning to use it) just for this task...? I think not.

Gazz
Yes, I think that no one has released such mod. You can be the first one. Use gmax which is free.

User avatar
Gazz
Posts: 12430
Joined: Fri, 13. Jan 06, 17:39
x3tc

Post by Gazz » Mon, 6. Feb 06, 17:24

Owell. I was hoping for an easier way but if X3 insists on being that stubborn... I'm DLing gmax now. Will see how that goes.

That the calculations "take long" doesn't bother me much. Then I'll just run it on a 2nd box. Or on 3 simultaneously. =)

I see the main issue as teaching this 2D person to work with 3D. :P

Gazz

J.Anderson
Posts: 39
Joined: Wed, 21. Apr 04, 13:07
x3

Post by J.Anderson » Thu, 23. Feb 06, 09:29

any progress in moving the cockpits forward?

User avatar
Gazz
Posts: 12430
Joined: Fri, 13. Jan 06, 17:39
x3tc

Post by Gazz » Thu, 23. Feb 06, 10:15

Mod Gazz' M6 and cockpits v1.00

Doesnt seem to be a lot of demand so I probably wont do many more ships like the ones listed in there.

The M6 upgrades arent nowhere near as radical as some other M6 mods around so it's just a little boost that wont alter your game much - and they really needed that. =)

Gazz

LilFunkyAngel
Posts: 32
Joined: Mon, 25. Dec 06, 19:40

Post by LilFunkyAngel » Wed, 10. Jan 07, 16:39

Hey guys,i tried do get to the bottom of this but i'm new to all this modding thingy...the problem is that i can't export anything from the gmax!! i have dl gmax 1.2,installed dbox2 and the yagg graber,i imported the scene of a ship,modified it's cockpit pos,(i only did that for now) but when i export i only get a blank file,witohut any extensions,but it should be a .bod file or something,right?when i open the max listener the only thing i can find that is "unusual" is the line "looking for dbox xform;; not found;;" What does it mean?Perhaps the problem lies there? ...One more thing,i cant even export the new position of the cockpit to the components file ,after i linked it to the main mesh of course, it always says: "no node(s) selected" What do i have to do?pls help Sad

fud
Posts: 6989
Joined: Wed, 25. Jan 06, 15:26
x3

Post by fud » Wed, 10. Jan 07, 16:53

The easiest way I found was the following:


1. Import the scene file (for eg argon_TL_scene.bod)
2. Import body file "cameradummy" (located in the ships/props folder).
3. Make sure to label the part "Bships/props/cameradummy_##" (where "##" is a number to use for reference to find it).
4. Position the cameradummy part where you want it.
5. Export all to "scene"
6. Put the scene file into your mod catalog (say, newship.cat), into folder objects/ships/argon (for this example).

Then you'll have to open up TShips, and go to the ship's cockpits/turrets tab. The first listed should be argon_tl_something. Replace this with "ships/props/cameradummy", then put the proper IDX in for it (open your scene file in notepad, it should be hte last item, use that index number). For ease of testing, I'd put TShips and the scene file into their own catalog.

Save it, and you should now have a new cockpit position in game.

dukesatan
Posts: 171
Joined: Wed, 18. Feb 04, 01:19
x3

Post by dukesatan » Wed, 10. Jan 07, 17:31

The scene.bod file in most cases is a text file, just find the associated line in that to match the postion and change the values, all i did to move the YT-1300 cockpit as you will see on my shipyard. ANY ship which has this valid file can have positions moved without to much trouble, without needing 3D programs, just a text editor, ship creator (or do it in an unpacked X3 system), oh and patience. If i can do it anyone can, just read whats in front of you, its easy....

Duke.

fud
Posts: 6989
Joined: Wed, 25. Jan 06, 15:26
x3

Post by fud » Wed, 10. Jan 07, 17:40

Right. *all* bod files can be opened with note/wordpad. I was giving some details to the procedure for those with gmax (such as LilFunkyAngel). :)

dukesatan
Posts: 171
Joined: Wed, 18. Feb 04, 01:19
x3

Post by dukesatan » Wed, 10. Jan 07, 18:02

:) if only i could get the hang of gmax, lol. I'v used many programs and normally pick them up easy but that one is just a royal B! lol. :D

Duke.

I will get there in time i am sure lol.

LilFunkyAngel
Posts: 32
Joined: Mon, 25. Dec 06, 19:40

Post by LilFunkyAngel » Thu, 11. Jan 07, 22:41

Thanks fud,for your detailed procedure... :lol: No really, thanks. :)

Post Reply

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