Interface CampaignPlugin

All Known Implementing Classes:
BaseCampaignPlugin, CoreCampaignPluginImpl

public interface CampaignPlugin
  • 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

      PluginPick<BattleCreationPlugin> pickBattleCreationPlugin(SectorEntityToken opponent)
      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

      PluginPick<BattleAutoresolverPlugin> pickBattleAutoresolverPlugin(BattleAPI battle)
      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

      void updateEntityFacts(SectorEntityToken entity, MemoryAPI memory)
      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

      void updatePersonFacts(PersonAPI person, MemoryAPI memory)
    • updateFactionFacts

      void updateFactionFacts(FactionAPI faction, MemoryAPI memory)
    • updateGlobalFacts

      void updateGlobalFacts(MemoryAPI memory)
    • updatePlayerFacts

      void updatePlayerFacts(MemoryAPI memory)
    • updateMarketFacts

      void updateMarketFacts(MarketAPI market, MemoryAPI memory)
    • pickAssignmentAIModule

      See ModularFleetAIAPI documentation for details.
      Parameters:
      fleet -
      ai -
      Returns:
    • pickStrategicAIModule

      See ModularFleetAIAPI documentation for details.
      Parameters:
      fleet -
      ai -
      Returns:
    • pickTacticalAIModule

      See ModularFleetAIAPI documentation for details.
      Parameters:
      fleet -
      ai -
      Returns:
    • pickNavigationAIModule

      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

      PluginPick<AutofitPlugin> pickAutofitPlugin(FleetMemberAPI member)
      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

      PluginPick<ImmigrationPlugin> pickImmigrationPlugin(MarketAPI market)
    • pickAICoreAdminPlugin

      PluginPick<AICoreAdminPlugin> pickAICoreAdminPlugin(String commodityId)
    • pickAICoreOfficerPlugin

      PluginPick<AICoreOfficerPlugin> pickAICoreOfficerPlugin(String commodityId)
    • pickFleetInflater

      PluginPick<FleetInflater> pickFleetInflater(CampaignFleetAPI fleet, Object params)