The plugin is necessary whenever you are going to start the campaign integration or you have a unique coding that you may want to have your ships behave differently, like the
Interstellar Imperium mod, which is where most of the magic happens. But if you are going to make some ships and a mission, the plugin is not necessary to build up.
To start with, your mod should have a mod_info.json, which is located just about inside your main mod folder, at "Mods\Your Mod Folder".
Then your plugin should be located at "Mods\Your Mod Folder\data\scripts".
For the script itself, here is mine:
Spoiler
package data.scripts;
import com.fs.starfarer.api.BaseModPlugin;
import com.fs.starfarer.api.Global;
import com.fs.starfarer.api.PluginPick;
import com.fs.starfarer.api.campaign.CampaignPlugin;
import com.fs.starfarer.api.combat.MissileAIPlugin;
import com.fs.starfarer.api.combat.MissileAPI;
import com.fs.starfarer.api.combat.ShipAPI;
import data.scripts.world.PTgen;
public class PTechPlugin extends BaseModPlugin {
private static void initPT() {
try {
Global.getSettings().getScriptClassLoader().loadClass("data.scripts.world.ExerelinGen");
} catch (ClassNotFoundException ex) {
new PTgen().generate(Global.getSector());
}
}
@Override
public void onNewGame()
{
initPT();
// new PTgen().generate(Global.getSector());
}
}
Well, almost ideal, except that it has Missile Plugins for future updates.
And yes, you have the necessary imports, but if you are going to have star system, the Global package and the name of your Generator, like the "PTgen", should also be there. Provided that you have the faction for it.
You can also locally reference the mods that already appeared in the Mods thread, just be wary that some of them have already integrated ShaderLib and LazyLib in their codes.