VirtualStorage
Description
VirtualStorage adds barrels and tents whose inventories are saved in separate files while closed. It is useful for servers with large storage inventories: closing a container saves its contents and removes the contained entities after a successful write; opening it recreates the saved items.
Use the container's open and close interactions. Wait for loading to finish before moving items or closing it again. Virtual containers cannot be stored inside one another. Barrel kits place the corresponding barrel and are consumed during placement; tents use their normal deployment and packing actions.
Inventory data is stored under $mission:storage_<instanceId>/AC/VirtualStorage/<class>/<persistentID>.json, with a lowercase class directory and the container's persistent identifier. Preserve these files together with the mission's entity data when backing up or migrating the server. Deleting a container can also delete its saved inventory file.
Configuration
Default configuration
VirtualStorage.json
{
"m_Enable": 0,
"m_Logging": 1,
"m_AutoClose": 0,
"m_CloseRadius": 10,
"m_AsyncLoading": 0,
"m_EnableDismantle": 0,
"m_DeleteCloned": 0,
"m_IgnoreItems": []
}Options
| Option | Type | Description |
|---|---|---|
m_Enable | bool | With 1, enables virtual storage and its opening actions. With 0, disables these opening actions and saving/loading through container open and close operations. |
m_Logging | bool | With 1, records player open and close actions, including the container class and identifier. With 0, disables those action records. |
m_AutoClose | bool | For barrels: with 1, closes the barrel after the last player leaves the configured presence area; with 0, disables this automatic closing. |
m_CloseRadius | int | Player-presence radius for barrel automatic closing, in metres. Clamped to between 5 and 20 when settings are loaded. |
m_AsyncLoading | bool | For barrels: with 1, recreates saved inventory entries progressively, about 100 milliseconds apart; with 0, restores them in one pass. Closing is blocked during progressive loading. |
m_EnableDismantle | bool | For barrels: with 1, allows dismantling into the corresponding kit when the barrel is closed, empty and marked as available to take; with 0, disables dismantling. |
m_DeleteCloned | bool | With 1, also deletes duplicate containers identified during the initial storage-loading phase by a repeated persistent identifier; with 0, logs the detected duplicate without deleting it. |
m_IgnoreItems | array<string> | Exact item class names refused when receiving items into container cargo. The check compares the complete name, without inheritance matching. Use [] for no additional class exclusions. |
Automatic closing, m_CloseRadius, progressive loading and dismantling into kits apply to barrels. Tents restore their inventories in one pass and use native packing conditions: they must be open, empty and have no recorded inventory-loading failure, as well as satisfy the game's normal packing checks.
Barrels with saved contents cannot be taken into hands or placed in cargo. Empty the barrel and close it so its stored item count is updated before attempting to move or dismantle it. Virtual barrels cannot be pierced to make fire barrels.
With m_DeleteCloned=1, detected duplicate objects are permanently deleted. Back up the container files and mission data before enabling it. Remove stored contents before disabling the module so they remain accessible.
If a saved inventory cannot be read or an item cannot be recreated, preserve the saved file and check that the required item classes and mods are available before further container operations. Ruining a closed container attempts to restore its valid saved contents onto the ground; it is not a substitute for a backup.
Types
The barrel variants provide 100, 250 or 500 cargo slots in green, blue, red and yellow, with a matching placement kit for each variant. Medium tents provide 300 slots; large tents provide 500 or 750; car tents provide 500 or 1000. The virtual tents do not provide attachment slots.
The XML includes the usable containers and barrel kits. Container capacity is defined by the item class; there is no capacity field in VirtualStorage.json.
types.xml
<type name="AC_VirtualStorage_BarrelGreen_100">
<lifetime>3888000</lifetime>
<flags count_in_cargo="0" count_in_hoarder="0" count_in_map="1" count_in_player="0" crafted="0" deloot="0"/>
</type>
<type name="AC_VirtualStorage_BarrelGreen_250">
<lifetime>3888000</lifetime>
<flags count_in_cargo="0" count_in_hoarder="0" count_in_map="1" count_in_player="0" crafted="0" deloot="0"/>
</type>
<type name="AC_VirtualStorage_BarrelGreen_500">
<lifetime>3888000</lifetime>
<flags count_in_cargo="0" count_in_hoarder="0" count_in_map="1" count_in_player="0" crafted="0" deloot="0"/>
</type>
<type name="AC_VirtualStorage_BarrelBlue_100">
<lifetime>3888000</lifetime>
<flags count_in_cargo="0" count_in_hoarder="0" count_in_map="1" count_in_player="0" crafted="0" deloot="0"/>
</type>
<type name="AC_VirtualStorage_BarrelBlue_250">
<lifetime>3888000</lifetime>
<flags count_in_cargo="0" count_in_hoarder="0" count_in_map="1" count_in_player="0" crafted="0" deloot="0"/>
</type>
<type name="AC_VirtualStorage_BarrelBlue_500">
<lifetime>3888000</lifetime>
<flags count_in_cargo="0" count_in_hoarder="0" count_in_map="1" count_in_player="0" crafted="0" deloot="0"/>
</type>
<type name="AC_VirtualStorage_BarrelRed_100">
<lifetime>3888000</lifetime>
<flags count_in_cargo="0" count_in_hoarder="0" count_in_map="1" count_in_player="0" crafted="0" deloot="0"/>
</type>
<type name="AC_VirtualStorage_BarrelRed_250">
<lifetime>3888000</lifetime>
<flags count_in_cargo="0" count_in_hoarder="0" count_in_map="1" count_in_player="0" crafted="0" deloot="0"/>
</type>
<type name="AC_VirtualStorage_BarrelRed_500">
<lifetime>3888000</lifetime>
<flags count_in_cargo="0" count_in_hoarder="0" count_in_map="1" count_in_player="0" crafted="0" deloot="0"/>
</type>
<type name="AC_VirtualStorage_BarrelYellow_100">
<lifetime>3888000</lifetime>
<flags count_in_cargo="0" count_in_hoarder="0" count_in_map="1" count_in_player="0" crafted="0" deloot="0"/>
</type>
<type name="AC_VirtualStorage_BarrelYellow_250">
<lifetime>3888000</lifetime>
<flags count_in_cargo="0" count_in_hoarder="0" count_in_map="1" count_in_player="0" crafted="0" deloot="0"/>
</type>
<type name="AC_VirtualStorage_BarrelYellow_500">
<lifetime>3888000</lifetime>
<flags count_in_cargo="0" count_in_hoarder="0" count_in_map="1" count_in_player="0" crafted="0" deloot="0"/>
</type>
<type name="AC_VirtualStorage_MediumTent_300">
<lifetime>3888000</lifetime>
<flags count_in_cargo="0" count_in_hoarder="0" count_in_map="1" count_in_player="0" crafted="0" deloot="0"/>
</type>
<type name="AC_VirtualStorage_MediumTentGreen_300">
<lifetime>3888000</lifetime>
<flags count_in_cargo="0" count_in_hoarder="0" count_in_map="1" count_in_player="0" crafted="0" deloot="0"/>
</type>
<type name="AC_VirtualStorage_MediumTentOrange_300">
<lifetime>3888000</lifetime>
<flags count_in_cargo="0" count_in_hoarder="0" count_in_map="1" count_in_player="0" crafted="0" deloot="0"/>
</type>
<type name="AC_VirtualStorage_LargeTent_500">
<lifetime>3888000</lifetime>
<flags count_in_cargo="0" count_in_hoarder="0" count_in_map="1" count_in_player="0" crafted="0" deloot="0"/>
</type>
<type name="AC_VirtualStorage_LargeTent_750">
<lifetime>3888000</lifetime>
<flags count_in_cargo="0" count_in_hoarder="0" count_in_map="1" count_in_player="0" crafted="0" deloot="0"/>
</type>
<type name="AC_VirtualStorage_CarTent_500">
<lifetime>3888000</lifetime>
<flags count_in_cargo="0" count_in_hoarder="0" count_in_map="1" count_in_player="0" crafted="0" deloot="0"/>
</type>
<type name="AC_VirtualStorage_CarTent_1000">
<lifetime>3888000</lifetime>
<flags count_in_cargo="0" count_in_hoarder="0" count_in_map="1" count_in_player="0" crafted="0" deloot="0"/>
</type>
<type name="AC_VirtualStorage_BarrelGreen_100_Kit">
<lifetime>7200</lifetime>
<flags count_in_cargo="0" count_in_hoarder="0" count_in_map="1" count_in_player="0" crafted="0" deloot="0"/>
</type>
<type name="AC_VirtualStorage_BarrelGreen_250_Kit">
<lifetime>7200</lifetime>
<flags count_in_cargo="0" count_in_hoarder="0" count_in_map="1" count_in_player="0" crafted="0" deloot="0"/>
</type>
<type name="AC_VirtualStorage_BarrelGreen_500_Kit">
<lifetime>7200</lifetime>
<flags count_in_cargo="0" count_in_hoarder="0" count_in_map="1" count_in_player="0" crafted="0" deloot="0"/>
</type>
<type name="AC_VirtualStorage_BarrelBlue_100_Kit">
<lifetime>7200</lifetime>
<flags count_in_cargo="0" count_in_hoarder="0" count_in_map="1" count_in_player="0" crafted="0" deloot="0"/>
</type>
<type name="AC_VirtualStorage_BarrelBlue_250_Kit">
<lifetime>7200</lifetime>
<flags count_in_cargo="0" count_in_hoarder="0" count_in_map="1" count_in_player="0" crafted="0" deloot="0"/>
</type>
<type name="AC_VirtualStorage_BarrelBlue_500_Kit">
<lifetime>7200</lifetime>
<flags count_in_cargo="0" count_in_hoarder="0" count_in_map="1" count_in_player="0" crafted="0" deloot="0"/>
</type>
<type name="AC_VirtualStorage_BarrelRed_100_Kit">
<lifetime>7200</lifetime>
<flags count_in_cargo="0" count_in_hoarder="0" count_in_map="1" count_in_player="0" crafted="0" deloot="0"/>
</type>
<type name="AC_VirtualStorage_BarrelRed_250_Kit">
<lifetime>7200</lifetime>
<flags count_in_cargo="0" count_in_hoarder="0" count_in_map="1" count_in_player="0" crafted="0" deloot="0"/>
</type>
<type name="AC_VirtualStorage_BarrelRed_500_Kit">
<lifetime>7200</lifetime>
<flags count_in_cargo="0" count_in_hoarder="0" count_in_map="1" count_in_player="0" crafted="0" deloot="0"/>
</type>
<type name="AC_VirtualStorage_BarrelYellow_100_Kit">
<lifetime>7200</lifetime>
<flags count_in_cargo="0" count_in_hoarder="0" count_in_map="1" count_in_player="0" crafted="0" deloot="0"/>
</type>
<type name="AC_VirtualStorage_BarrelYellow_250_Kit">
<lifetime>7200</lifetime>
<flags count_in_cargo="0" count_in_hoarder="0" count_in_map="1" count_in_player="0" crafted="0" deloot="0"/>
</type>
<type name="AC_VirtualStorage_BarrelYellow_500_Kit">
<lifetime>7200</lifetime>
<flags count_in_cargo="0" count_in_hoarder="0" count_in_map="1" count_in_player="0" crafted="0" deloot="0"/>
</type>