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 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.
If an earlier build wrote to $profile:AC/Store/, back up that directory and the mission storage directory. Recover any active inventories from that build before returning to mission storage. A matching JSON in the mission directory may contain an older inventory for the same container.
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, writes inventory snapshots on close and enables configured automatic closing. With 0, stops writing new snapshots. Opening can still restore inventory that is already virtualized. |
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 | With 1, closes an open container once no players remain in its presence area. With 0, disables automatic closing. |
m_CloseRadius | int | Player-presence radius for automatic closing in metres. Clamped to between 5 and 20 when settings are loaded. |
m_AsyncLoading | bool | With 1, recreates saved inventory entries progressively, about 100 milliseconds apart. With 0, restores them in one pass. Closing and removing ordinary inventory items are blocked during progressive loading. |
m_EnableDismantle | bool | With 1, allows barrels and compatible custom containers to be dismantled into kits when closed, empty, unlocked, and available to take. With 0, disables kit 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. |
Barrels, virtual tents and custom containers share automatic closing and progressive restoration. Tents use the game’s normal packing action. A virtual tent must be open, empty and free of recorded inventory errors. Remove an attached lock before packing.
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.
When a save fails, physical items remain in the container. After restoring saved contents, the server keeps the JSON and records that the contents are already physical to avoid duplicating items on restart. If saved data conflicts with physical contents, the server keeps both and logs the conflict. If a closed container is ruined, the server attempts to restore its valid contents onto the ground.
VirtualStorage loads with the AC_Codelock addon. To install a lock, enable CodeLock and allow installation with m_Barrels.m_CanAttach for barrels and compatible custom containers, or m_Tents.m_CanAttach for tents. Install the lock while the container is closed. The installed lock, password, owner and access list remain with the container when the rest of the inventory is virtualized. A spare lock stored in cargo is saved like any other item.
For custom models, AC_VirtualStorage_Base extends DeployableContainer_Base. Set the animation names in ACVirtualStorageAnimations and supply one matching entry per animation in ACVirtualStorageClosedPhases and ACVirtualStorageOpenPhases. Provide the animations in the model and use ACVirtualStorageOpenSoundSet and ACVirtualStorageCloseSoundSet for optional sounds. Retain item class names across upgrades because saved files use them.
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. Virtual tents have a slot for an installed CodeLock.
The item class determines its cargo capacity. The XML includes the containers and their barrel kits.
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>Controls
| Control | Action |
|---|---|
| Open or close | Use the container’s normal interaction prompt. An attached CodeLock can require entering a password to open the container. |
| Pack a tent or dismantle into a kit | Use the applicable packing or dismantling action on an empty container after removing the attached lock. Virtual tents must be open. Kit dismantling requires a closed container and m_EnableDismantle=1. |
