Warehouse#

Warehouse gives control over the warehouses associated with airbase objects. A warehouse limits which aircraft, munitions, and fuel are actually available to coalition aircraft operating from that airbase. Warehouse does not extend any other class documented here (the wiki notes a possible relationship to Airbase, but does not document it further).

class Warehouse#

Static functions#

static getByName(name)#

Returns the Warehouse associated with the airbase of the given name.

Parameters:

name (string) – Airbase name.

Returns:

The matching warehouse.

Return type:

Warehouse

static getResourceMap()#

Returns a table mapping resource (item/liquid) type names to their display names.

Returns:

Resource map.

Return type:

table

static getCargoAsWarehouse(cargoStaticObject)#

Returns the Warehouse view of a cargo-type static object, if applicable.

Parameters:

cargoStaticObject (StaticObject) – A cargo-type StaticObject.

Returns:

The corresponding warehouse.

Return type:

Warehouse

Member functions#

addItem(itemName, count)#

Adds count of the named item (e.g. a weapon or aircraft type) to the warehouse’s inventory.

Parameters:
  • itemName (string) – Item type name.

  • count (number) – Quantity to add.

getItemCount(itemName)#

Returns the current quantity of the named item in the warehouse.

Parameters:

itemName (string) – Item type name.

Returns:

Current quantity.

Return type:

number

setItem(itemName, count)#

Sets the quantity of the named item in the warehouse, overriding the current value.

Parameters:
  • itemName (string) – Item type name.

  • count (number) – New quantity.

removeItem(itemName, count)#

Removes count of the named item from the warehouse’s inventory.

Note

Not to be confused with missionCommands.removeItem, an unrelated function on a different singleton.

Parameters:
  • itemName (string) – Item type name.

  • count (number) – Quantity to remove.

addLiquid(liquidType, amount)#

Adds amount of the given liquid type (see liquid type table) to the warehouse.

Parameters:
  • liquidType (number) – Liquid type.

  • amount (number) – Amount to add, in liters.

getLiquidAmount(liquidType)#

Returns the current amount of the given liquid type in the warehouse.

Parameters:

liquidType (number) – Liquid type.

Returns:

Current amount, in liters.

Return type:

number

setLiquidAmount(liquidType, amount)#

Sets the amount of the given liquid type in the warehouse, overriding the current value.

Parameters:
  • liquidType (number) – Liquid type.

  • amount (number) – New amount, in liters.

removeLiquid(liquidType, amount)#

Removes amount of the given liquid type from the warehouse.

Parameters:
  • liquidType (number) – Liquid type.

  • amount (number) – Amount to remove, in liters.

getOwner()#

Returns the Airbase that owns this warehouse.

Returns:

The owning airbase.

Return type:

Airbase

getInventory(itemNameFilter)#

Returns the warehouse’s full inventory, optionally filtered to item names matching itemNameFilter.

Parameters:

itemNameFilter (string) – Optional item name (or pattern) to filter by.

Returns:

Inventory table.

Return type:

table

Enumerators#

Liquid type IDs used by the liquid-related member functions above:

Value

Meaning

0

Jet fuel

1

Aviation gasoline

2

MW50 (water/methanol)

3

Diesel

Footnotes#

  • A warehouse is typically obtained via Airbase.getWarehouse() rather than Warehouse.getByName directly.

  • Warehouse was added in DCS 2.8.8, considerably later than most other classes in the SSE.