Magic Campaign
A collection of methods to help do a variety of things on the campaign layer.
Functions
Link copied to clipboard
open fun addCustomPerson(market: MarketAPI, firstName: String, lastName: String, portraitId: String, gender: Gender, factionId: String, rankId: String, postId: String, isMarketAdmin: Boolean, industrialPlanning_level: Integer, commScreenPosition: Integer): PersonAPI
Adds a custom character to a given market
Link copied to clipboard
Link copied to clipboard
open fun addSalvage(cargo: CargoAPI, carrier: SectorEntityToken, type: MagicCampaign.lootType, lootID: String, amount: Int): CargoAPI
Adds items to a salvageable entity such as a debris field, a recoverable ship or a wreck.
Link copied to clipboard
open fun addSimpleMarket(entity: SectorEntityToken, id: String, name: String, size: Integer, faction: String, isFreeport: Boolean, isHidden: Boolean, conditions: List<String>, industries: List<String>, hasStorage: Boolean, paidForStorage: Boolean, hasBlackmarket: Boolean, hasOpenmarket: Boolean, hasMilitarymarket: Boolean, isAbandonedStation: Boolean): MarketAPI
Adds a simple custom market to a system entity
Link copied to clipboard
Creates a captain PersonAPI.
Link copied to clipboard
open fun createDebrisField(id: String, radius: Float, density: Float, duration: Float, glowDuration: Float, salvageXp: Integer, defenderProbability: Float, defenderFaction: String, defenderFP: Integer, detectionMult: Float, discoverable: Boolean, discoveryXp: Integer, orbitCenter: SectorEntityToken, orbitStartAngle: Float, orbitRadius: Float, orbitDays: Float): SectorEntityToken
Creates a debris field with generic commodity loot to salvage
Link copied to clipboard
open fun createDerelict(variantId: String, condition: ShipCondition, discoverable: Boolean, discoveryXp: Integer, recoverable: Boolean, orbitCenter: SectorEntityToken, orbitStartAngle: Float, orbitRadius: Float, orbitDays: Float): SectorEntityToken
open fun createDerelict(variantId: String, condition: ShipCondition, discoverable: Boolean, discoveryXp: Integer, recoverable: Boolean, orbitCenter: SectorEntityToken, orbitStartAngle: Float, orbitRadius: Float, orbitDays: Float, isRecoverable: Boolean): SectorEntityToken
Creates a derelict ship at the desired emplacement.
Link copied to clipboard
Creates a fleet with a defined flagship and optional escort.
Link copied to clipboard
open fun findSuitableTarget(entityIDs: List<String>, marketFactions: List<String>, distance: String, seek_themes: List<String>, avoid_themes: List<String>, entities: List<String>, defaultToAnyEntity: Boolean, prioritizeUnexplored: Boolean, verbose: Boolean): SectorEntityToken
Returns a random target SectorEntityToken given the following parameters:
Link copied to clipboard
Removes hyperspace clouds around the system, up to the outer-most jump point radius
Link copied to clipboard
open fun isAvailableToPlayer(player_minLevel: Int, min_days_elapsed: Int, min_fleet_size: Int, memKeys_all: Map<String, Boolean>, memKeys_any: Map<String, Boolean>, memKeys_none: Map<String, Boolean>, playerRelationship_atLeast: Map<String, Float>, playerRelationship_atMost: Map<String, Float>): Boolean
Link copied to clipboard
Creates a ship variant from a regular variant file.
Link copied to clipboard
Place an object on a stable orbit similar to the most approaching existing one that can be found
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun spawnFleet(fleet: CampaignFleetAPI, spawnLocation: SectorEntityToken, assignment: FleetAssignment, target: SectorEntityToken, isImportant: Boolean, transponderOn: Boolean, verbose: Boolean)
Spawn a fleet in its intended location with the proper order and target