Starsector API
|
Public Member Functions | |
void | onApplicationLoad () throws Exception |
void | onNewGame () |
void | onEnabled (boolean wasEnabledBefore) |
void | onGameLoad (boolean newGame) |
void | beforeGameSave () |
void | afterGameSave () |
void | onGameSaveFailed () |
void | onNewGameAfterProcGen () |
void | onNewGameAfterEconomyLoad () |
void | onNewGameAfterTimePass () |
void | onDevModeF8Reload () |
PluginPick< ShipAIPlugin > | pickShipAI (FleetMemberAPI member, ShipAPI ship) |
PluginPick< AutofireAIPlugin > | pickWeaponAutofireAI (WeaponAPI weapon) |
PluginPick< ShipAIPlugin > | pickDroneAI (ShipAPI drone, ShipAPI mothership, DroneLauncherShipSystemAPI system) |
PluginPick< MissileAIPlugin > | pickMissileAI (MissileAPI missile, ShipAPI launchingShip) |
void | configureXStream (XStream x) |
NOTE: Instead of implementing this interface, extend BaseModPlugin instead.
A new instance of a mod's modPlugin class will be created when the game starts.
Copyright 2012 Fractal Softworks, LLC
Definition at line 22 of file ModPlugin.java.
void com.fs.starfarer.api.ModPlugin.afterGameSave | ( | ) |
Called after a game is saved.
Implemented in com.fs.starfarer.api.BaseModPlugin, and com.fs.starfarer.api.impl.campaign.CoreLifecyclePluginImpl.
void com.fs.starfarer.api.ModPlugin.beforeGameSave | ( | ) |
Called before a game is saved.
Implemented in com.fs.starfarer.api.BaseModPlugin, and com.fs.starfarer.api.impl.campaign.CoreLifecyclePluginImpl.
void com.fs.starfarer.api.ModPlugin.configureXStream | ( | XStream | x | ) |
void com.fs.starfarer.api.ModPlugin.onApplicationLoad | ( | ) | throws Exception |
Called after all the core loading has finished and all the scripts have finished being compiled. Gives the mod an opportunity to load its own data using the relevant SettingsAPI methods.
Exception |
Implemented in com.fs.starfarer.api.BaseModPlugin.
void com.fs.starfarer.api.ModPlugin.onDevModeF8Reload | ( | ) |
Called after F8 is pressed in combat while in devMode. Note: the game becomes potentially unstable after an F8-dev mode reload. That is, crashes may occur that would not have occured otherwise and are not indicative of bugs.
Implemented in com.fs.starfarer.api.BaseModPlugin.
void com.fs.starfarer.api.ModPlugin.onEnabled | ( | boolean | wasEnabledBefore | ) |
Called before onGameLoad() and only if this mod was not previously enabled for the loaded saved game, or if this is a new game.
wasEnabledBefore | true if the mod was enabled for this saved game at some point in the past, though not immediately prior (or this method wouldn't be called at all). |
Implemented in com.fs.starfarer.api.BaseModPlugin.
void com.fs.starfarer.api.ModPlugin.onGameLoad | ( | boolean | newGame | ) |
Called after a game has been loaded. Also called when a new game is created, after the onNewGame() plugins for all the mods have been called.
Implemented in com.fs.starfarer.api.BaseModPlugin, and com.fs.starfarer.api.impl.campaign.CoreLifecyclePluginImpl.
void com.fs.starfarer.api.ModPlugin.onGameSaveFailed | ( | ) |
Called if saving the game failed for some reason, such as running out of memory.
Implemented in com.fs.starfarer.api.BaseModPlugin, and com.fs.starfarer.api.impl.campaign.CoreLifecyclePluginImpl.
void com.fs.starfarer.api.ModPlugin.onNewGame | ( | ) |
Called when a new game is being created. This is the preferred way to generate the contents of the Sector, and is meant to replace generators.csv (which remains used for backwards compatibility).
Implemented in com.fs.starfarer.api.BaseModPlugin, and com.fs.starfarer.api.impl.campaign.CoreLifecyclePluginImpl.
void com.fs.starfarer.api.ModPlugin.onNewGameAfterEconomyLoad | ( | ) |
Called after the economy is loaded from economy.json and the initial steps are taken. At this point, calling get getMarket() on entities will return the proper market. The sequence of calls is: onNewGame(); // can add markets to the economy here programmatically //load economy and step it onNewGameAfterEconomyLoad();
Implemented in com.fs.starfarer.api.BaseModPlugin, and com.fs.starfarer.api.impl.campaign.CoreLifecyclePluginImpl.
void com.fs.starfarer.api.ModPlugin.onNewGameAfterProcGen | ( | ) |
Implemented in com.fs.starfarer.api.BaseModPlugin.
void com.fs.starfarer.api.ModPlugin.onNewGameAfterTimePass | ( | ) |
After the new game has stepped through its initial 2 months.
Implemented in com.fs.starfarer.api.BaseModPlugin, and com.fs.starfarer.api.impl.campaign.CoreLifecyclePluginImpl.
PluginPick< ShipAIPlugin > com.fs.starfarer.api.ModPlugin.pickDroneAI | ( | ShipAPI | drone, |
ShipAPI | mothership, | ||
DroneLauncherShipSystemAPI | system | ||
) |
Called to pick drone AI implementation.
drone | |
mothership | |
system | use getSpecJson() to get at the system spec, if needed. |
Implemented in com.fs.starfarer.api.BaseModPlugin.
PluginPick< MissileAIPlugin > com.fs.starfarer.api.ModPlugin.pickMissileAI | ( | MissileAPI | missile, |
ShipAPI | launchingShip | ||
) |
Called to pick missile AI implementation.
drone | |
launchingShip |
Implemented in com.fs.starfarer.api.BaseModPlugin.
PluginPick< ShipAIPlugin > com.fs.starfarer.api.ModPlugin.pickShipAI | ( | FleetMemberAPI | member, |
ShipAPI | ship | ||
) |
Called to pick an AI implementation for a specific ship. Here instead of in CampaignPlugin to support custom AI for missions.
member | Can be null. |
ship | Can not be null. Could be a ship or a fighter. |
Implemented in com.fs.starfarer.api.BaseModPlugin, and com.fs.starfarer.api.impl.campaign.CoreLifecyclePluginImpl.
PluginPick< AutofireAIPlugin > com.fs.starfarer.api.ModPlugin.pickWeaponAutofireAI | ( | WeaponAPI | weapon | ) |
Called to pick an AI implementation for a specific weapon.
weapon |
Implemented in com.fs.starfarer.api.BaseModPlugin.