Starsector API
Loading...
Searching...
No Matches
com.fs.starfarer.api.mission.MissionDefinitionAPI Interface Reference

Public Member Functions

void initFleet (FleetSide side, String shipNamePrefix, FleetGoal goal, boolean useDefaultAI)
 
void initFleet (FleetSide side, String shipNamePrefix, FleetGoal goal, boolean useDefaultAI, int commandRating)
 
FleetMemberAPI addToFleet (FleetSide side, String variantId, FleetMemberType type, boolean isFlagship)
 
FleetMemberAPI addToFleet (FleetSide side, String variantId, FleetMemberType type, String shipName, boolean isFlagship)
 
void defeatOnShipLoss (String shipName)
 
void addBriefingItem (String item)
 
void setFleetTagline (FleetSide side, String tagline)
 
void initMap (float minX, float maxX, float minY, float maxY)
 
void addNebula (float x, float y, float radius)
 
void addObjective (float x, float y, String type, BattleObjectiveAPI.Importance importance)
 
void addObjective (float x, float y, String type)
 
void addPlanet (float x, float y, float radius, String type, float gravity)
 
void addPlanet (float x, float y, float radius, String type, float gravity, boolean backgroundPlanet)
 
void addPlanet (float x, float y, float radius, PlanetAPI planet, float gravity, boolean backgroundPlanet)
 
void setPlanetBgSize (float bgWidth, float bgHeight)
 
void addAsteroidField (float x, float y, float angle, float width, float minSpeed, float maxSpeed, int quantity)
 
void addRingAsteroids (float x, float y, float angle, float width, float minSpeed, float maxSpeed, int quantity)
 
int getFleetPointCost (String id)
 
void addPlugin (EveryFrameCombatPlugin plugin)
 
void setBackgroundSpriteName (String background)
 
void addFleetMember (FleetSide side, FleetMemberAPI member)
 
void setHyperspaceMode (boolean hyperspaceMode)
 
void setNebulaTex (String nebulaTex)
 
void setNebulaMapTex (String nebulaMapTex)
 
void setBackgroundGlowColor (Color backgroundGlowColor)
 
void initFleet (FleetSide side, String shipNamePrefix, FleetGoal goal, boolean useDefaultAI, int commandRating, int allyCommandRating)
 
BattleCreationContext getContext ()
 
PersonAPI getDefaultCommander (FleetSide side)
 
boolean hasNebula ()
 

Detailed Description

Used by the MissionDefinition.java script to create the contents of a mission.

Author
Alex Mosolov

Copyright 2012 Fractal Softworks, LLC

Definition at line 21 of file MissionDefinitionAPI.java.

Member Function Documentation

◆ addAsteroidField()

void com.fs.starfarer.api.mission.MissionDefinitionAPI.addAsteroidField ( float  x,
float  y,
float  angle,
float  width,
float  minSpeed,
float  maxSpeed,
int  quantity 
)

Add an asteroid field to the map. An asteroid field is a band of asteroids moving in a direction across the map.

Parameters
xx coordinate of any point along the middle of the belt.
yy coordinate of any point along the middle of the belt.
angledirection, with 0 being to the right and 90 being up.
widthwidth of belt in pixels.
minSpeedminimum speed of spawned asteroids.
maxSpeedmaximum speed of spawned asteroids.
quantityapproximate number of asteroids to keep in play as they're destroyed/move off map.

◆ addBriefingItem()

void com.fs.starfarer.api.mission.MissionDefinitionAPI.addBriefingItem ( String  item)

Adds a line to the bulleted list under "Tactical Objectives" in the mission description.

Parameters
itemText, with no leading dash.

◆ addFleetMember()

void com.fs.starfarer.api.mission.MissionDefinitionAPI.addFleetMember ( FleetSide  side,
FleetMemberAPI  member 
)

◆ addNebula()

void com.fs.starfarer.api.mission.MissionDefinitionAPI.addNebula ( float  x,
float  y,
float  radius 
)

