CustomGameOptions Mod for Modders (Including Source Code)

7 days to die customgameoptions mod for modders (including source code), 7 days to die menu

This is a new mod aimed at modders so they can easily add new Custom Game Options to their overhauls without having to write any C# code (well very little anyway). The game options are just added via a standard 7days XML patch file and then the variables can be used in any other Harmony patch (this is the only C# you need to do).

All you need to do to use is download the Compiled mod, add your own <gameoptions …/> xml to the windows.xml and then use the variables anywhere in your Harmony patches.

Source Code (if you want to poke around the actual code, this is not need to run the mod)

w00kien00kie has included an example windows.xml config patch in /XUi_Menu/windows.xml

NOTE: The ‘name’ parameter in the <gameoption> xml MUST start with the work ‘Custom’ otherwise the code will treat it as a normal vanilla gameoption and everything will error! (Highly advise to set a value for the new xml parameter default_value=”” for each <gameoption> you add)

7 days to die customgameoptions mod for modders (including source code) additional screenshot 1

You will need to add Localization as well, he has included a Localisation.txt example but you dont have to use that location for your own text changes. Note: Localization in <GameOptions/> is a bit odd but not hard, he’ll write some notes up with examples later.

There is also an example of how to use the variables within your Harmony patches (commented out by default) in the source code:

7 days to die customgameoptions mod for modders (including source code) additional screenshot 2

He has tested this in SP, MP and on a dedicated server BUT this is still a new approach and he is expecting some issues. Please thoroughly test within your own mods/overhauls. Any problems let him know.

This mod is just using standard C# code and supported Harmony patches (i.e. doesnt need BepInEx).

Download Compiled Mod

The forum topic of the mod is here.

Credits: w00kien00kie

Share this mod with your friends:

Leave a Reply

Your email address will not be published.