Picking up with tents where I left off with shelves. There are currently 2 tent objects in Arma 3, the dome one and the A shape one, but only A shape allows to peek inside, just like in DayZ Mod (don’t think there are tents in DayZ SA yet). So I thought to myself why not make stored items literally appear inside the tent so you could see what is in what tent without the need to go into inventory UI. Now look at the picture and tell me is this cool or is this cool?


The concept is simple, put standard weaponholder inside the tent and add some extra interaction logic. The code is also pretty simple, add gear key event handler and divert inventory interaction to the weaponholder inside the tent. The only minor problem with this set up is that weaponholder changes items around as you add or remove them, so occasionally some items appear outside of the tent, but this is not tragic.

To create a sample tent:

_tent = "Land_TentA_F" createVehicle position player; _tent setVectorUp surfaceNormal getPos _tent;

To add event handler:

0 = [] spawn { waitUntil {!isNull findDisplay 46}; findDisplay 46 displayAddEventHandler ["KeyDown", { if (_this select 1 in actionKeys "Gear") then [{ _tents = nearestObjects [ player modelToWorld [0,2,0], ["Land_TentA_F"], 2 ]; if (count _tents > 0) then [{ _tent = _tents select 0; _gwh = _tent getVariable ["_gwh", objNull]; if (isNull _gwh) then { _gwh = createVehicle [ "GroundWeaponHolder", [0,0,0], [], 0, "NONE" ]; _gwh attachTo [_tent, [0,0,0]]; _gwh setVectorUp vectorUp _tent; _tent setVariable ["_gwh", _gwh, true]; detach _gwh; }; player action ["Gear", _gwh]; true },{false}]; },{false}]; }]; };

The above script will only fire when inventory key is pressed. If there is a tent in front of you, inventory will hook to tent’s weaponholder, otherwise it will act normally. Another thing is, even with 2 items setup instead of one (tent and weaponholder), it could be easily converted for use with database and maybe optional even handler added to delete weaponholder if tent is destroyed. This is how it all looks in action: