Kingdom Come: Deliverance II Modding Discord
KCD2ModLoader is a modding plugin / framework for Kingdom Come: Deliverance II.
(A game made with CryEngine 5)
It's using ReturnOfModdingBase as a base. You can check its README for more information on how it works.
- TODO
-
Place the main KCD2ModLoader file, called
d3d12.dll, next to the game executable calledKingdomCome.exeinside the game folder. -
To uninstall the mod loader or revert to a vanilla experience without mods, you can simply rename or delete the
d3d12.dllfile.
-
Easy hot reloading of .lua files through a file watcher system, just save your .lua file and your main.lua file will get executed again by the mod loader.
-
Dear ImGui library integrated into lua directly, documented here and here.
-
FMOD modding.
-
Generic game file modifications.
-
ASI mod loading, it has the same feature set as this one, minus the configuration part.
-
XML Merging System. For files like InventoryPreset which are not supported fully by the game PTF System.
-
Trainer, right now with a very easy and nice to use Noclip.
-
Debug Inspectors: PTF, Entities.
It showcase multiple things:
- The usage of the Dear ImGui library, for easy creation of an UI for your mod.
-
FMOD getevent function is hooked the passed string identifier can be modified, meaning that you can easily swap and replace sounds.
-
You can also add additional FMOD events through xml modifications (more on that just below) since FMOD event names are also described inside xml nodes.
-
The mod loader also provide a way of loading / unloading additional FMOD sound banks. This specific feature is untested for now but should work with more details available inside the
rom.audio.mdfile inside the lua docs.
-
XML parsing function from the game is hooked and modified on the fly, you can then hook up a xml <-> lua table library (like this one) for very easy modifications for merging and so on.(Currently disabled due to crashes related to the Lua VM being used across multiple threads, will try to re-enable it in the future.) -
XML Merging System:
-
For files like InventoryPreset which are not supported fully by the game PTF System yet.
-
For
levelsxmls, right now onlyobjects_mission0files are supported.
-
rom.game_data.on_cryfile_openfor swapping almost any files that the game loads -
rom.game_data.on_pak_openableevent for loading / oepning pak files as soon as possible through the usage ofrom.game_data.open_pak.
-
Example usage of:
-
player.inventory:CreateItem -
System.GetEntityByName -
Entity:SetWorldPos -
ItemManager -
inventory:GetInventoryTable