That's the thing, I actually looked at several missions and I found addPlugin(new EscapeRevealPlugin(context)) so I thought it had to do with some EscapeRevealPlugin which didn't seem relevant to what I was trying to achieve.
However if I'd just had a look at a few more missions, and I'd opened the Bismarck mission it probably would have twigged at about line 94:
api.addPlugin(new EveryFrameCombatPlugin() {
public void init(CombatEngineAPI engine) {
engine.getContext().setStandoffRange(10000f);
}
public void advance(float amount, List events) {
}
});
That makes sense to me.
I have a bit of a concern though with this method of adding a plugin. Normally when I do a plugin, I either clear out lists in the Init or in advance section from the previous engine.
However if the plugin is not run again in another instance of combat, those lists/hashmaps etc. might remain there in memory until the application closes. So if the use case is the user plays the mission with the script X that stores various ship data, they then complete the mission, then go off and play the campaign I'm not certain that the GC would cleanup my lists/hashmaps properly, potentially leading to a crash due to lack of memory on 32-bit systems.
Anyway aside from the GC of mission EveryFrameCombatPlugin scripts lists, I think it seems fairly straight forward after looking at the bismarck mission.