|
Starsector API
|
Note: generics can not be used in scripts. They are used in this API purely to show the return/parameter types of functions more clearly.
Copyright 2012 Fractal Softworks, LLC
Definition at line 40 of file SectorAPI.java.
| void com.fs.starfarer.api.campaign.SectorAPI.addListener | ( | CampaignEventListener | listener | ) |
| void com.fs.starfarer.api.campaign.SectorAPI.addListenerWithTimeout | ( | CampaignEventListener | listener, |
| float | daysToKeep ) |
| EveryFrameScript com.fs.starfarer.api.campaign.SectorAPI.addPing | ( | SectorEntityToken | entity, |
| CampaignPingSpec | custom ) |
| EveryFrameScript com.fs.starfarer.api.campaign.SectorAPI.addPing | ( | SectorEntityToken | entity, |
| String | pingType ) |
See data/campaign/pings.json for ping types.
| entity | |
| pingType |
| EveryFrameScript com.fs.starfarer.api.campaign.SectorAPI.addPing | ( | SectorEntityToken | entity, |
| String | pingType, | ||
| Color | colorOverride ) |
| void com.fs.starfarer.api.campaign.SectorAPI.addScript | ( | EveryFrameScript | script | ) |
| void com.fs.starfarer.api.campaign.SectorAPI.addTransientListener | ( | CampaignEventListener | listener | ) |
| void com.fs.starfarer.api.campaign.SectorAPI.addTransientScript | ( | EveryFrameScript | script | ) |
| ReputationAdjustmentResult com.fs.starfarer.api.campaign.SectorAPI.adjustPlayerReputation | ( | Object | action, |
| PersonAPI | person ) |
Adjust the player's reputation with the specified person, based on the action.
This method will pick the highest-priority ReputationActionResponsePlugin and call its handlePlayerReputationAction() method with these parameters.
See CoreCampaignPluginImpl.handlePlayerReputationAction() for an implementation example.
| action | |
| person |
| ReputationAdjustmentResult com.fs.starfarer.api.campaign.SectorAPI.adjustPlayerReputation | ( | Object | action, |
| String | factionId ) |
Adjust the player's reputation with the specified faction, based on the action.
This method will pick the highest-priority ReputationActionResponsePlugin and call its handlePlayerReputationAction() method with these parameters.
See CoreCampaignPluginImpl.handlePlayerReputationAction() for an implementation example.
| action | |
| faction |
| NascentGravityWellAPI com.fs.starfarer.api.campaign.SectorAPI.createNascentGravityWell | ( | SectorEntityToken | target, |
| float | radius ) |
| StarSystemAPI com.fs.starfarer.api.campaign.SectorAPI.createStarSystem | ( | String | name | ) |
| void com.fs.starfarer.api.campaign.SectorAPI.doHyperspaceTransition | ( | CampaignFleetAPI | fleet, |
| SectorEntityToken | jumpLocation, | ||
| JumpDestination | dest ) |
| fleet | |
| jumpLocation | can be null. If not, fleet will attempt to reach it before jumping. Failure will result in aborted jump. |
| dest |
| void com.fs.starfarer.api.campaign.SectorAPI.doHyperspaceTransition | ( | CampaignFleetAPI | fleetAPI, |
| SectorEntityToken | jumpLocation, | ||
| JumpDestination | dest, | ||
| float | initialDelay ) |
| String com.fs.starfarer.api.campaign.SectorAPI.genUID | ( | ) |
| List< String > com.fs.starfarer.api.campaign.SectorAPI.getAllEmptyVariantIds | ( | ) |
| List< FactionAPI > com.fs.starfarer.api.campaign.SectorAPI.getAllFactions | ( | ) |
| List< String > com.fs.starfarer.api.campaign.SectorAPI.getAllFighterWingIds | ( | ) |
| List< CampaignEventListener > com.fs.starfarer.api.campaign.SectorAPI.getAllListeners | ( | ) |
| List< LocationAPI > com.fs.starfarer.api.campaign.SectorAPI.getAllLocations | ( | ) |
All star systems and hyperspace.
| List< String > com.fs.starfarer.api.campaign.SectorAPI.getAllWeaponIds | ( | ) |
| AutofitVariantsAPI com.fs.starfarer.api.campaign.SectorAPI.getAutofitVariants | ( | ) |
| CampaignUIAPI com.fs.starfarer.api.campaign.SectorAPI.getCampaignUI | ( | ) |
| CharacterDataAPI com.fs.starfarer.api.campaign.SectorAPI.getCharacterData | ( | ) |
| CampaignClockAPI com.fs.starfarer.api.campaign.SectorAPI.getClock | ( | ) |
| LocationAPI com.fs.starfarer.api.campaign.SectorAPI.getCurrentLocation | ( | ) |
| MarketAPI com.fs.starfarer.api.campaign.SectorAPI.getCurrentlyOpenMarket | ( | ) |
| List< SectorEntityToken > com.fs.starfarer.api.campaign.SectorAPI.getCustomEntitiesWithTag | ( | String | tag | ) |
| String com.fs.starfarer.api.campaign.SectorAPI.getDifficulty | ( | ) |
| EconomyAPI com.fs.starfarer.api.campaign.SectorAPI.getEconomy | ( | ) |
| List< SectorEntityToken > com.fs.starfarer.api.campaign.SectorAPI.getEntitiesWithTag | ( | String | tag | ) |
Iterates through hyperspace and all star systems.
| tag |
| SectorEntityToken com.fs.starfarer.api.campaign.SectorAPI.getEntityById | ( | String | id | ) |
Will look for the entity in all LocationAPIs.
| id |
| CampaignEventManagerAPI com.fs.starfarer.api.campaign.SectorAPI.getEventManager | ( | ) |
| FactionAPI com.fs.starfarer.api.campaign.SectorAPI.getFaction | ( | String | factionId | ) |
| GenericPluginManagerAPI com.fs.starfarer.api.campaign.SectorAPI.getGenericPlugins | ( | ) |
| LocationAPI com.fs.starfarer.api.campaign.SectorAPI.getHyperspace | ( | ) |
| ImportantPeopleAPI com.fs.starfarer.api.campaign.SectorAPI.getImportantPeople | ( | ) |
| IntelDataAPI com.fs.starfarer.api.campaign.SectorAPI.getIntel | ( | ) |
| IntelManagerAPI com.fs.starfarer.api.campaign.SectorAPI.getIntelManager | ( | ) |
| long com.fs.starfarer.api.campaign.SectorAPI.getLastPlayerBattleTimestamp | ( | ) |
| ListenerManagerAPI com.fs.starfarer.api.campaign.SectorAPI.getListenerManager | ( | ) |
| MemoryAPI com.fs.starfarer.api.campaign.SectorAPI.getMemory | ( | ) |
"global" memory.
| MemoryAPI com.fs.starfarer.api.campaign.SectorAPI.getMemoryWithoutUpdate | ( | ) |
| SectorEntityToken com.fs.starfarer.api.campaign.SectorAPI.getMousedOverEntity | ( | ) |
| Map< String, Object > com.fs.starfarer.api.campaign.SectorAPI.getPersistentData | ( | ) |
Can be used (including by classes that are not part of the savegame - i.e. ModPlugin or transient CampaignPlugin implementations) to save data between sessions.
| long com.fs.starfarer.api.campaign.SectorAPI.getPlayerBattleSeed | ( | ) |
| FactionAPI com.fs.starfarer.api.campaign.SectorAPI.getPlayerFaction | ( | ) |
| CampaignFleetAPI com.fs.starfarer.api.campaign.SectorAPI.getPlayerFleet | ( | ) |
| MemoryAPI com.fs.starfarer.api.campaign.SectorAPI.getPlayerMemoryWithoutUpdate | ( | ) |
Same as getCharacterData().getMemoryWithoutUpdate()
| PersonAPI com.fs.starfarer.api.campaign.SectorAPI.getPlayerPerson | ( | ) |
| MutableCharacterStatsAPI com.fs.starfarer.api.campaign.SectorAPI.getPlayerStats | ( | ) |
| PluginPickerAPI com.fs.starfarer.api.campaign.SectorAPI.getPluginPicker | ( | ) |
| Vector2f com.fs.starfarer.api.campaign.SectorAPI.getRespawnCoordinates | ( | ) |
| LocationAPI com.fs.starfarer.api.campaign.SectorAPI.getRespawnLocation | ( | ) |
| RulesAPI com.fs.starfarer.api.campaign.SectorAPI.getRules | ( | ) |
| List< EveryFrameScript > com.fs.starfarer.api.campaign.SectorAPI.getScripts | ( | ) |
| String com.fs.starfarer.api.campaign.SectorAPI.getSeedString | ( | ) |
| StarSystemAPI com.fs.starfarer.api.campaign.SectorAPI.getStarSystem | ( | String | name | ) |
| List< StarSystemAPI > com.fs.starfarer.api.campaign.SectorAPI.getStarSystems | ( | ) |
| List< EveryFrameScript > com.fs.starfarer.api.campaign.SectorAPI.getTransientScripts | ( | ) |
| PersistentUIDataAPI com.fs.starfarer.api.campaign.SectorAPI.getUIData | ( | ) |
| ViewportAPI com.fs.starfarer.api.campaign.SectorAPI.getViewport | ( | ) |
| boolean com.fs.starfarer.api.campaign.SectorAPI.hasScript | ( | Class<?> | clazz | ) |
| boolean com.fs.starfarer.api.campaign.SectorAPI.hasTransientScript | ( | Class<?> | clazz | ) |
| boolean com.fs.starfarer.api.campaign.SectorAPI.isFastForwardIteration | ( | ) |
| boolean com.fs.starfarer.api.campaign.SectorAPI.isInFastAdvance | ( | ) |
true during the during-game-creation time passing.
| boolean com.fs.starfarer.api.campaign.SectorAPI.isInNewGameAdvance | ( | ) |
| boolean com.fs.starfarer.api.campaign.SectorAPI.isInSectorGen | ( | ) |
| boolean com.fs.starfarer.api.campaign.SectorAPI.isIronMode | ( | ) |
| boolean com.fs.starfarer.api.campaign.SectorAPI.isLastPlayerBattleWon | ( | ) |
| boolean com.fs.starfarer.api.campaign.SectorAPI.isPaused | ( | ) |
| void com.fs.starfarer.api.campaign.SectorAPI.layInCourseFor | ( | SectorEntityToken | target | ) |
| void com.fs.starfarer.api.campaign.SectorAPI.registerPlugin | ( | CampaignPlugin | plugin | ) |
| void com.fs.starfarer.api.campaign.SectorAPI.removeListener | ( | CampaignEventListener | listener | ) |
| void com.fs.starfarer.api.campaign.SectorAPI.removeScript | ( | EveryFrameScript | script | ) |
| void com.fs.starfarer.api.campaign.SectorAPI.removeScriptsOfClass | ( | Class | c | ) |
| void com.fs.starfarer.api.campaign.SectorAPI.removeStarSystem | ( | StarSystemAPI | system | ) |
| void com.fs.starfarer.api.campaign.SectorAPI.removeStarSystemNextFrame | ( | StarSystemAPI | system | ) |
Useful for remove star systems from scripts etc where using removeStarSystem() would cause a ConcurrentModificationException.
| system |
| void com.fs.starfarer.api.campaign.SectorAPI.removeTransientScript | ( | EveryFrameScript | script | ) |
| void com.fs.starfarer.api.campaign.SectorAPI.removeTransientScriptsOfClass | ( | Class | c | ) |
| void com.fs.starfarer.api.campaign.SectorAPI.reportBattleFinished | ( | CampaignFleetAPI | primaryWinner, |
| BattleAPI | battle ) |
Called after an autoresolve round that finishes a battle, after reportBattleOccurred. Also called after a player battle occurred.
Fleets and their compositons snapshotted right before the autoresolve round.
| battle | |
| primaryWinner |
| void com.fs.starfarer.api.campaign.SectorAPI.reportBattleOccurred | ( | CampaignFleetAPI | primaryWinner, |
| BattleAPI | battle ) |
Called once per each autoresolve round of the battle. Also called after a player battle occurred.
Fleets and their compositons snapshotted right before the autoresolve round.
| battle | |
| primaryWinner |
| void com.fs.starfarer.api.campaign.SectorAPI.reportEconomyMonthEnd | ( | ) |
| void com.fs.starfarer.api.campaign.SectorAPI.reportEconomyTick | ( | int | iterIndex | ) |
| void com.fs.starfarer.api.campaign.SectorAPI.reportEncounterLootGenerated | ( | FleetEncounterContextPlugin | plugin, |
| CargoAPI | loot ) |
| void com.fs.starfarer.api.campaign.SectorAPI.reportEventStage | ( | CampaignEventPlugin | event, |
| String | stage, | ||
| MessagePriority | priority ) |
Does nothing. Replaced with getIntelManager().
| void com.fs.starfarer.api.campaign.SectorAPI.reportEventStage | ( | CampaignEventPlugin | event, |
| String | stage, | ||
| SectorEntityToken | sendFrom, | ||
| MessagePriority | priority ) |
Does nothing. Replaced with getIntelManager().
| void com.fs.starfarer.api.campaign.SectorAPI.reportEventStage | ( | CampaignEventPlugin | event, |
| String | stage, | ||
| SectorEntityToken | sendFrom, | ||
| MessagePriority | priority, | ||
| OnMessageDeliveryScript | onDelivery ) |
Does nothing. Replaced with getIntelManager().
| void com.fs.starfarer.api.campaign.SectorAPI.reportFleetDespawned | ( | CampaignFleetAPI | fleet, |
| FleetDespawnReason | reason, | ||
| Object | param ) |
| void com.fs.starfarer.api.campaign.SectorAPI.reportFleetJumped | ( | CampaignFleetAPI | fleet, |
| SectorEntityToken | from, | ||
| JumpDestination | to ) |
| void com.fs.starfarer.api.campaign.SectorAPI.reportFleetReachedEntity | ( | CampaignFleetAPI | fleet, |
| SectorEntityToken | entity ) |
| void com.fs.starfarer.api.campaign.SectorAPI.reportPlayerActivatedAbility | ( | AbilityPlugin | ability, |
| Object | param ) |
| void com.fs.starfarer.api.campaign.SectorAPI.reportPlayerClosedMarket | ( | MarketAPI | market | ) |
| void com.fs.starfarer.api.campaign.SectorAPI.reportPlayerDeactivatedAbility | ( | AbilityPlugin | ability, |
| Object | param ) |
| void com.fs.starfarer.api.campaign.SectorAPI.reportPlayerDidNotTakeCargo | ( | CargoAPI | cargo | ) |
| void com.fs.starfarer.api.campaign.SectorAPI.reportPlayerDumpedCargo | ( | CargoAPI | cargo | ) |
| void com.fs.starfarer.api.campaign.SectorAPI.reportPlayerEngagement | ( | EngagementResultAPI | result | ) |
| void com.fs.starfarer.api.campaign.SectorAPI.reportPlayerMarketTransaction | ( | PlayerMarketTransaction | transaction | ) |
| void com.fs.starfarer.api.campaign.SectorAPI.reportPlayerOpenedMarket | ( | MarketAPI | market | ) |
Player opened the core UI while interacting with an entity that has a market.
| market |
| void com.fs.starfarer.api.campaign.SectorAPI.reportPlayerOpenedMarketAndCargoUpdated | ( | MarketAPI | market | ) |
| void com.fs.starfarer.api.campaign.SectorAPI.reportPlayerReputationChange | ( | PersonAPI | person, |
| float | delta ) |
| void com.fs.starfarer.api.campaign.SectorAPI.reportPlayerReputationChange | ( | String | faction, |
| float | delta ) |
| void com.fs.starfarer.api.campaign.SectorAPI.reportShowInteractionDialog | ( | InteractionDialogAPI | dialog | ) |
Shouldn't have to call this as the relevant showInteractionDialog() methods already do.
| dialog |
| void com.fs.starfarer.api.campaign.SectorAPI.setCurrentLocation | ( | LocationAPI | location | ) |
| void com.fs.starfarer.api.campaign.SectorAPI.setCurrentlyOpenMarket | ( | MarketAPI | currentlyOpenMarket | ) |
| void com.fs.starfarer.api.campaign.SectorAPI.setDifficulty | ( | String | difficulty | ) |
| void com.fs.starfarer.api.campaign.SectorAPI.setFastForwardIteration | ( | boolean | isFastForwardIteration | ) |
| void com.fs.starfarer.api.campaign.SectorAPI.setInFastAdvance | ( | boolean | isInNewGameAdvance | ) |
| void com.fs.starfarer.api.campaign.SectorAPI.setInNewGameAdvance | ( | boolean | isInNewGameAdvance | ) |
| void com.fs.starfarer.api.campaign.SectorAPI.setInSectorGen | ( | boolean | isInSectorGen | ) |
| void com.fs.starfarer.api.campaign.SectorAPI.setLastPlayerBattleTimestamp | ( | long | lastPlayerBattleTimestamp | ) |
| void com.fs.starfarer.api.campaign.SectorAPI.setLastPlayerBattleWon | ( | boolean | lastPlayerBattleWon | ) |
| void com.fs.starfarer.api.campaign.SectorAPI.setPaused | ( | boolean | paused | ) |
| void com.fs.starfarer.api.campaign.SectorAPI.setPlayerBattleSeed | ( | long | nextPlayerBattleSeed | ) |
| void com.fs.starfarer.api.campaign.SectorAPI.setPlayerFleet | ( | CampaignFleetAPI | playerFleet | ) |
| void com.fs.starfarer.api.campaign.SectorAPI.setRespawnLocation | ( | LocationAPI | respawnLocation | ) |
| void com.fs.starfarer.api.campaign.SectorAPI.setSeedString | ( | String | seedString | ) |
| void com.fs.starfarer.api.campaign.SectorAPI.unregisterPlugin | ( | String | pluginId | ) |