Starsector API
|
Public Member Functions | |
void | afterGameSave () |
void | beforeGameSave () |
void | onGameSaveFailed () |
void | onApplicationLoad () throws Exception |
void | onEnabled (boolean wasEnabledBefore) |
void | onGameLoad (boolean newGame) |
void | onNewGame () |
void | onNewGameAfterEconomyLoad () |
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 | onNewGameAfterTimePass () |
void | configureXStream (XStream x) |
void | onNewGameAfterProcGen () |
void | onDevModeF8Reload () |
Extend this class instead of implementing ModPlugin for convenience if you do not intend to implement all the methods. This will also help avoid your mod breaking when new methods are added to ModPlugin, since default implemenations will be added here and your implementation will inherit them.
Copyright 2013 Fractal Softworks, LLC
Definition at line 24 of file BaseModPlugin.java.
void com.fs.starfarer.api.BaseModPlugin.afterGameSave | ( | ) |
Called after a game is saved.
Implements com.fs.starfarer.api.ModPlugin.
Reimplemented in com.fs.starfarer.api.impl.campaign.CoreLifecyclePluginImpl.
Definition at line 26 of file BaseModPlugin.java.
void com.fs.starfarer.api.BaseModPlugin.beforeGameSave | ( | ) |
Called before a game is saved.
Implements com.fs.starfarer.api.ModPlugin.
Reimplemented in com.fs.starfarer.api.impl.campaign.CoreLifecyclePluginImpl.
Definition at line 30 of file BaseModPlugin.java.
void com.fs.starfarer.api.BaseModPlugin.configureXStream | ( | XStream | x | ) |
Implements com.fs.starfarer.api.ModPlugin.
Reimplemented in com.fs.starfarer.api.impl.campaign.CoreLifecyclePluginImpl.
Definition at line 80 of file BaseModPlugin.java.
void com.fs.starfarer.api.BaseModPlugin.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 |
Implements com.fs.starfarer.api.ModPlugin.
Definition at line 38 of file BaseModPlugin.java.
void com.fs.starfarer.api.BaseModPlugin.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.
Implements com.fs.starfarer.api.ModPlugin.
Definition at line 89 of file BaseModPlugin.java.
void com.fs.starfarer.api.BaseModPlugin.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). |
Implements com.fs.starfarer.api.ModPlugin.
Definition at line 42 of file BaseModPlugin.java.
void com.fs.starfarer.api.BaseModPlugin.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.
Implements com.fs.starfarer.api.ModPlugin.
Reimplemented in com.fs.starfarer.api.impl.campaign.CoreLifecyclePluginImpl.
Definition at line 46 of file BaseModPlugin.java.
void com.fs.starfarer.api.BaseModPlugin.onGameSaveFailed | ( | ) |
Called if saving the game failed for some reason, such as running out of memory.
Implements com.fs.starfarer.api.ModPlugin.
Reimplemented in com.fs.starfarer.api.impl.campaign.CoreLifecyclePluginImpl.
Definition at line 34 of file BaseModPlugin.java.
void com.fs.starfarer.api.BaseModPlugin.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).
Implements com.fs.starfarer.api.ModPlugin.
Reimplemented in com.fs.starfarer.api.impl.campaign.CoreLifecyclePluginImpl.
Definition at line 50 of file BaseModPlugin.java.
void com.fs.starfarer.api.BaseModPlugin.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();
Implements com.fs.starfarer.api.ModPlugin.
Reimplemented in com.fs.starfarer.api.impl.campaign.CoreLifecyclePluginImpl.
Definition at line 54 of file BaseModPlugin.java.
void com.fs.starfarer.api.BaseModPlugin.onNewGameAfterProcGen | ( | ) |
Implements com.fs.starfarer.api.ModPlugin.
Definition at line 84 of file BaseModPlugin.java.
void com.fs.starfarer.api.BaseModPlugin.onNewGameAfterTimePass | ( | ) |
After the new game has stepped through its initial 2 months.
Implements com.fs.starfarer.api.ModPlugin.
Reimplemented in com.fs.starfarer.api.impl.campaign.CoreLifecyclePluginImpl.
Definition at line 76 of file BaseModPlugin.java.
PluginPick< ShipAIPlugin > com.fs.starfarer.api.BaseModPlugin.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. |
Implements com.fs.starfarer.api.ModPlugin.
Definition at line 66 of file BaseModPlugin.java.
PluginPick< MissileAIPlugin > com.fs.starfarer.api.BaseModPlugin.pickMissileAI | ( | MissileAPI | missile, |
ShipAPI | launchingShip | ||
) |
Called to pick missile AI implementation.
drone | |
launchingShip |
Implements com.fs.starfarer.api.ModPlugin.
Definition at line 71 of file BaseModPlugin.java.
PluginPick< ShipAIPlugin > com.fs.starfarer.api.BaseModPlugin.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. |
Implements com.fs.starfarer.api.ModPlugin.
Reimplemented in com.fs.starfarer.api.impl.campaign.CoreLifecyclePluginImpl.
Definition at line 58 of file BaseModPlugin.java.
PluginPick< AutofireAIPlugin > com.fs.starfarer.api.BaseModPlugin.pickWeaponAutofireAI | ( | WeaponAPI | weapon | ) |
Called to pick an AI implementation for a specific weapon.
weapon |
Implements com.fs.starfarer.api.ModPlugin.
Definition at line 62 of file BaseModPlugin.java.