Page 1 of 1

Add cargo container with items

Posted: Sun May 18, 2025 7:54 pm
by patpatpowercat
Is there a way to add a cargo container to a unit, but with items already inside of the container? I know you can use the ScenEdit_UpdateUnitCargo to add for example a 40ft ISO container, but is there a way to add a container that already has some ordinance inside of it?

Re: Add cargo container with items

Posted: Mon May 19, 2025 2:09 pm
by BDukes
local am= ScenEdit_GetUnit({guid='NLBN1G-0HNCMOSSC5K9S'})
--print(am.cargo)
--createUnitCargo(type #, ID) 4 type is container, 2 is 20ft Container
local loadcontainer = am : createUnitCargo(4,2)
loadcontainer :createContainerContentAmmunition(686,100)

Re: Add cargo container with items

Posted: Fri May 23, 2025 11:43 pm
by patpatpowercat
Awesome thank you!