[Tool/Info] VS Code Complete, Asset Converter, Blender Integration - Beta

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

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

Post Reply
Cg089
Posts: 80
Joined: Fri, 18. Jan 19, 19:25
x4

[Tool/Info] VS Code Complete, Asset Converter, Blender Integration - Beta

Post by Cg089 » Wed, 8. May 19, 12:10

I've been meaning to make this post for a while, but it's about time I actually did. Arc_ made a converter for X: Rebirth a number of years back, and unfortunately, he vanished. I've been working on improving it to work better for X4. This is heavily WIP, and may break at any point. Keep backups of your files, people.

Source:
https://github.com/Cgettys/X4Converter/tree/master


Features:
  • WIP - Asset Import/Export - via Collada
  • WIP - Animation support
  • WIP - Blender integration
  • WIP - Multimat support
  • WIP - Nested component handling
  • Cross-platform!

Credits:
  • The entire dev team for making an awesome game.
  • Arc_ for making the original X: Rebirth converter tool
  • CBJ & linolafett for providing info on the ANI & XMF file formats, in addition to making an awesome game
  • BrummBear, Forleyor, jmattspartacus, mewosmith, Ojump, & everyone else from the Discord who have provided ideas, insight, feedback & encouragement
  • moneyl, Sir Kane, Bobbe, and many others from various other Discords who provided valuable insight into blender & how to go about figuring on binary file formats, to name a few
  • Aftershock_81 for independently reverse engineering a good part of the ANI format, thus unintentionally guilting me into actually making a post
Last edited by Cg089 on Sat, 3. Aug 19, 21:55, edited 5 times in total.

Cg089
Posts: 80
Joined: Fri, 18. Jan 19, 19:25
x4

Re: [Tool/Info] Asset Converter & Blender Integration - WIP

Post by Cg089 » Wed, 8. May 19, 12:11

I'm still working on the Asset Converter, but in the mean time, I've created an extension for Visual Studio Code to autocomplete scriptproperties. You can find it at https://github.com/Cgettys/X4CodeComplete; simply download the .vsix file & install it and enjoy!
I highly recommend using it in conjunction with the excellent guide ledhead900 put together, as this plugin fills in the gaps that that solution cannot handle. That guide is available here: viewtopic.php?f=181&t=416621

Credit to Mewosmith for the idea.
Changelog:
v1.0.0 5/10/2019 - Initial release
v1.0.1 5/11/2019 - Overhaul of basically everything
v1.0.2 5/11/2019 - Hopefully, no more duplicate suggestions. Also, Peek/Go to definition for script properties!
Last edited by Cg089 on Sat, 11. May 19, 12:45, edited 4 times in total.

Cg089
Posts: 80
Joined: Fri, 18. Jan 19, 19:25
x4

Re: [Tool/Info] Asset Converter & Blender Integration - WIP

Post by Cg089 » Wed, 8. May 19, 12:14

[Reserved]

Cg089
Posts: 80
Joined: Fri, 18. Jan 19, 19:25
x4

Re: [Tool/Info] Asset Converter & Blender Integration - WIP

Post by Cg089 » Wed, 8. May 19, 12:15

[Reserved]

linolafett
EGOSOFT
EGOSOFT
Posts: 3321
Joined: Mon, 26. Mar 12, 14:57
x4

Re: [Tool/Info] Asset Converter & Blender Integration - WIP

Post by linolafett » Wed, 8. May 19, 13:31

Thanks for your work and and thanks to everyone helping! Much appreciated.
01001100 01101001 01101110 01100101 01110011 00100000 01101111 01100110 00100000 01110100 01101001 01101101 01100101 01110011 00101110 00101110 00101110

My art stuff

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

Re: [Tool/Info] Asset Converter & Blender Integration - WIP

Post by Axeface » Thu, 9. May 19, 06:14

Sounds amazing. Keeping a close eye on this and thank you. I have some tentative plans for some ships, I can model but i'm a complete moron when it comes to the technical side of things so it sounds like this will help me a lot.

Staberind
Posts: 119
Joined: Wed, 5. May 10, 23:32
x4

Re: [Tool/Info] Asset Converter & Blender Integration - WIP

Post by Staberind » Thu, 9. May 19, 13:40

This is Awesome and I am looking forwards to it, especially if it can make sense of the new texture format, Blender & real life have been griefing me for a bit so, I had to put the Xtr4 import on the back burner.
this will probably prod me back into doing stuff, I really think X4 could do with XR's Solid & Liquid transporters & just importing them from XR means they don't get the benefit of groovy paintjobs or faction colours.
Aladna Hill, Again, AP, 3.1. in the last Game worthy of the "X" title. <<<< X4 might just be changing this. :?:

BrummBear02
Posts: 308
Joined: Fri, 3. Oct 08, 20:43
x3ap

Re: [Tool/Info] Asset Converter & Blender Integration - WIP

Post by BrummBear02 » Thu, 9. May 19, 13:58

Uh. That already is possible without much trouble since the xr ships only use normal textures and no multimat. I don't think he did any changes to the material/ texture handling?
Gebt mir einen Spiegel dann schlage ich ihn mit seinem eigenen Gesicht

linolafett
EGOSOFT
EGOSOFT
Posts: 3321
Joined: Mon, 26. Mar 12, 14:57
x4

Re: [Tool/Info] VS Code Complete, Asset Converter, Blender Integration - WIP

Post by linolafett » Mon, 13. May 19, 09:38

Paint mod masking is done via vertex colours (vertex illumination channel). XR assets are not set up to support that, as this system did not exist at the time.
01001100 01101001 01101110 01100101 01110011 00100000 01101111 01100110 00100000 01110100 01101001 01101101 01100101 01110011 00101110 00101110 00101110

My art stuff

Misunderstood Wookie
Posts: 377
Joined: Mon, 15. Mar 04, 08:07
x4

Re: [Tool/Info] VS Code Complete, Asset Converter, Blender Integration - WIP

Post by Misunderstood Wookie » Mon, 13. May 19, 10:23

Peek and Go to Def
.... LEGEND
*modified*
*X3 LiteCube User*
MOD GemFX Real Space Shaders
MOD Variety and Rebalance Overhaul Icon Pack
I lost my Hans and should not be flying Solo.
Image

Cg089
Posts: 80
Joined: Fri, 18. Jan 19, 19:25
x4

Re: [Tool/Info] VS Code Complete, Asset Converter, Blender Integration - Beta

Post by Cg089 » Sat, 3. Aug 19, 22:50

I've put up the source code for my converter etc in the first post. I'm still working on it when I have time, and it's buggy and unfinished right now, but hopefully the information will come in handy. Thanks again to everyone who helped - especially CBJ and Lino, they were a great help!

User avatar
RoverTX
Posts: 1426
Joined: Wed, 16. Nov 11, 18:37
x4

Re: [Tool/Info] VS Code Complete, Asset Converter, Blender Integration - Beta

Post by RoverTX » Mon, 21. Oct 19, 04:34

Any chance of adding more to the readme about how to build?

Max Bain
Posts: 1458
Joined: Wed, 27. Jun 18, 19:05
x3ap

Re: [Tool/Info] VS Code Complete, Asset Converter, Blender Integration - Beta

Post by Max Bain » Mon, 21. Oct 19, 08:36

Is this Linux only or Windows as well? Just curious because I read "sudo"...
Also some screenshots would be welcome ;).
XR Ship Pack (adds several ships from XR) Link
Weapon Pack (adds several new weapons) Link
Economy Overhaul (expands the X4 economy with many new buildings) Link
X4 Editor (view stats of objects and make your own mod within a few clicks) Link

Cg089
Posts: 80
Joined: Fri, 18. Jan 19, 19:25
x4

Re: [Tool/Info] VS Code Complete, Asset Converter, Blender Integration - Beta

Post by Cg089 » Mon, 21. Oct 19, 22:50

RoverTX wrote:
Mon, 21. Oct 19, 04:34
Any chance of adding more to the readme about how to build?
Done. Sorry, I've been really busy with school, and it's still very much WIP. I've written some notes about building it on Windows; it should be possible and I think I did do it at one point.. I've also been able to cross-compile it from Linux to Windows using Polly in the past; I'll provide Windows release builds at some point when I have time and it's less stable.
Max Bain wrote:
Mon, 21. Oct 19, 08:36
Is this Linux only or Windows as well? Just curious because I read "sudo"...
Also some screenshots would be welcome ;).
Cross-platform (using MinGW to build a Windows binary). In fact, the X Rebirth/X4 catalog tool that Egosoft released is Windows only, though I was able to get it to run with Wine. As noted in the readme now, and I think it's said elsewhere, but you need to extract the game files before the tool is any good. Linux is my native environment, but it should work just fine on Windows; I made sure to handle filepaths pretty carefully. If you run into issues on Windows, let me know. Again, note that this is very much WIP.

RE: screenshots, the main portion of this is a command-line tool, so there isn't much to see. I could do that for the Blender part, which is even more WIP, but it really doesn't add much to see in and of itself. I might link some animations imported into Blender at some point when that's a bit more polished. The most interesting screenshots will come from stuff imported into the game using the tool, someday hopefully :wink:.
It's also a bit finicky about how you work on mod files at the moment; they basically have to be exactly where the game pretends they are after import. I'll try to write more about it later, but basically what I'm doing is relying on that directory structure being right so that I can properly import and export textures, allowing you to use existing textures easily etc. Hopefully soon-ish it'll also let you preview how mounted items look, again relying on that directory structure.

User avatar
beko
Posts: 53
Joined: Thu, 11. Jun 20, 21:14
x4

Re: [Tool/Info] VS Code Complete, Asset Converter, Blender Integration - Beta

Post by beko » Fri, 31. Mar 23, 18:15

Oh wow, that vscode autocomplete is 👌

Especially for a newcomer like me ♥

Post Reply

Return to “X4: Foundations - Scripts and Modding”