OK so, I'm a complete noob & looking to make a small campaign mod. After asking for/getting some help from another user, (Thank you!), I've found I still need some more hand-holding.
Here're my impressions after going through some instructions/examples/guides:
The first step to getting a mod into the game is the mod_info.json file.
This tells the game (and the user) details about the mod, points to the .jar (a pre-compiled version of the .java files; having a .jar is optional but saves on in-game load-time), and finally it points the game to the modplugin.java file.
Simple enough.
The second step is the modplugin.java (this would be contained in the .jar if you were to compile one (using an IDE)).
The purpose of this plugin is 'to tell starsector to load the campaign/combat plugin'.
But, being a noob, I'd like to know how exactly it does this? Looking at
the SS+ modplugin as an example, it seems to import a bunch of other files & 'extends' the vanilla 'modplugin', (aka it loads everything *that* loads as well).
What does importing do, precisely? Does it just enable references to the variables present in the imported files? What's a rule-of-thumb as far as what gets imported? It then seems to add some new variables, (seems straight-forward), and then if I understand correctly it checks several variables & sets up contingencies for those, for example returning an error message if you're trying to add SS+ to an already-existing game.
Question here is, if there aren't any variables or contingencies to consider (unlike in a large mod, say SS+),
could the modplugin.java be just a few lines long?The person who helped me pointed out this line of code in the SS+ modplugin.
Global.getSector().registerPlugin(new SSP_CampaignPlugin());
ContextWould one simply need to 'registerplugin' on game-load or newgame?
What are some variables & contingencies that should always be checked?
Are there special considerations for registering a new plugin in an existing game?
Aand that's as far as I've gotten.
If some generous soul has the time to outline the different parts of a simple modplugin.java in Starsector, how each line does what it does, (or knows of a heavily-commented example which does exactly that), I'd be much obliged!