Difference between revisions of "DCS func getCargoAsWarehouse"

From DCS World Wiki - Hoggitworld.com
(Created page with "{{Template:dcs_funcs |fName= getCargoAsWarehouse |vNum= 2.9.6 |par1= Warehouse |par2= |par3= |par4= |desc= Returns a warehouse object that exists...")
 
 
(One intermediate revision by the same user not shown)
(No difference)

Latest revision as of 01:21, 13 July 2024

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: