-
Notifications
You must be signed in to change notification settings - Fork 2
Modding
Quest Command now supports basic modding functionality.
Currently you can use mods to add new event listeners, items, activators, creatures, agendas (ai) conversations, locations etc. Editing vanilla things, or having one mod modify another is not yet supported.
Only the JVM version of the game can be modded. That said, since the server version is JVM, if your server uses the latest Quest Command, you can mod the server and other clients can connect to that and use mods through the server. (If the server loads the mods, the clients will be able to use them; mods only need to be installed server-side).
Wherever your Quest Command Jar is located, add a mods
folder. Inside that folder, add a manifest.txt
and any mod jars you want to use.
Given I'm using the mod example, I have placed my mod-example.jar
in the mods folder.
Add the name of each jar to the manifest.txt
file, one line per mod. I've added mod-example
to the first line of the file. (Eventually load order will be determined by order in the manifest file.
Start the game. It should tell you how many mods it found and is loading.
See the Mod Example Project for an example. At this time any kind of Collection
should be addable (think items, creatures, conversations, locations, etc). Editing vanilla things, or having one mod modify another is not yet supported.
In your build.gradle
, make sure to depend on the latest version of org.rak.manapart:quest-command
. This gives you access to all the interfaces you need, as well as all the other vanilla classes. To reduce jar size and not create recursive dependencies, make sure to create thin jar and not include the quest command dependencies as a transitive dependency. (See the jar
task in the example mod).
To add something, create a new resource class and implement its values()
function. In the mod example we add a new item by implementing ItemResource
. Essentially, at app startup any loaded mod jars will be looked through for all "resource" classes, their builders will be called and the results will be added to the game's list of "things".
JVM Only
- Mods are loaded from jars
- JS currently has no mechanism for mod loading
- Vanilla clients should work fine with modded servers
New Content Only
- Mods currently only add things
- There are no hooks to change existing things
- I'd like to remove this constraint eventually
Mod Order and Priority
- Mods should load in the order they are referenced in the manifest
- Mod conflicts are not explicitly handled
- Two mods that add an item with the same name may lead to unexpected behavior
- I'd like to remove this constraint eventually