Adding / moving turrets on existing ships

The place to discuss scripting and game modifications for X4: Foundations.

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

Post Reply
rusky
Posts: 450
Joined: Sun, 4. Jan 09, 17:17
x4

Adding / moving turrets on existing ships

Post by rusky » Wed, 18. Aug 21, 21:02

Looking through the files, I found that turrets are specified as part of the ship data xml files.

Each turret has a position and a rotation.

I would like to add / move some turrets around on some ships.

What would be the best way to get the position/rotation values ? Would I need to unpack the ships and open them in something like Blender ? Or is there an easier way ?

Thanks!

User avatar
Axeface
Posts: 2939
Joined: Fri, 18. Nov 05, 00:41
x4

Re: Adding / moving turrets on existing ships

Post by Axeface » Thu, 19. Aug 21, 02:58

You can do this in blender yes. Tutorials for extracting the gamefiles and converting the ships to .dae are available on this forum.
Once you have the ship in blender scale it up by 100% and then create a dummy object to get the coordinates. Z and Y are different in x4, so Z in blender is Y in X4.
You can even import a turret into belnder too to get the exact coords.

rusky
Posts: 450
Joined: Sun, 4. Jan 09, 17:17
x4

Re: Adding / moving turrets on existing ships

Post by rusky » Thu, 19. Aug 21, 10:33

Thank you!

User avatar
Axeface
Posts: 2939
Joined: Fri, 18. Nov 05, 00:41
x4

Re: Adding / moving turrets on existing ships

Post by Axeface » Thu, 19. Aug 21, 18:56

Np, I forgot to say that you place the turrets by just adding more in the ships component file you mentioned.

aurumgallente
Posts: 121
Joined: Sun, 14. Jun 20, 14:45
x4

Re: Adding / moving turrets on existing ships

Post by aurumgallente » Sun, 29. Aug 21, 06:38

Generating rotation angles could be very tricky. Also adding rotation as <rotation pitch="0" yaw="0" roll="0" /> is not good for performance. I use this tool
https://github.com/rjtwins/X4-Blender-M ... g-and-Drop
it generates quarterions and you don't need to afterburn your brain about turret on Paranid curved hull.

For "non-playable" ships you also need to change macro file of a ship.

Post Reply

Return to “X4: Foundations - Scripts and Modding”