Jump to content

Experimenting with mod loader issue


Recommended Posts

I tested the integration of a mod into Xenonauts 2. In fact, I created a manifest.json that I associated in the game with the MOD section.

My mod is recognized by the game at startup and is listed in the mods.json file. Then, I can select and activate it. However, at that point, the game crashes and exits to the desktop.

I wonder if it's not an error in the content of my manifest file. Do you have documentation on creating a manifest file for a mod?

Here is the content of my manifest:
 

{
    "version": "0.1.0",
    "asset": {
        "Name": "LogRaam's Better Warden Proportions",
        "UID": "6936a366-b01e-4cd7-9dd9-5a1f6ac4cafd",
        "Description": "An adjustment to warden proportions.",
        "Author": "LogRaam",
        "Website": "https://www.nexusmods.com/skyrim/users/308756",
        "Version": "1.0.0"        
    }
}


And here is the content of the mods.json file when I activate my mod into the game:
 

{
    "Mods": [
        {
            "Manifest": {
                "descriptor": {
                    "path": "P:/OneDrive/Documents/My Games/Xenonauts 2/Mods/LogRaam/manifest.json",
                    "_type": "Common.Content.DataStructures.ContentPackManifest",
                    "$type": "Common.Content.Descriptors.FileDescriptor"
                }
            },
            "State": "Enabled"
        }
    ]
}


In the directory where my manifest is located, I haven't added anything else for now. This scenario causes the game to crash.

Ultimately, I would like to include a modified .png texture file corresponding to something like this:
 

{
    "version": "0.1.0",
    "asset": {
        "_assetBundleMap": {
            "generated_texture_strategy": [                
                "assets/assets/xenonauts/texture/strategy/ui/paperdoll/armour/warden^default^collar.png",
            ],           
        },
        "$type": "Common.Content.DataStructures.AssetBundleBuildManifest"
    },
    "$type": "Common.Content.DataStructures.VersionedAsset"
}

I will place the .png file in the correct file structure within the directory of my mod.

This second scenario have been tested and still cause a crash of the game.

Do you have any advice to better guide me in creating the manifest for a mod that I want to select in the game's MOD section?

Edited by LogRaam
add more info
  • Like 1
Link to comment
Share on other sites

The supported game version section is filled in via a JSON property. Unfortunately, I do not yet know which property I should use to comply with the manifest standard for mods in Xenonauts 2.

Do we have access to documentation on the manifest model that we should use for a mod in Xenonauts 2?

Link to comment
Share on other sites

Yes, that could help me. Or if you have the steps for decompressing, I could then use dnSpy to take a look.

I tried with the mod examples provided by Goldhawk Interactive, and I have the same issue. So it might be a bug rather than a configuration error on my part.

Screenshot_34.jpg

Link to comment
Share on other sites

We're in the process of adding in support but we had to refocus on the Unity 2022 migration and 3.0 milestone sadly :(.
At the moment the game only really supports swapping out values in the Templates - texture swaps (runtime loading of textures) needs to be implemented still unless you use Unity's asset bundle loading.

Could you post the mod as a zip, that way I can delve a bit into it and I'll try to help debug it!

I do need the logs of the game of the crash to better help see what's going on.

We're going to consolidate all info needed for modding here once we continue work on it: https://github.com/GoldhawkInteractive/X2-Modding?tab=readme-ov-file#getting-started
However, this is under construction and aside from the example mods doesn't contain anything yet.

  • Like 1
Link to comment
Share on other sites

The only thing you should have to do with a mod is define it's manifest:

```
{
    "version": "0.0.4",
    "asset": {
        "Name": "Xenonauts Basic Cover Mod",
        "UID": "56bbba8a-7fb5-44c3-a6d3-834a2fb2d977",
        "Description": "A basic mod for Xenonauts 2 that changes cover values on the full cover master to 80%.",
        "Author": "Goldhawk Interactive",
        "Website":"http://www.goldhawkinteractive.com/",
        "Tags":["Official", "Mod"],
        "Version": "1.0.0",
        "$type": "Common.Content.DataStructures.ContentPackManifest"
    },
    "$type": "Common.Content.DataStructures.VersionedAsset"
}
``` 

The primary things that are crucial in the above are the name, and the UID - which need to be unique.
Our plan is to release a modding tool that automates the creation of the above, for now you could use an online generator (https://www.guidgenerator.com/) or simply change the UID yourself.

The second thing is that the structure of the mod needs to follow the directory structure in the Xenonauts folder - which only has the templates for now.

Link to comment
Share on other sites

Thank you Gijs-Jan,
 

Everything makes sense if you haven't implemented the ability to import a native PNG sprite into the game without going through a Unity bundle recompilation.

I can upload the game logs here if you tell me where to find them.

However, I've also tested the two mods suggested on https://github.com/GoldhawkInteractive/X2-Modding, and the game still crashes. I cloned the repo and placed the mods as they are in the game's mod directory. This UCase is probably what you'll be interested in for debugging.

Link to comment
Share on other sites

Ok, I have the log.  Attached to this message.

Step to reproduce the crash:
1. Start game
2. Go to MODS section
3. Choose any mod to activate, save and close mod section
4. Start a new game.
At this point, game crashes to Desktop.

I used the 2 mods from your Github.
I tested with my own mod too.
I tested with only a manifest with name and newly generated UID.

All 3 ucases crash the game.
 

output.log

Edited by LogRaam
  • Like 1
Link to comment
Share on other sites

Thank you for taking the time to get us the error report.
For some reason it seems to want to create a tooltip for the mod, trying to access the contents which crashes the game.
So it doesn't seem there's an issue with how you've setup the mod.

I'm going to card this up and try to see if I can spend some evening hours getting it fixed for next week.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...