Fleet API
Fleet provides member management and command dispatch.
Reference
getId()Returns the numeric fleet ID.getFaction()Returns theFactionthis fleet belongs to.getName()Returns the fleet’s display name.getSector()Returns the fleet’s current sector asLuaVec3i.getFlagship()Returns the flagship as aRemoteEntity.getMembers()Returns all fleet members asRemoteEntity[].addMember(entity: RemoteEntity)Addsentityto this fleet.removeMember(entity: RemoteEntity)Removesentityfrom this fleet.getCurrentCommand()Returns the activeFleetCommandpayload.setCurrentCommand(command: String, ...)Sends a raw command by enum name with optional extra arguments. Only client-accessible StarMade fleet enums are accepted. Internal-only enums are rejected. Typed command methods below are preferred.
Expected argument shapes for the most useful raw commands:
MOVE_FLEET(command, sector)expectssector: LuaVec3i.PATROL_FLEET(command, sectors)expectssectors: LuaVec3i[].FLEET_ATTACK(command, sector)expectssector: LuaVec3i.FLEET_DEFEND(command, sector)expectssector: LuaVec3i.ACTIVATE_REMOTE(command, remoteId, enabled)expectsremoteId: Stringandenabled: Boolean.Most other client-accessible fleet commands take no extra arguments.
See FleetCommand for the full upstream enum and argument signature table.
Movement commands
moveToSector(sector: LuaVec3i)Move the entire fleet tosector.patrolSectors(sectors: LuaVec3i[])Patrol between a list of at least 2 sector coordinates in order.attackSector(sector: LuaVec3i)Move tosectorand engage enemy ships on arrival.defendSector(sector: LuaVec3i)Move tosectorand engage enemies within proximity.
Tactical commands
escort()Follow the flagship and attack nearby enemies.repair()Disengage and begin fleet repairs.idle()Stop all movement and combat actions.
Notes
setCurrentCommandaccepts these upstream enum names:IDLE,MOVE_FLEET,PATROL_FLEET,TRADE_FLEET_WAITING,FLEET_ATTACK,FLEET_DEFEND,ESCORT,REPAIR,STANDOFF,SENTRY_FORMATION,SENTRY,FLEET_IDLE_FORMATION,CALL_TO_CARRIER,MINE_IN_SECTOR,CLOAK,UNCLOAK,JAM,UNJAM,ACTIVATE_REMOTE,INTERDICT,STOP_INTERDICT.Internal-only StarMade enums are rejected by
setCurrentCommand:TRADE_FLEET_NPC,TRADE_FLEET_ACTIVE.Typed movement methods (
moveToSector, etc.) are preferred oversetCurrentCommandfor clarity and safety.