Adds a circular nebula to the map. The shape is slightly randomized.

Parameters
x
y
radiusin pixels.

◆ addObjective() [1/2]

void com.fs.starfarer.api.mission.MissionDefinitionAPI.addObjective ( float  x,
float  y,
String  type 
)

Add a battlefield objective to the map.

Parameters
x
y
typeone of "comm_relay", "nav_buoy", or "sensor_array".

◆ addObjective() [2/2]

void com.fs.starfarer.api.mission.MissionDefinitionAPI.addObjective ( float  x,
float  y,
String  type,
BattleObjectiveAPI.Importance  importance 
)

Add a battlefield objective to the map.

Parameters
x
y
typeone of "comm_relay", "nav_buoy", or "sensor_array".
importance

◆ addPlanet() [1/3]

void com.fs.starfarer.api.mission.MissionDefinitionAPI.addPlanet ( float  x,
float  y,
float  radius,
PlanetAPI  planet,
float  gravity,
boolean  backgroundPlanet 
)

Bases the look of the planet on the PlanetAPI passed in. The look may have been altered dynamically using PlanetAPI.getSpec(), which would not be reflected by the planet's base type, as defined in planets.json.

Parameters
x
y
radius
planet
gravity
backgroundPlanet

◆ addPlanet() [2/3]

void com.fs.starfarer.api.mission.MissionDefinitionAPI.addPlanet ( float  x,
float  y,
float  radius,
String  type,
float  gravity 
)

Add a planet or star to the map.

Parameters
x
y
radius
typeavailable types are defined in data/config/planets.json
gravityEqual to maximum speed boost the planet provides to nearby ships.

◆ addPlanet() [3/3]

void com.fs.starfarer.api.mission.MissionDefinitionAPI.addPlanet ( float  x,
float  y,
float  radius,
String  type,
float  gravity,
boolean  backgroundPlanet 
)

Add a planet or star to the map.

Parameters
x
y
radius
typeavailable types are defined in data/config/planets.json
gravityEqual to maximum speed boost the planet provides to nearby ships.
backgroundPlanetIf true, planet is in the "background" and doesn't exert gravity or move relative to the viewport. x and y are then screen coordinates.

◆ addPlugin()

void com.fs.starfarer.api.mission.MissionDefinitionAPI.addPlugin ( EveryFrameCombatPlugin  plugin)

◆ addRingAsteroids()

void com.fs.starfarer.api.mission.MissionDefinitionAPI.addRingAsteroids ( float  x,
float  y,
float  angle,
float  width,
float  minSpeed,
float  maxSpeed,
int  quantity 
)

◆ addToFleet() [1/2]

FleetMemberAPI com.fs.starfarer.api.mission.MissionDefinitionAPI.addToFleet ( FleetSide  side,
String  variantId,
FleetMemberType  type,
boolean  isFlagship 
)

Add a ship variant to a fleet. The variant ID refers to one of the variants found in data/variants and data/variants/fighters.

Parameters
side
variantId
type
isFlagshipSet to true for the player's ship, false otherwise.

◆ addToFleet() [2/2]

FleetMemberAPI com.fs.starfarer.api.mission.MissionDefinitionAPI.addToFleet ( FleetSide  side,
String  variantId,
FleetMemberType  type,
String  shipName,
boolean  isFlagship 
)

Same as the other addToFleet method, except you can specify the ship's name.

Parameters
side
variantId
type
shipNameFull ship name, including prefix.
isFlagshipSet to true for the player's ship, false otherwise.

◆ defeatOnShipLoss()

void com.fs.starfarer.api.mission.MissionDefinitionAPI.defeatOnShipLoss ( String  shipName)

Indicates that losing the named ship causes immediate defeat for that side. Ship must have been added with an explicit name.

Parameters
shipName

◆ getContext()

BattleCreationContext com.fs.starfarer.api.mission.MissionDefinitionAPI.getContext ( )

◆ getDefaultCommander()

