Page MenuHomeFeedback Tracker

Cannot retrieve weapon items/vests/headgear/uniform/backpack from player immediately after death
Assigned, NormalPublic

Description

In ArmA 2 it was possible to retrieve the player's weapons, magazines and backpack on death (i.e. saving what gear the player had on death). However, in ArmA 3 this only works for the primary weapon, secondary weapon and handgun - all other items simply show as "<null>", making it impossible restore the player's inventory on respawn (for example).

I am still able to retrieve information on a player's inventory while they are still alive (no issues there), it is only once they die that the information is lost.

{F18009}

Details

Legacy ID
1373261468
Severity
Minor
Resolution
Open
Reproducibility
Always
Category
Scripting
Steps To Reproduce

while {true} do {
_loadoutOnSpawn = [

		assignedItems player,
		primaryWeapon player,
		primaryWeaponItems player,
		handgunWeapon player,
		handgunItems player,
		secondaryWeapon player,
		secondaryWeaponItems player,
		uniform player,
		uniformItems player,
		vest player,
		vestItems player,
		backpack player,
		backpackItems player,
		headgear player,
		goggles player

];
player groupChat format["Loadout on spawn: %1",_loadoutOnSpawn]; // this works

waitUntil {!alive player};

_loadoutOnDeath = [

		assignedItems player,
		primaryWeapon player,
		primaryWeaponItems player,
		handgunWeapon player,
		handgunItems player,
		secondaryWeapon player,
		secondaryWeaponItems player,
		uniform player,
		uniformItems player,
		vest player,
		vestItems player,
		backpack player,
		backpackItems player,
		headgear player,
		goggles player

];

player groupChat format["Loadout on death: %1",_loadoutOnDeath]; // this doesn't
};

Additional Information

Example of loadout on spawn (written to RPT log):

"Loadout on spawn: [["ItemMap","ItemCompass","ItemWatch","ItemRadio","NVGoggles","H_HelmetB","Binocular"],"arifle_MX_GL_Hamr_point_mzls_F", \ ["","acc_pointer_IR","optic_Hamr"],"hgun_P07_F",["","",""],"",[],"U_B_CombatUniform_mcam_vest",["FirstAidKit","30Rnd_65x39_caseless_mag","1Rnd_Smoke_Grenade_shell","1Rnd_SmokeRed_Grenade_shell","1Rnd_SmokeGreen_Grenade_shell"],"V_PlateCarrier1_rgr", \ ["30Rnd_65x39_caseless_mag","30Rnd_65x39_caseless_mag","30Rnd_65x39_caseless_mag","30Rnd_65x39_caseless_mag","30Rnd_65x39_caseless_mag_Tracer", \ "30Rnd_65x39_caseless_mag_Tracer","30Rnd_65x39_caseless_mag_Tracer","30Rnd_65x39_caseless_mag_Tracer","30Rnd_65x39_caseless_mag_Tracer","30Rnd_65x39_caseless_mag_Tracer", \ "16Rnd_9x21_Mag","HandGrenade","HandGrenade","1Rnd_HE_Grenade_shell","1Rnd_HE_Grenade_shell","1Rnd_HE_Grenade_shell", \ "1Rnd_SmokeYellow_Grenade_shell","1Rnd_SmokePurple_Grenade_shell"],"",[],"H_HelmetB",""]"

Example of loadout on death (written to RPT log):

"Loadout on death: [<null>,"arifle_MX_GL_Hamr_point_mzls_F",<null>,"hgun_P07_F",<null>,"",<null>,"",<null>,"",<null>,"",<null>,"",""]"

Event Timeline

MisterGoodson edited Additional Information. (Show Details)
MisterGoodson set Category to Scripting.
MisterGoodson set Reproducibility to Always.
MisterGoodson set Severity to Minor.
MisterGoodson set Resolution to Open.
MisterGoodson set Legacy ID to 1373261468.May 7 2016, 12:33 PM

I have attached a very simple mission to demonstrate the issue. Simply run the mission and it will hint you the player's loadout on spawn, on death, and on respawn.

Ammo crates have been provided for easy experimenting.

KDN added a subscriber: KDN.May 7 2016, 12:33 PM
KDN added a comment.Mar 23 2013, 3:47 PM

yep, I confirm it too. If we could only get a few seconds delay before the load out wipe out happens, it would be enough to get the info out.

i was unsuccessful both with Killed and Respawn eh
you can't even get the corpe's 'cargo' with getCargo functions
a workaround is to save player's gear every X seconds

You can work around it using EH handleDamage and trigger the save sequence once player damage > 0.9.

Confirming, only 'weapons' is still returning after death.

The scripting command "Items" doesn't seem to return anything when used on dead units, only units that are alive. "Weapons" and "Magazines" work for both alive and dead units. The "Items" command may be bugged. I'm using the Development build 0.61.105957

I'm not sure if this bug is relevant for this tracker or if it deserves its own.

Pancake: 'items' is already mentioned in the title.

New commands introduced in beta:
primaryWeaponMagazine
secondaryWeaponMagazine
handgunMagazine

doesn't work on dead players too, so its impossible to say check if dead body has launcher with rocket or not.

In 1.01.110097, most of inventory commands are still bugged/unavailable for a dead unit.
We have to implement weird, heavy and unreliable tricks to bypass this problem.

Hope it will be fixed.

DEV. 110837 - main issue has been fixed (spawn and death loadout match)

about primary and secondary weapons commands - in fact, they work exactly as they have been designed. But you have to realize that the game logic throws away primary and secondary weapons right after death, so you can't reach primaryWeapon name just because the dead soldier has no item like that. Only handgun will stay in soldier's inventory when he die

japapatramtara, thanks a lot for taking your time to fix this issue! Also, there should be some kind of link to thrown away weapon, right? I remember if you open main body inventory of dead soldier you still see his gun in the list (which is also another problem since weapon near soldier makes it hard to open soldier himself, not WeaponHolderSimulated with his weapon). Maybe weapon commands should use this link if unit is dead? Thank you.

Samatra: yep, your idea is not bad, but I can't decide it. After distributing my patch and testing main issue functionality, I will reassign this task to our SandBox designers so they can take a look and make proper decision

Hm, how about different approach: Make a new scripting command to return list of dropped\linked weapon holders. This will solve current issue with weapon returning command plus will enable additional useful things like being able to easily delete dead body's dropped weapons when you do cleanup going through allDead list.

Something like:
droppedWeapons <unit>

An example of additional useful usage with addDead:
{
_dead = _x;
{deleteVehicle _x} forEach (droppedWeapons _dead);
deleteVehicle _dead;
} forEach addDead;

(Currently if you delete dead body, dropped weapons delete only if dead body inventory was never opened by players).

Please let me know if you think that introduction of this scripting command will be rational and if so, I'll make a ticket for it. Thank you.

I have just assigned this task to our Sandbox design director.. he is the right guy to say If I will implement it or won't

Thanks again!