DCS func getCargoAsWarehouse

From DCS World Wiki - Hoggitworld.com
Revision as of 01:05, 13 July 2024 by Grimes (talk | contribs)

Scripting Root

Envrioment: Mission Scripting
Function: getCargoAsWarehouse Added with: 2.9.6
Member Of: Warehouse
Syntax: class Warehouse.getCargoAsWarehouse(object StaticObject )
Description: Returns a warehouse object that exists within the passed Static Object cargo crate. Can be used to "physicalize" the contents of a cargo object to hold X warehouse inventory.


Return Value: class
Return Example:
Examples: The following will access a crate named "Static Ammo-2-1", access the warehouse within it, and set the inventory of GBU-31v1 to 20.
 local s = StaticObject.getByName("Static Ammo-2-1")
 local ware = Warehouse.getCargoAsWarehouse(s)
 ware:setItem("weapons.bombs.GBU_31", 20)
Related Functions:
Notes: