Skip to content

Collectable ammo

A Collectable ammo is an ammo pickup — typically spawned when an enemy ship is destroyed and had unfired missiles, drones, or mines on board. Player collects by flying over; the ammo macros are added to player.ship.ammostorage.{macro}.

Inheritance: component → destructible → object → drop → collectable → collectableammo.

PropertyTypeDescription
.ammo.countintHow many of this ammo are contained
.ammo.macromacroWhich ammo macro it is (macro.weapon_gen_mine_03_macro, macro.missile_arg_torpedo_01_macro, etc.)
PropertySourceDescription
.sector / .positionobjectLocation
.macrocomponentThe collectable’s own macro

”Filter player events for ammo pickups”

Section titled “”Filter player events for ammo pickups””

Vanilla tutorial_flight.xml:905:

<do_if value="event.param.{$i}.isclass.collectableammo
and event.param.{$i}.ammo.macro.isclass.missile">
<!-- a missile pickup -->
</do_if>

Used to detect “the player just picked up a missile” in tutorial flows.

”Spawn ammo loot from a defeated ship”

Section titled “”Spawn ammo loot from a defeated ship””

There’s no clean <create_collectableammo> action — engine spawns these automatically on ship destruction based on the destroyed ship’s ammostorage. To manually scatter ammo, use <create_object> with the appropriate collectable_ammo_* macro.

EventWhenNotes
event_object_destroyedPicked up by playerStandard destruction-as-collection
  • .ammo.macro is the contained ammo macro, NOT the collectable’s macro. $collectable.macro = the floating-box macro; $collectable.ammo.macro = the missile / drone / mine inside.
  • Picked-up ammo goes to ammostorage, not inventory. The collected ammo lands in player.ship.ammostorage.{macro}, same place as deployables.
  • NPC pickups are silent. NPCs don’t fire pickup events the way player does. Don’t expect symmetric handling.
  • .ammo.macro.isclass.X chains work. $col.ammo.macro.isclass.missile and .isclass.mine and .isclass.satellite all valid for branching.