If you've come to this post, the quick answer is:
1. Create a settings.json in your mod\data\config folder if you don't have one already
2. Add the following
"plugins":{
"Plugin1":"data.scripts.plugins.Plugin1",
"Plugin2":"data.scripts.plugins.Plugin2",
},
For as many plugins as you have
here is an example file:
{
"plugins":{
"AdrenalineToggleTracker":"data.scripts.plugins.AdrenalineToggleTracker",
"ProtectionTracker":"data.scripts.plugins.ProtectionTracker",
},
}
Now the long answer:
IF you have a loose EveryFrameCombatPlugin class file in data\scripts\plugins
*FOLDER* - it will be compiled and instantiated for you automatically by the game engine, but this is not the case for compiled JARs.
As soon as your EveryFrameCombatPlugin class file goes into the JAR file in a compiled format you must add it to the settings.json file, otherwise the best you can do is call upon other methods inside your file, but the game engine will not call upon the Advance or Init interfaces.
EDIT:
LazyWizard has spoken:
data/scripts/plugins is a special folder. The game will automatically add any plugins in this folder to the game, including instantiating them for you at the start of the battle. The "plugins" section of settings.json seems to be similar, but it doesn't force you to put your scripts in a specific folder.
So, the ways to get your plugin loaded (that I know of):
- Put it as a loose script in data/scripts/plugins
- Put it anywhere, then use CombatEngineAPI's addPlugin() to instantiate it in battle
- Include it in a jar AND in data/scripts/plugins, only the jarred version will be loaded
- Include it in a jar, then put an empty stub that extends the plugin in data/scripts/plugins
- Include it in a jar, then add it to "plugins" in data/config/settings.json
The last one is the best option as it's the only one that doesn't rely on the 'magic' data/scripts/plugins directory or another script doing extra work.
Addendum from DR to do with adding scripts in the settings.json file:
"..if it has an advance() that isn't explicitly defined elsewhere i.e. a beam effect or something is defined elsewhere but an EveryFrameCombatPlugin isn't then it must be in that settings file"