This repository contains my mods and mod frameworks for the game Kingdoms and Castles (which I highly recommend you to play).
So far this project implements the following frameworks:
- Zat.InterModComm: Provides functionality to perform remote procedure calls (RPC) between multiple mods. You can use this to perform calls and bind events between mods.
- Zat.ModMenu.API: An API you can use in your own mod projects to interact with the mod menu. You can define settings and categories, subscribe to changes and update UI elements programmatically.
Please refer to the wiki on how to use these frameworks.
The "Scripts" Visual Studio solution contains all code of my mods and mod frameworks.
In order to set this repo up on your machine, follow these steps:
- Clone or download the respository
- Copy all Libraries (
*.dll
files) from the folder games' folderKingdoms and Castles\KingdomsAndCastles_Data\Managed
into the folderScripts\GameData
. This way Visual Studio will detect all references to the game's code and libraries.
> Note: If all you wish to do is interface with the mod menu, please read the wiki article instead!
To create your own mod, simply create a new folder in the Scripts
folder in Visual Studio, e.g. MyAwesomeMod. If you wish to use my shared classes (located in Scripts\Shared
), simply import their namespaces - and don't forget to deploy them later on!
If you want to test your mods in-game, copy your mod folder (e.g. Scripts\MyAwesomeMod
) to the game's mod folder (Kingdoms and Castles\KingdomsAndCastles_Data\mods
). If you use any of my shared classes, copy them over with your mods' files (Kingdoms and Castles\KingdomsAndCastles_Data\mods\MyAwesomeMod
).
To automate this process use ArchieV1's compiler script. Find it here. Have all of the shared classes files you want to use be in the same folder as your code and set the variables inside of the "compiler"
The "Unity Project" folder can be opened with Unity 2018.2.5f1. It contains the default data from the Kingdoms and Castles Toolkit plus all of my prefabs, sprites and models.