Page MenuHomeFeedback Tracker

Revive system reloads all remaining mags at full. Please let's keep the exact amount of rounds.
New, WishlistPublic

Description

Feature request but this could be considered as a bug.

The respawn system allows to script for keeping all magazines in their state (load) when player die then respawn. (you can script something with EH killed/respawn and bis_fnc_inventory).

On the other hand, there is no way (no EH incapacitated/revived or equivalent) to manage the magazines loads for a player. Player haves always full mags when healed/respawned.

Details

Legacy ID
2235023880
Severity
None
Resolution
Open
Reproducibility
Always
Category
Feature Request
Steps To Reproduce

Play in MP,
fire some ammo on each type of magazines,
be injured to death with revive system,
choose to respawn or be healed, or even killed by timer,
You'll revive with full mags for each remaining mag.

Additional Information

here is a script to keep the exact ammo counts in respawned inventory (works with respawn, doesn't work with revive/respawn}:
in initserver.sqf for example:

{_x setvariable ["youpi",_foreachindex,true]} foreach playableUnits;

{_x addMPEventHandler ["MPkilled", {

_unit = _this select 0;
[_unit, [missionNamespace, format ["cur_inv_%1", _unit getVariable "youpi"]]] call BIS_fnc_saveInventory;
_unit setVariable ["MGI_ammo1",_unit ammo (primaryWeapon _unit)];
_unit setVariable ["MGI_ammo2",_unit ammo (handgunWeapon _unit)];
_unit setVariable ["MGI_ammo3",_unit ammo (secondaryWeapon _unit)];
_unit setVariable ["MGI_mags",magazinesAmmoFull _unit];
_unit setVariable ["MGI_weapon",currentWeapon _unit];

}]} forEach playableUnits;

{_x addMPEventHandler ["MPRespawn", {

_unit = _this select 0;
_corpse = _this select 1;
[_unit, [missionNamespace, format ["cur_inv_%1", _unit getVariable "youpi"]]] call BIS_fnc_loadInventory;
{_unit removeMagazine _x} forEach magazines _unit;
_unit setAmmo [primaryWeapon _unit, 0];
_unit setAmmo [handGunWeapon _unit, 0];
_unit setAmmo [secondaryWeapon _unit, 0];
{ if (((_unit getVariable "MGI_mags") select _foreachindex select 3) <= 0) then {_unit addMagazine [_x select 0,_x select 1]}} forEach (_unit getVariable "MGI_mags");
_unit setAmmo [primaryWeapon _unit,_unit getVariable "MGI_ammo1"];
_unit setAmmo [handGunWeapon _unit,_unit getVariable  "MGI_ammo2"];
_unit setAmmo [secondaryWeapon _unit,_unit getVariable "MGI_ammo3"];
_unit selectWeapon (_unit getVariable "MGI_weapon");
removeAllWeapons _corpse;
removeBackpackGlobal _corpse;
removeVest _corpse;
removeAllAssignedItems _corpse;
removeAllItems _corpse;
removeGoggles _corpse;
removeHeadgear _corpse;
{deleteVehicle _x} forEach nearestObjects [(getPosATL _corpse),["WeaponHolderSimulated","groundWeaponHolder"],5];
}]} forEach playableUnits;

Event Timeline

PiepMGI edited Steps To Reproduce. (Show Details)Jan 8 2016, 4:10 PM
PiepMGI edited Additional Information. (Show Details)
PiepMGI set Category to Feature Request.
PiepMGI set Reproducibility to Always.
PiepMGI set Severity to None.
PiepMGI set Resolution to Open.
PiepMGI set Legacy ID to 2235023880.May 8 2016, 1:26 PM
PiepMGI added a subscriber: PiepMGI.

Any way to avoid magazines ammo counts overwritten with the revive system?

Some features that are currently WIP will make this more reliable and consistent when released.

Sounds great! Thanks KK.