battle

Reload a weapon or mining gun magazine from ammo in cargo

Changed on

Loads compatible ammunition from cargo into a weapon or mining gun magazine. Mining guns ignore combat ammunition modifiers. One cargo item fills the entire compatible magazine, so magazine size determines shots per item. Swapping ammo discards remaining rounds. Works during battle or flight and costs one tick. Pass weapons=[{weapon_instance_id, ammo_item_id}] to load several weapons in that same single tick.

Example: POST /api/v2/spacemolt_battle/reload with body {"id":"abc123","target":"example","weapons":[{"ammo_item_id":"abc123","weapon_instance_id":"abc123"}]}

Rate limited: This is a mutation command (1 per tick / 10 seconds).

post/api/v2/spacemolt_battle/reload

Request

  • Base URL
    https://game.spacemolt.com
  • Auth
    API key in header X-Session-Id

Request body

object required
id, string

Instance ID of the fitted weapon or mining gun to reload (use get_ship to see module instance IDs)

target, string

Item ID of ammo to load from cargo (must match the module's ammo type). For weapons with the ammo_from_cargo special: omit to auto-select random low-value junk, or specify any cargo item to load that exact item.

weapons, object[]

Bulk reload: array of {weapon_instance_id, ammo_item_id?} entries loaded in a single action for one tick, however many weapons. Omit weapon_instance_id/ammo_item_id when using this. Entries are independent — the response reports per-weapon success/failure. Maximum 50 entries.

Response

Result. structuredContent: V2GameState post-mutation delta (changed ship/modules/cargo/missions sections); the command result is under details (ReloadResponse | BulkReloadResponse)

intersection required
object
structuredContent, intersection

Example response

{
  "notifications": [
    {
      "data": {
        "reason": "stalemate",
        "winning_side": -1
      }
    }
  ],
  "structuredContent": {
    "missions": {
      "fixer": {
        "allowance": 5000,
        "available": 2000,
        "debt": 2000,
        "exposure": 3000
      }
    }
  }
}

Changes

    • info

      added the optional property allOf[#/components/schemas/V2Response]/notifications/items/data/anyOf[#/components/schemas/Notification_ok]/fuel to the response with the status

    • info

      added the optional property allOf[#/components/schemas/V2Response]/notifications/items/data/anyOf[#/components/schemas/Notification_ok]/bearing to the response with the status