-
Notifications
You must be signed in to change notification settings - Fork 84
Creating Mods
##Creating your mods
Don't change codeNw.js in the game folder directly. If you want to mod the game, create your own mod package and copy it into ./mods
Currently you also have to register it manually under ./mods/modConfig.js for it to load.
For an example look at the mod-API mod that ships with GDT.
If you find the need to change/adapt a specific method in the games code, check first if there is support in this API.
If there is no support but it fits well as a general purpose method for other mods consider forking the API to implement it and then create a pull request.
If it doesn't fit for other mods you can hijack the method to add your own behaviour:
var originalMethod = GDT.foo;
var bar = function(){
//add your custom code
GDT.foo();//if appropriate, call the original logic
};
GDT.foo = bar;//assign your custom method over the original.
If you want your mod to work with others be very careful on how you change behaviors like this. Please also note that excessive copying of code from the original source is against the Modding Agreement.