Package com.fs.starfarer.api.campaign
Interface CampaignPlugin
- All Known Implementing Classes:
BaseCampaignPlugin
,CoreCampaignPluginImpl
public interface CampaignPlugin
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptiongetId()
Used for unregistering plugins, should be unique.boolean
If the plugin is transient, its data won't be included in save games and it needs to be re-added to the game every time (in ModPlugin.onGameLoad()).pickAbilityAI
(AbilityPlugin ability, ModularFleetAIAPI ai) AI for campaign abilities - transponder, go dark, emergency burn, etc.pickAICoreAdminPlugin
(String commodityId) pickAICoreOfficerPlugin
(String commodityId) See ModularFleetAIAPI documentation for details.pickAutofitPlugin
(FleetMemberAPI member) member will be null when picking plugin to assign idle officers from fleet screen.Returns a plugin used to quickly resolve a battle outcome.pickBattleCreationPlugin
(SectorEntityToken opponent) Returns a plugin that is used to generate the battlefield.pickFleetInflater
(CampaignFleetAPI fleet, Object params) pickImmigrationPlugin
(MarketAPI market) pickInteractionDialogPlugin
(SectorEntityToken interactionTarget) Returns the dialog plugin to be used to drive the interaction dialog for the particular entity.pickInteractionDialogPlugin
(Object param, SectorEntityToken interactionTarget) Used for: - interaction dialogs created by clicking on a comm message action icon Return null if this CampaignPlugin implementation doesn't provide a dialog for the above use case(s).See ModularFleetAIAPI documentation for details.pickReputationActionResponsePlugin
(Object action, PersonAPI person) pickReputationActionResponsePlugin
(Object action, String factionId) See ModularFleetAIAPI documentation for details.See ModularFleetAIAPI documentation for details.void
updateEntityFacts
(SectorEntityToken entity, MemoryAPI memory) Update the "this is known by the entity about the world" facts.void
updateFactionFacts
(FactionAPI faction, MemoryAPI memory) void
updateGlobalFacts
(MemoryAPI memory) void
updateMarketFacts
(MarketAPI market, MemoryAPI memory) void
updatePersonFacts
(PersonAPI person, MemoryAPI memory) void
updatePlayerFacts
(MemoryAPI memory)
-
Method Details
-
getId
String getId()Used for unregistering plugins, should be unique. Can be null, but shouldn't. If not null, the game will ensure that only one copy of the plugin can be registered - new registrations will override prior ones.- Returns:
-
isTransient
boolean isTransient()If the plugin is transient, its data won't be included in save games and it needs to be re-added to the game every time (in ModPlugin.onGameLoad()). If a plugin is not transient, its data is saved and it can be added in ModPlugin.onNewGame(). Plugins should be transient unless they need to save data, to improve the ability to add/remove mods from an existing game.- Returns:
-
pickInteractionDialogPlugin
PluginPick<InteractionDialogPlugin> pickInteractionDialogPlugin(SectorEntityToken interactionTarget) Returns the dialog plugin to be used to drive the interaction dialog for the particular entity. Return null if this CampaignPlugin implementation doesn't provide one.- Parameters:
interactionTarget
-- Returns:
-
pickInteractionDialogPlugin
PluginPick<InteractionDialogPlugin> pickInteractionDialogPlugin(Object param, SectorEntityToken interactionTarget) Used for: - interaction dialogs created by clicking on a comm message action icon Return null if this CampaignPlugin implementation doesn't provide a dialog for the above use case(s).- Parameters:
interactionTarget
-- Returns:
-
pickBattleCreationPlugin
Returns a plugin that is used to generate the battlefield. Mods could use this to create a custom battlefield for a special opponent, for example, without having to override the core BattleCreationPlugin implementation. Return null if this CampaignPlugin implementation doesn't provide one.- Parameters:
opponent
-- Returns:
-
pickBattleAutoresolverPlugin
Returns a plugin used to quickly resolve a battle outcome. Return null if this CampaignPlugin implementation doesn't provide one.- Parameters:
one
-two
-- Returns:
-
pickReputationActionResponsePlugin
PluginPick<ReputationActionResponsePlugin> pickReputationActionResponsePlugin(Object action, String factionId) -
pickReputationActionResponsePlugin
PluginPick<ReputationActionResponsePlugin> pickReputationActionResponsePlugin(Object action, PersonAPI person) -
updateEntityFacts
Update the "this is known by the entity about the world" facts. Any variables set here should have an expiration time of 0, since this method will be called every time the getMemory() method is called. Having facts not expire would clutter up the memory. Mod-added facts should have their variable names use a mod-specific prefix to avoid conflicts.- Parameters:
memory
-
-
updatePersonFacts
-
updateFactionFacts
-
updateGlobalFacts
-
updatePlayerFacts
-
updateMarketFacts
-
pickAssignmentAIModule
PluginPick<AssignmentModulePlugin> pickAssignmentAIModule(CampaignFleetAPI fleet, ModularFleetAIAPI ai) See ModularFleetAIAPI documentation for details.- Parameters:
fleet
-ai
-- Returns:
-
pickStrategicAIModule
PluginPick<StrategicModulePlugin> pickStrategicAIModule(CampaignFleetAPI fleet, ModularFleetAIAPI ai) See ModularFleetAIAPI documentation for details.- Parameters:
fleet
-ai
-- Returns:
-
pickTacticalAIModule
See ModularFleetAIAPI documentation for details.- Parameters:
fleet
-ai
-- Returns:
-
pickAbilityAI
AI for campaign abilities - transponder, go dark, emergency burn, etc.- Parameters:
ability
-- Returns:
-
pickStubConverter
-
pickStubConverter
-
pickAutofitPlugin
member will be null when picking plugin to assign idle officers from fleet screen. Only used for autofit in the refit screen. For NPC fleets, see: DefaultFleetInflater.- Parameters:
member
-- Returns:
-
pickRespawnPlugin
PluginPick<InteractionDialogPlugin> pickRespawnPlugin() -
pickImmigrationPlugin
-
pickAICoreAdminPlugin
-
pickAICoreOfficerPlugin
-
pickFleetInflater
-