Ill try to create a complete walkthrough to creat an S sized ship that fully works with 6.0 upwards.
Please keep in mind that everything i say here is the result of try and error and a lot is unclear to me so some things i say are wild guesses.
If u know im talking bullcrap about something u can correct me and if i can verify that i was wrong ill change/add/remove that.
It seems i cant put pictures directly into the post anymore. So... that one is not on me.
This will be a work in progress and i cant promise ill ever finish it, so contributions are welcome. If you are willing to write part of the tutorial please contact me via PM or in Discord.
please ALWAYS use lower case letters when naming files. Only use capital letters in the t files for naming ingame and the .ANI files.
if a reference is with a capital C while the file it refers to is with a lower case one it will cause the mod to not work.
[ external image ]
Contents:
- Software
- Creating a copy of a existing ship, renameing it and adding it to a shipyard
- Parts of a ship
- What can be done and what cant be done
- Choosing a ship fitting for our needs
- Getting the ship in a format suitable for the Egosoft Blender tools
- Editing the mesh
- Creating a convex Hull/Collision
- UV textures and vertex paint
- Moving connections around and other XML file stuff
- Creating custom materials
- Animations
- Troubleshooting
Software
We will work with the folowing tools:
X Rebirth Catalog Tool 1.10
Notepad++
Blender
Egosoft Blender tools
XRConverter
How to use: viewtopic.php?f=129&t=360045
Another important tool is the modding community itself. You can reach out to us here on the board or on Discord. Really, give discord a try.
https://discord.gg/QgDJ69j
Creating a copy of a existing ship, rename it and add it to a shipyard
Getting prepared
Ok, first we need to unpack our game.
For this we need to start up the X Rebirth Catalog Tool 1.10 we grabbed earlier.
Read up on how to do that here: viewtopic.php?f=181&t=402452
Alternatively u can simply use the GUI that thing provides. Its pretty much self explanatory. Unpack ur whole game.
[ external image ]
Should look like this. Take note of the path i used. I recomend u create a seperate folder for ur unpacked X4 without spaces in it.
Somehow the converter we use later seems to have issues with spaces. at least for me. maybe its superstition from my side but better safe than sorry.
Now to convert all the models. Grab the XRConverter and put it into X4Mod root directory.
[ external image ]
Create a new text file, also in the root directory, and open it with windows editor.
paste this inside there and then go save as -> ConvertBAT_import.bat
Code: Select all
FOR /R "..\X4Mod\assets\" %%f IN (*.xml) do (
XRConvertersMain.exe importxmf "..\X4Mod" "%%f"
)
pause
this will create a bat file that will convert almost all 3d models inside of the assets folder into .dae files.
Beware that this might take a while so double klick the freshly created .bat and wait.
Also create a second .bat with
Code: Select all
FOR /R "..\X4Mod\extensions\cubix\" %%f IN (*.dae) do (
XRConvertersMain.exe exportxmf "..\X4Mod" "%%f"
)
pause
We dont need this last step anymore but i leave it here. Just in case.
Copy a existing ship
Now we will grab an existing ship. Since i worked with the Argon Discoverer the most we will copy that one.
Create a folder named "extensions" in the root directory u installed X4 into. The one u use to actually play X4.
From now on i refer to this one as X4 Foundations and the copy we unpacked our game to will be X4Mod.
We will use the files from my koha mod and modify them because its simpler than creating new ones.
Now download my Koha mod here
and unpack it into the extensions folder. Then rename the Koha folder into Cubix.
Dive deeper into now X4 Foundations\extensions\cubix\assets\units\size_s and rename the folder the koha_data into cubix_data and delete the koha.xml in there.
also delete everything thats inside the now cubix_data.
Go to X4 Foundations\extensions\cubix\assets\units\size_s\macros and delete koha_macro.
In the end it should look like this
[ external image ]
go to X4Mod\assets\units\size_s and grab ship_arg_s_scout_01.xml and SHIP_ARG_S_SCOUT_01_DATA.ANI to copy those two into X4 Foundations\extensions\cubix\assets\units\size_s
Depending on your windows settings u might not see the file extensions. Ignore the .sig files. those are signature files to not flag ur game modified. they wont work on our ship.
[ external image ]
now go X4Mod\assets\units\size_s\macros and copy ship_arg_s_scout_01_b_macro to X4 Foundations\extensions\cubix\assets\units\size_s\macros
and everything inside X4Mod\assets\units\size_s\ship_arg_s_scout_01_data into X4 Foundations\extensions\cubix\assets\units\size_s\cubix_data
Editing the XML files
Ok, moving on. Now the xml part is a huge topic on its own and u can(and probably should do so sooner or later) read more about it here
For all editing we will use Notepad++
in X4 Foundations\extensions\cubix we will find the "content.xml" this file describes your mod in the extensions manager tool the game has ingame (where u can turn on and off extensions)
Simply swap out the word "Koha" with "Cubix" here and we are good to go.
If u press CTRL+F in Notepad++ and then select replace u can search for a specific word and replace it with something. Also swap out my name with yours.
Ive never cared about the date and version but if u are not a complete brain mess like me u can update that whenever u make a new version of ur mod. thats probably even useful.
Folder: t
\X4 Foundations\extensions\cubix\t are language files for the ingame naming and description.
if u **** this up it will show up as =ReadText= or something like that.
I havent played around with this too much and im pretty sure u can find some more info on this if u search the forum. For now simply replace the word "Koha" with "Cubix" in every file
For example: <page id="999832" title="Koha" descr="Koha" voice="yes"> becomes <page id="999832" title="Cubix" descr="Cubix" voice="yes">
also you should change the page id to one thats free. idk if there is already a post here on used ids or not.
this might interfer with other mods if they also use the page id u choose. for now stay on the one i used for the Koha.
The other files can be a simple copy of your 0001 or, if u feel generous, u can actually translate it. 0001-L049 for example is german. So if u want your mod to be translated to german if someone uses the german game version simply put a translation here. Keep in mind that if u leave the others untouched, for example only change 044 and leave 049 be, the german X4 players will have "Koha" in they shipyard while english players will have "Cubix" So change all of them.
Another option would be to delete all of the files except the 0001. This means every player has the same name and description on the ship.
Folder: libraries
X4 Foundations\extensions\cubix\libraries are... well. libraries. for now we only need to have a wares.xml there.
Inside there we can add wares to stations i guess. in any case its used to add the ware "Cubix" to the argon shipyard.
It also defines whats needed for the production, the time it takes to produce, the credits it will cost and which licence one needs to buy it.
Again u simply change koha to cubix. for example koha_ware becomes cubix_ware.
Also adjust the page id if u changed it earlier. ( name="{999832,2}" description="{999832,3}" )
Folder: index
Inside here we will find components and macros.
We will start with components.
In our case the components file simply refers to our ship .xml which means we simply swap out koha for cubix again.
Code: Select all
<entry name="koha" value="extensions\koha\assets\units\size_s\koha" />
Code: Select all
<entry name="cubix" value="extensions\koha\assets\units\size_s\cubix" />
Code: Select all
<entry name="engine_arg_l_allround_01_mk2" value="extensions\Raptor\assets\props\Engines\engine_arg_l_allround_01_mk2" />
macros.xml refers to every macro file we use. In our case again its simply one single file. If we use more than one macro in our mod wed need to paste a path here.
so again
Code: Select all
<entry name="koha_macro" value="extensions\Koha\assets\units\size_s\macros\koha_macro" />
Code: Select all
<entry name="cubix_macro" value="extensions\cubix\assets\units\size_s\macros\cubix_macro" />
Ship XML and macro
Now we take a deep dive into X4 Foundations\extensions\cubix\assets\units\size_s and rename the ship_arg_s_scout_01.xml into cubix.xml and the SHIP_ARG_S_SCOUT_01_DATA.ANI into CUBIX_DATA.ANI
This is the ships waifu xml. its basically a description of what the ship consists of.
For now we will open it and change only line 3 and 4
Code: Select all
<component name="ship_arg_s_scout_01" class="ship_s">
<source geometry="assets\units\size_s\ship_arg_s_scout_01_data"/>
Code: Select all
<component name="cubix" class="ship_s">
<source geometry="extensions\cubix\assets\units\size_s\cubix_data"/>
moving on by opening the macro folder. First we rename ship_arg_s_scout_01_b_macro into cubix_macro
Now open the file and change line 4, 5 and 7.
Code: Select all
<macro name="ship_arg_s_scout_01_b_macro" class="ship_s">
<component ref="ship_arg_s_scout_01" />
<properties>
<identification name="{20101,10103}" basename="{20101,10101}" description="{20101,10113}" variation="{20111,1201}" shortvariation="{20111,1203}" icon="ship_s_fight_01" />
Code: Select all
<macro name="cubix_macro" class="ship_s">
<component ref="cubix" />
<properties>
<identification name="{999832,2}" basename="{999832,1}" description="{999832,3}" variation="{20111,2001}" shortvariation="{20111,1003}" icon="ship_s_fight_01" />
also i have no idea what variation and shortvariation does since i didnt bother with that yet. probably the Vanguard stuff
If u start ur game now u should see the mod in the manager
[ external image ]
and it should also appear ingame in an argon shipyard.
[ external image ]