PersonAPI com.fs.starfarer.api.mission.MissionDefinitionAPI.getDefaultCommander ( FleetSide  side)

◆ getFleetPointCost()

int com.fs.starfarer.api.mission.MissionDefinitionAPI.getFleetPointCost ( String  id)

Returns the fleet point cost of a fighter wing or ship variant.

Parameters
id
Returns

◆ hasNebula()

boolean com.fs.starfarer.api.mission.MissionDefinitionAPI.hasNebula ( )

◆ initFleet() [1/3]

void com.fs.starfarer.api.mission.MissionDefinitionAPI.initFleet ( FleetSide  side,
String  shipNamePrefix,
FleetGoal  goal,
boolean  useDefaultAI 
)

Set various parameters for a fleet. Must be called once each for FleetSide.PLAYER and FleetSide.ENEMY. Must be called before any ships are added to the fleet.

Parameters
side
shipNamePrefixPrepended to any randomly picked ship names. "ISS", "HSS", etc.
goal
useDefaultAIFor now, set true for side = ENEMY and false for side = PLAYER. Later, may supply custom AI.

◆ initFleet() [2/3]

void com.fs.starfarer.api.mission.MissionDefinitionAPI.initFleet ( FleetSide  side,
String  shipNamePrefix,
FleetGoal  goal,
boolean  useDefaultAI,
int  commandRating 
)

Set various parameters for a fleet. Must be called once each for FleetSide.PLAYER and FleetSide.ENEMY. Must be called before any ships are added to the fleet.

Parameters
side
shipNamePrefixPrepended to any randomly picked ship names. "ISS", "HSS", etc.
goal
useDefaultAIFor now, set true for side = ENEMY and false for side = PLAYER. Later, may supply custom AI.
commandRatingAdded to the pool of available command points.

◆ initFleet() [3/3]

void com.fs.starfarer.api.mission.MissionDefinitionAPI.initFleet ( FleetSide  side,
String  shipNamePrefix,
FleetGoal  goal,
boolean  useDefaultAI,
int  commandRating,
int  allyCommandRating 
)

◆ initMap()

void com.fs.starfarer.api.mission.MissionDefinitionAPI.initMap ( float  minX,
float  maxX,
float  minY,
float  maxY 
)

Initialize map with the given size. By convention, 0,0 should be at the center. In other words, -minX = maxX and -minY = maxY.

Parameters
minXin pixels.
maxXin pixels.
minYin pixels.
maxYin pixels.

◆ setBackgroundGlowColor()

void com.fs.starfarer.api.mission.MissionDefinitionAPI.setBackgroundGlowColor ( Color  backgroundGlowColor)

◆ setBackgroundSpriteName()

void com.fs.starfarer.api.mission.MissionDefinitionAPI.setBackgroundSpriteName ( String  background)

◆ setFleetTagline()

void com.fs.starfarer.api.mission.MissionDefinitionAPI.setFleetTagline ( FleetSide  side,
String  tagline 
)

Set a small blurb for the fleet that shows up on the mission detail and mission results screens to identify it.

Parameters
side
tagline

◆ setHyperspaceMode()

void com.fs.starfarer.api.mission.MissionDefinitionAPI.setHyperspaceMode ( boolean  hyperspaceMode)

Make the background animate the same way it does in hyperspace.

Parameters
hyperspaceMode

◆ setNebulaMapTex()

void com.fs.starfarer.api.mission.MissionDefinitionAPI.setNebulaMapTex ( String  nebulaMapTex)

◆ setNebulaTex()

void com.fs.starfarer.api.mission.MissionDefinitionAPI.setNebulaTex ( String  nebulaTex)

◆ setPlanetBgSize()

void com.fs.starfarer.api.mission.MissionDefinitionAPI.setPlanetBgSize ( float  bgWidth,
float  bgHeight 
)

Background planets at 0,0 get rendered at the center of the screen when the view is at the center of the map.

The bgWidth and bgHeight determine how much off-center the planet moves at the edges of the map.

Parameters
bgWidth
bgHeight

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