Creating storage containers - Global-Conflicts-ArmA/gc-reforger-missions GitHub Wiki

Limited number of items

Crate

  1. Go to ArmaReforger/PrefabsEditable/Auto/Props/Military/AmmoBoxes/{SOME_FACTION}/ and drag in one of these crates.

[!WARNING] Do not use an arsenal crate in this case, because these have additional functionality that can cause replication issues when disabled incorrectly.

Only use arsenals when you want to give players free access to a category of items, either unlimited or limited by shared supplies.

  1. Go to its object properties, in the top you will see components, some are disabled by default. Enable SCR_SoundDataComponent, RplComponent, ActionsManagerComponent and SCR_UniversalInventoryStorageComponent.
  2. Go into the SCR_UniversalInventoryStorageComponent, and click the + symbol next to "Multi Slots".
  3. Click "set class" and choose "InventoryStorageSlot", give the entry some name such as item1.
  4. In the new menu that appears, half way down you'll see "Prefab" with a field that says none and three little dots to the right. Click these dots and locate the item prefab you want to add. For example, if you wanted an RGD5 hand-grenade, you would select ArmaReforger/Prefabs/Weapons/Grenades/Grenade_RGD5.et.
  5. Adjust the quantity of the item by editing the "Num slots" attribute in the bottom of the inventoty slot entry.

image

Vehicle

Vehicles usually already have the components set up, so you only need to add multi slots to their existing SCR_UniversalInventoryStorageComponent.

Unlimited number of items

If you want to give players unlimited access to selection of items, or free choice capped only by a shared "supplies" amount, you would use an Arsenal.

  1. Drag in an arsenal prefab, they are found in ArmaReforger/Prefabs/Props/Military/Arsenal/. You can choose of several box variants which already come preconfigured to only have certain item types.
  2. If required, you can further adjust which item types can be taken in its SCR_ArsenalComponent.

Most arsenals will not have supplies by default, which means you can only take free items. There are two approaches to this:

Just give unlimited access to the included items - to do this, disable the arsenals SCR_ResourceComponent.

Alternatively, to restrict the amount of items which can be taken by a shared "supplies" resource, do this:

  1. Go into the SCR_ResourceComponent, click the + next to Containers and select SCR_ResourceContainer.
  2. In there, set "Resource Rights" to ALL or FACTION - this defines who can take things from the arsenal.
  3. Set "Resource Value Current" and "Resource Value Max" to define how many supplies are available from the start.
  4. Optionally, you can even configure gain/decay if you want supplies to slowly regenerate or decrease.

Supply cost of items is defined in the games arsenal configs. If required, you could duplicate/inherit one, make adjustments and select it for this specific arsenal - but it's easiest to just leave things as they are.