[Tool] .xmf/.xac <-> .dae converter
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
not sure which of both, but its generated at every gamestart when you append the "-logfile debuglog.txt"-Parameter to your XRebirth.exe if something doesnt work it usually contains useful Info (although you should compare with a clean start - some errors are from the regular startup/loading and not necesarily related to what you did)
if not stated otherwise everything i post is licensed under WTFPL
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter
I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter
I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help
Forgot about that. Lots of errors in the file heres just a few, ill go though them tomorrow.
So I am guessing I've broken it
Code: Select all
[=ERROR=] Error in default context: ShipGenerator: No ship generated using group/ref/macro units_size_l_hydrogen_collector_macro
[General] ======================================
[General] ======================================
[=ERROR=] [JobEngine] No ship generated for JobID: 'sre_miner_hydrogen_large_02'. Probably invalid ship macro/group/ref definition.
[General] ======================================
[General] ======================================
[=ERROR=] LookupKeyName::LookupName(): The key name "diff" is not recognized in lookup 'ComponentXML'. Originated from: "extensions\sbmod_test\assets\units\size_l\units_size_l_hydrogen_collector.(pck|xml)"
[General] ======================================
[General] ======================================
[=ERROR=] LookupKeyName::LookupName(): The key name "replace" is not recognized in lookup 'ComponentXML'. Originated from: "extensions\sbmod_test\assets\units\size_l\units_size_l_hydrogen_collector.(pck|xml)"
[General] ======================================
[General] ======================================
[=ERROR=] LookupKeyName::LookupName(): The key name "sel" is not recognized in lookup 'ComponentXML'. Originated from: ""
[General] ======================================
[General] ======================================
[=ERROR=] Failed to create macro 'units_size_l_hydrogen_collector_macro' from file 'extensions\sbmod_test\assets\units\size_l\macros\units_size_l_hydrogen_collector_macro'
[General] ======================================
[General] ======================================
[=ERROR=] Missing component macro 'units_size_l_hydrogen_collector_macro' in file 'extensions\sbmod_test\assets\units\size_l\macros\units_size_l_hydrogen_collector_macro' as referenced in: index\macros
[General] ======================================
[General] ======================================
[=ERROR=] Macro not found: units_size_l_hydrogen_collector_macro
[General] ======================================
[General] ======================================
[=ERROR=] Error in MD cue md.osr_universe.StartupInit: ShipGenerator: No ship generated using group/ref/macro units_size_l_hydrogen_collector_macro
[General] ======================================
those are relevant:
either something is missing (do you have a complete macro file for this ship in »»extensions\sbmod_test\assets\units\size_l\macros\units_size_l_hydrogen_collector_macro ? - diff file here is not enough since this file is interpreted as regular macro file) or you were too thoroughly (did you redirect the macro/components in the index/[macros|components].xml ? - this is not necesary if you just want to modify them, only when you want to add one there is a need for that)
Code: Select all
[=ERROR=] Failed to create macro 'units_size_l_hydrogen_collector_macro' from file 'extensions\sbmod_test\assets\units\size_l\macros\units_size_l_hydrogen_collector_macro'
[=ERROR=] Missing component macro 'units_size_l_hydrogen_collector_macro' in file 'extensions\sbmod_test\assets\units\size_l\macros\units_size_l_hydrogen_collector_macro' as referenced in: index\macros
[=ERROR=] Macro not found: units_size_l_hydrogen_collector_macro
if not stated otherwise everything i post is licensed under WTFPL
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter
I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter
I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help
I did redirect the file in the macro/components file. hopefully if ill remove that it will clear up the errors.
Edit: Now the game is crashing when loading a new game.
I have a full macro file in extensions\SBMod_Test\assets\units\size_l\Macros. This is an Ego file. And in the units_size_l_hydrogen_collector.xml file I have
Edit: After a bit more testing it is the xmf files that are causing the game to crash. If I use the custom XML and Ego xmf files the game works fine, as soon as I add my XMF files the game crashes.
I also have a folder called units_size_l_hydrogen_collector_data containing all the meshes, some of which have been changed by arc_'s tool, plus a few other random files that are standard Ego files.
If I use the Ego xmf files I get this error:
in the logfile. I have a file called units_size_l_hydrogen_collector_data (this is an Ego file) in the folder extensions\SBMod_Test\assets\units\size_l
Edit again: Few more tests and it looks like it is a problem with the mesh files.
@ arc_ do you want me to zip them up and send them your way so you can take a look at them ?
Edit: Now the game is crashing when loading a new game.
I have a full macro file in extensions\SBMod_Test\assets\units\size_l\Macros. This is an Ego file. And in the units_size_l_hydrogen_collector.xml file I have
Code: Select all
<diff>
<replace sel="//source[@geometry='assets\units\size_l\units_size_l_hydrogen_collector_data']/@geometry">extensions\SBMod_Test\assets\units\size_l\units_size_l_hydrogen_collector_data</replace>
</diff>
I also have a folder called units_size_l_hydrogen_collector_data containing all the meshes, some of which have been changed by arc_'s tool, plus a few other random files that are standard Ego files.
If I use the Ego xmf files I get this error:
Code: Select all
[=ERROR=] [Geometry::RequestCollisionMeshFilePtr] collisionMeshFile handle for geometry extensions\sbmod_test\assets\units\size_l\units_size_l_hydrogen_collector_data is invalid, returning NULL!
Edit again: Few more tests and it looks like it is a problem with the mesh files.
@ arc_ do you want me to zip them up and send them your way so you can take a look at them ?
Success, I have a modified ship in the game. There is at lest one or more bugged xmf files. Im testing them one by one at the moment..
Ill create a list here and update it as I go.
Working files:
part_main-lod0.xmf -- Only file I changed in blender, moved a few faces around.
anim_poslights-lod0.xmf
detail_l_alpha-collision.xmf
detail_l_alpha-lod0.xmf
detail_l_main-lod0.xmf
detail_m_alpha-collision.xmf
detail_m_alpha-lod0.xmf
detail_m_main-lod0.xmf
part_main-lod0.xmf
part_main-lod1.xmf
part_main-lod2.xmf
Bugged files:
anim_poslights-collision.xmf
detail_l_main-collision.xmf
detail_m_main-collision.xmf
part_main-collision.xmf
That's the complete list for this one ship (units_size_l_hydrogen_collector). The bugged files cause the game to crash when you start a new game (100% load then crashes).
Edit: Those files that don't work are much much larger then the egosoft files for the same model. Something is not being saved correctly when it comes to those files.
Ill create a list here and update it as I go.
Working files:
part_main-lod0.xmf -- Only file I changed in blender, moved a few faces around.
anim_poslights-lod0.xmf
detail_l_alpha-collision.xmf
detail_l_alpha-lod0.xmf
detail_l_main-lod0.xmf
detail_m_alpha-collision.xmf
detail_m_alpha-lod0.xmf
detail_m_main-lod0.xmf
part_main-lod0.xmf
part_main-lod1.xmf
part_main-lod2.xmf
Bugged files:
anim_poslights-collision.xmf
detail_l_main-collision.xmf
detail_m_main-collision.xmf
part_main-collision.xmf
That's the complete list for this one ship (units_size_l_hydrogen_collector). The bugged files cause the game to crash when you start a new game (100% load then crashes).
Edit: Those files that don't work are much much larger then the egosoft files for the same model. Something is not being saved correctly when it comes to those files.
File size differences are to be expected. The conversion tool always uses 32-bit floating point numbers for storing vertex positions, while the original files sometimes use 16-bit numbers (smaller size but less precision).
Can you upload an extension with the working files and at least one "bugged" file so I can reproduce the crash and debug it?
Can you upload an extension with the working files and at least one "bugged" file so I can reproduce the crash and debug it?
http://sbmod.co.uk/Mod_Downloads/SBMod_Test.zip
That's a working extension. Inside the folder conation the data is a folder containing all the files that didn't work.
That's a working extension. Inside the folder conation the data is a folder containing all the files that didn't work.
Take a look at that file it has the working ship change in it. Im going to try and get a cube in the game now minus what ever files are not working and textures (no idea how these work yet as they do not show in blender/3dsmax) then ill do a write up.
So far I have the macros and .xmf files for a cube and the game is no longer outputting errors about them. I just don't see it in game So I need to play around a bit more. I also cant seem to get the generated XML file to contain texture information.
So far I have the macros and .xmf files for a cube and the game is no longer outputting errors about them. I just don't see it in game So I need to play around a bit more. I also cant seem to get the generated XML file to contain texture information.
The converter takes the material to use from the node name. For example, this node name: "detail_m_mainXlod0XgenericXgeneric_tanks_01" contains the section of the LOD0 mesh of part "detail_m_main" that is using the material "generic_tanks_01" from the "generic" collection in the material library xml.
Ok that makes sense now, I was trying to figure out what the X....X Part was, forgot that the material file is split into sections.
This is my XML output now from your tool for my cube:
I had to make the macro file for it, which looks like this:
And the components file looks like:
And Macros file:
I sill cant seem to get the model to appear in game, I have no error in the debug log text file either now.
Edit: Added all 3 LODs now and still no luck
This is my XML output now from your tool for my cube:
Code: Select all
<components>
<component name="units_kill_box">
<source geometry="\Extensions\SBMod_Test\assets\units\size_l\units_kill_box_data" />
<connections>
<connection name="Connection01" tags="part">
<parts>
<part name="part_main">
<size>
<max x="1" y="1" z="1" />
<center x="0" y="-4.76837e-007" z="0" />
</size>
<lods>
<lod index="0">
<materials>
<material id="1" ref="argon.ar_masstraffic_01" />
</materials>
</lod>
</lods>
</part>
</parts>
<offset>
<position x="-0.061841" y="-0.042030" z="-0.147742" />
</offset>
</connection>
</connections>
</component>
</components>
Code: Select all
<macros>
<macro name="units_kill_box_macro" class="drone">
<component ref="units_kill_box" />
<properties>
<identification name="{20101,7201}" description="{20101,7202}" />
<hull max="1600000" />
<effects>
<explosion ref="explosion_l_01" />
<jumpin ref="jump_jumpin_l" />
<jumpout ref="jump_jumpout_l" />
</effects>
</properties>
<connections>
</connections>
</macro>
</macros>
Code: Select all
<diff>
<add sel="/index"><entry name="units_kill_box" value="\Extensions\SBMod_Test\assets\units\size_l\units_kill_box" /></add>
</diff>
Code: Select all
<diff>
<add sel="/index"><entry name="units_kill_box_macro" value="\Extensions\SBMod_Test\assets\units\size_l\Macros\units_kill_box_macro" /></add>
</diff>
Edit: Added all 3 LODs now and still no luck
I posted an updated version of the conversion tool which fixes the collision file crash. It turns out that the game is much more picky about the vertex declaration in collision meshes than it is about visual meshes. Note that the command line has changed in preparation for .xac support - see the first post for details.
Also the tool now automatically merges overlapping vertices in all meshes and leaves out unnecessary information (like normals) from collision meshes. This way the resulting files are much closer in size to the original.
I can't help you with the macro .xml files, sorry... I know next to nothing about those.
Also the tool now automatically merges overlapping vertices in all meshes and leaves out unnecessary information (like normals) from collision meshes. This way the resulting files are much closer in size to the original.
I can't help you with the macro .xml files, sorry... I know next to nothing about those.
a macro file is basically similiar to a TShips entry in the previous games - it defines what a Ships is made of, explosioneffects, hull Strength etc. - and it contains connections to all parts a Ship is made of, and for Stations Information about in which order the Elements are built (Build Sequence and Build Stage) - some of this Info is not to be defined in the modelling program(basically the whole <properties> node), but the connections and build sequence/stage would make sense to define in a modelling program..
if not stated otherwise everything i post is licensed under WTFPL
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter
I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter
I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help