How to move the cockpit (and laser)

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

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

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

How to move the cockpit (and laser)

Post by doubleshadow » Mon, 12. Dec 05, 11: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, 08:47, edited 2 times in total.

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

Post by Andras » Mon, 12. Dec 05, 11: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, 08:14
x3

Post by doubleshadow » Mon, 12. Dec 05, 11: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, 00:28
x3tc

Post by Andras » Mon, 12. Dec 05, 12: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: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz » Mon, 6. Feb 06, 13: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, 08:14
x3

Post by doubleshadow » Mon, 6. Feb 06, 15: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: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz » Mon, 6. Feb 06, 16: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, 08:29

any progress in moving the cockpits forward?

User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz » Thu, 23. Feb 06, 09: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, 18:40

Post by LilFunkyAngel » Wed, 10. Jan 07, 15: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: 9837
Joined: Wed, 25. Jan 06, 14:26
x3

Post by fud » Wed, 10. Jan 07, 15: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: 173
Joined: Wed, 18. Feb 04, 00:19
x3

Post by dukesatan » Wed, 10. Jan 07, 16: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: 9837
Joined: Wed, 25. Jan 06, 14:26
x3

Post by fud » Wed, 10. Jan 07, 16: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: 173
Joined: Wed, 18. Feb 04, 00:19
x3

Post by dukesatan » Wed, 10. Jan 07, 17: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, 18:40

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

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

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

Post by fud » Thu, 11. Jan 07, 21:51

Well, hopefully, it helped in some way. :)

dukesatan
Posts: 173
Joined: Wed, 18. Feb 04, 00:19
x3

Post by dukesatan » Thu, 11. Jan 07, 22:53

Just going to add my 5p to this, just in case this helps someone. Below you will see two lines from a random scene.bod file, i opened it with notepad and this is what i see.

Now as said before by others you need to know WHICH position this is, if you have the XSP file thats easy to work out form the customise ship button, turret and guns tabs, match the numbers in the lists to these and bingo you know which this one is ;)

Now what i am going to give you is the X, Y, Z as i'v not seen anyone else put it yet. The two listings are first your view point (where you look from) and a gun turret (where your weapon fire comes from, there maybe multiple turrets linked to one position on bigger ships.

So the code:

Code: Select all

P 1; B ships\props\cameradummy; C 1; N Bships\props\cameradummy_1b; b  // idx 1
{ 0x2002;  3460; 2076; 34358;  0.000000; 0.000000; 0.000000; 0.000000;  -1; 1; } // 0

Code: Select all

P 2; B ships\props\turretdummy; C 2; N Bships\props\turretdummy_3b; b  // idx 2
{ 0x2002;  4100; 9622; -124756;  0.500000; 0.000000; 1.000000; 0.000000;  -1; 1; } // 0
So you want to move them now?

Ok, lets look at the camera position, ignore the 0x2002, just a starting code.

Next 3460, this is the +Right/-Left value from the 0 point, dont assume the middle of the ship is at 0!!!! So to go more right, + this value, more left - this value.

Now 2076 is the +Up/-Down value from the 0 point, again more + goes up and more - goes down.

Lastly 34358 is the +Forward/-Back value from the 0 point, so to go further forward + more to the value and to move further back - the value.

Changing all 3 of these values can move any turret, or camera position should one be unsuitable or you dont want to do it in a 3D program.

Lastly, if you have an XSP and your camera is in the wrong place what do you do? Use ship creator to extract the files to a location, then see if you can open the scene file in notepad and IF you get the above kind of lines you can then make changes.

All you need do is modify a copy of the scene.bod file you saved, once the changes are made SAVE it, then go to the ship creator (leave open) and point to the NEW scene file. You MUST do this after EVERY!!!! save of the scene.bod file or the changes will not be taken. Once you have done this, save the XSP and use the ship installer to install your modified ship. Remember to close the ship installer and run X3.

SHOULD you get an instance of an invisable hull and you KNOW it was working, exit X3, use the ship installer and UNINSTALL that one ship, go to the menu "Update" and update mod, then close the ship installer. Now reopen again, and reinstall your ship and test, often i have found this cures things. Keep retesting until your happy with your turret and camera positions :)

Duke.

PS if this is all detailed elsewhere accept my appologies :D

Post Reply

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