Starsector API
Loading...
Searching...
No Matches
com.fs.starfarer.api.BaseModPlugin Class Reference
Inheritance diagram for com.fs.starfarer.api.BaseModPlugin:
[legend]
Collaboration diagram for com.fs.starfarer.api.BaseModPlugin:
[legend]

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 ()
 

Detailed Description

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.

Author
Alex Mosolov

Copyright 2013 Fractal Softworks, LLC

Definition at line 24 of file BaseModPlugin.java.

Member Function Documentation

◆ afterGameSave()

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.

◆ beforeGameSave()

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.

◆ configureXStream()

void com.fs.starfarer.api.BaseModPlugin.configureXStream ( XStream  x)

◆ onApplicationLoad()

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.

Exceptions
Exception

Implements com.fs.starfarer.api.ModPlugin.

Definition at line 38 of file BaseModPlugin.java.

◆ onDevModeF8Reload()

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.

◆ onEnabled()

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.

Parameters
wasEnabledBeforetrue 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.

◆ onGameLoad()

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.

◆ onGameSaveFailed()

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.

◆ onNewGame()

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.

◆ onNewGameAfterEconomyLoad()

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.

◆ onNewGameAfterProcGen()

void com.fs.starfarer.api.BaseModPlugin.onNewGameAfterProcGen ( )

Implements com.fs.starfarer.api.ModPlugin.

Definition at line 84 of file BaseModPlugin.java.

◆ onNewGameAfterTimePass()

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.

◆ pickDroneAI()

PluginPick< ShipAIPlugin > com.fs.starfarer.api.BaseModPlugin.pickDroneAI ( ShipAPI  drone,
ShipAPI  mothership,
DroneLauncherShipSystemAPI  system 
)

Called to pick drone AI implementation.

Parameters
drone
mothership
systemuse getSpecJson() to get at the system spec, if needed.
Returns

Implements com.fs.starfarer.api.ModPlugin.

Definition at line 66 of file BaseModPlugin.java.

◆ pickMissileAI()

PluginPick< MissileAIPlugin > com.fs.starfarer.api.BaseModPlugin.pickMissileAI ( MissileAPI  missile,
ShipAPI  launchingShip 
)

Called to pick missile AI implementation.

Parameters
drone
launchingShip
Returns

Implements com.fs.starfarer.api.ModPlugin.

Definition at line 71 of file BaseModPlugin.java.

◆ pickShipAI()

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.

Parameters
memberCan be null.
shipCan not be null. Could be a ship or a fighter.
Returns
null, or a custom AI implementation.

Implements com.fs.starfarer.api.ModPlugin.

Reimplemented in com.fs.starfarer.api.impl.campaign.CoreLifecyclePluginImpl.

Definition at line 58 of file BaseModPlugin.java.

◆ pickWeaponAutofireAI()

PluginPick< AutofireAIPlugin > com.fs.starfarer.api.BaseModPlugin.pickWeaponAutofireAI ( WeaponAPI  weapon)

Called to pick an AI implementation for a specific weapon.

Parameters
weapon
Returns

Implements com.fs.starfarer.api.ModPlugin.

Definition at line 62 of file BaseModPlugin.java.


The documentation for this class was generated from the following file: