Collectable wares
A Collectable wares is a floating ware pickup — dropped cargo containers from destroyed transports, asteroid shards from mining, or scattered loot from raids. The most common collectable subtype.
Inheritance: component → destructible → object → drop → collectable → collectablewares.
Properties
Section titled “Properties”Collectable-wares-specific
Section titled “Collectable-wares-specific”| Property | Type | Description |
|---|---|---|
.money | money | Contained money (drops can carry credits too) |
.unbundle | bool | Crate is flagged for converting its wares into ammo/units on pickup |
.isdroppedcontainer | bool | True if this is a dropped container (not an asteroid shard or other natural collectable) |
Useful inherited
Section titled “Useful inherited”| Property | Source | Description |
|---|---|---|
.cargo | container (indirect) | Wares inside — see container chain |
.sector / .position | object | Location |
.macro | component | Macro variant |
Common patterns
Section titled “Common patterns””Distinguish dropped containers from asteroid shards”
Section titled “”Distinguish dropped containers from asteroid shards””Pattern from vanilla notifications.xml:335, 402:
<do_if value="event.param3.isclass.collectablewares and event.param3.isdroppedcontainer"> <!-- dropped container — credit to source faction --></do_if>Vanilla uses this to attribute ware drops to the destroyed ship’s owner; asteroid shards are ownerless.
”Find asteroid shards (mining output) in a sector”
Section titled “”Find asteroid shards (mining output) in a sector””Pattern from vanilla scenario_advanced.xml:1565-1570:
<find_object groupname="$asteroidshards" class="[class.collectablewares]" space="$ResourceSector" multiple="true" append="true"/>
<do_for_each name="$shard" in="$asteroidshards"> <do_if value="not $shard.isdroppedcontainer"> <!-- this is an asteroid shard, not a dropped container --> </do_if></do_for_each>“Canonical multi-class loot filter”
Section titled ““Canonical multi-class loot filter””<do_if value="$ItemHolder.isclass.[class.lockbox, class.collectablewares, class.crate]"> <!-- any ware-bearing loot the player can pick up --></do_if>Pattern from gm_bringitems.xml:391, 1811, 1827. Use this when your mod accepts loot from any kind of holder.
Events
Section titled “Events”| Event | When | Notes |
|---|---|---|
event_object_destroyed | Picked up | Standard |
Common gotchas
Section titled “Common gotchas”- ⚠
.isdroppedcontainervsnot .isdroppedcontainer. The first identifies player-attributed loot (someone’s container was destroyed). The second identifies natural / unattributed (asteroid mining output). Mods that handle ownership / faction reputation need this distinction. - ⚠
.unbundle=truetriggers ware → ammo/unit conversion on pickup. Most ware-pickups stay as wares; this special flag converts contents to ammo or units automatically. Read before assuming “wares in = wares out”. - ⚠
.moneyexists on this datatype. A ware collectable can carry credits directly, not just wares. Sum both for total value. - ⚠
class.collectablewaresis the loot-filter pivot. Vanilla’s “find any pickup-able ware-bearing object” idiom always includes this class. - ⚠ Asteroid shards don’t have owners.
.ownerreturnsfaction.ownerlessfor mining shards. Don’t expect attribution.
Related
Section titled “Related”- Collectable — parent.
- Lockbox — sibling loot container (different mechanic — shootable locks).
- Crate — sibling interior container (dock-slot based).
- Asteroid — what mining-derived shards come from.
- Ware — what’s inside.
- Ship — what dropped them (for
.isdroppedcontainer=true).