Jump to content

Mod Loader


Recommended Posts

Hi all,

To help me with Modding for Xenonauts 2 I've created a Mod Loader based on a forum post by asdfcyber (https://www.goldhawkinteractive.com/forums/index.php?/topic/28131-first-v25-modding-impressions/#comment-192760)

It uses mono.cecil to patch the Assembly-CSharp.dll and inject code that loads mods from a folder of your choosing. 

Essentially you run the Mod Loader exe and it'll inject the Mod Loader code if needed and then starts Xenonauts 2. It will then call a LoadMods method in the Xenonauts.XenonautsMain constructor.

The repo also contains an example mod that shows how to override existing methods using Harmony (https://github.com/pardeike/Harmony) and how to format the mod so that the Mod Loader can detect it. 

The repo can be found here: https://github.com/38Simulated/XenonautsModding

Not sure if there are that many people out there looking into modding the game, but I thought I'd post something just in case it was of any use to anyone.

  • Like 4
Link to comment
Share on other sites

3 minutes ago, 38Simulated said:

Hi all,

To help me with Modding for Xenonauts 2 I've created a Mod Loader based on a forum post by asdfcyber (https://www.goldhawkinteractive.com/forums/index.php?/topic/28131-first-v25-modding-impressions/#comment-192760)

It uses mono.cecil to patch the Assembly-CSharp.dll and inject code that loads mods from a folder of your choosing. 

Essentially you run the Mod Loader exe and it'll inject the Mod Loader code if needed and then starts Xenonauts 2. It will then call a LoadMods method in the Xenonauts.XenonautsMain constructor.

The repo also contains an example mod that shows how to override existing methods using Harmony (https://github.com/pardeike/Harmony) and how to format the mod so that the Mod Loader can detect it. 

The repo can be found here: https://github.com/38Simulated/XenonautsModding

Not sure if there are that many people out there looking into modding the game, but I thought I'd post something just in case it was of any use to anyone.

Good job with this, it's always impressive to see the lengths people are willing to go to to make mods work!

In this case though it's a little unneccessary, as we're actually working on a native mod loader ourselves which is nearly complete already. What we're talking to the community about at the moment is the creation of the actual mod tools themselves, as reading and editing the game files would be much more straightforward if handled via a standalone editor that people could use.

I'm not quite sure whether Solver is looking for help on the editor right now but if all goes well it's intended to be community-owned so it can be iterated on and improved by anyone who wants to devote the time to assisting the mod community.

Link to comment
Share on other sites

3 minutes ago, Chris said:

Good job with this, it's always impressive to see the lengths people are willing to go to to make mods work!

In this case though it's a little unneccessary, as we're actually working on a native mod loader ourselves which is nearly complete already. What we're talking to the community about at the moment is the creation of the actual mod tools themselves, as reading and editing the game files would be much more straightforward if handled via a standalone editor that people could use.

I'm not quite sure whether Solver is looking for help on the editor right now but if all goes well it's intended to be community-owned so it can be iterated on and improved by anyone who wants to devote the time to assisting the mod community.

The mod tools sound awesome and I look forward to using them / contributing when they get released :)

 

Link to comment
Share on other sites

21 hours ago, 38Simulated said:

...Not sure if there are that many people out there looking into modding the game, ...

With Xenonauts 1 the Mod scene was very agile and many people created lots of differents mods.

And the community that was there to assist/advise/critsize/demand/propose and sometimes cry about game devlopment steps before and after release, was helping the modders as well.
I expect something similar will happen with X2.

Link to comment
Share on other sites

  • 3 weeks later...
5 hours ago, asdfcyber said:

Nice! That'll save some time recompiling with each patch.

Also yes, feel free to use my code :P

If you take a look at the code you'll see i already did :) I've attributed you in the code and the readme :)

The actual code that loads the mods into X2 is essentially wholesale taken from your Github project :)

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...