Little concern with ACE3 HITPOINT

  • Offline Animatek
  • SNET Admin
  • First Blood
  • ***
  • Posts: 72
  • Editor de Profesión - ArmA III Admin from Cuba

Little concern with ACE3 HITPOINT

« posted: Sep 02, 2019, 08:32 PM »
I want to save the damage of each hitpoint modified by ACE3 in the DB.
In the default form of A3Wasteland is:

Code: [Select]
_hitPoints = [];
_hpDamage = getAllHitPointsDamage _player;

{
if (_x != "") then
{
_hitPoints pushBack [_x, (_hpDamage select 2) select _forEachIndex];
};
} forEach (_hpDamage select 0);

{ _data pushBack _x } forEach
[
["Damage", damage _player],
["HitPoints", _hitPoints],
["Money", _player getVariable ["cmoney", 0]] // Money is always saved, but only restored if A3W_moneySaving = 1
];

Now, the way to get the hitpoint translated by ACE3 and its damage I think is kinda:
Code: [Select]

//Get the hitpoint and the index
params [["_selection", "", [""]]];
_selection = toLower _selection;
if (_selection != "" && {!(_selection in GVAR(SELECTIONS))}) exitWith {0};
private _hitpoint = [_player, _selection, true] call ace_medical_fnc_translateSelections;
(getAllHitPointsDamage _player) params [["_allHitPoints", []]];
private _hitpointIndex = -1;
{   //case insensitive find
    if (_x == _hitpoint) exitWith {_hitpointIndex = _forEachIndex;};
} forEach _allHitPoints;
if (_hitpointIndex < 0) exitWith {0};

private _currentDamage = _player getHitIndex _hitpointIndex;

the GVAR macro variable (SELECTIONS) refers to

ace_medical_selections (without quotes)

and refers to the new translated and simplified ACE3 hitpoints.

Now; How do I save it in the DB with this new way?

Soy administrador de ArmA III en una intranet en Cuba. No tengo experiencia en códigos ni programación, pero con ayuda he logrado un servicio eficiente y duradero, todo offline y sin internet.

Re: Little concern with ACE3 HITPOINT

« Reply #1 posted: Sep 17, 2019, 04:18 AM »
I want to save the damage of each hitpoint modified by ACE3 in the DB.
In the default form of A3Wasteland is:

Code: [Select]
_hitPoints = [];
_hpDamage = getAllHitPointsDamage _player;

{
if (_x != "") then
{
_hitPoints pushBack [_x, (_hpDamage select 2) select _forEachIndex];
};
} forEach (_hpDamage select 0);

{ _data pushBack _x } forEach
[
["Damage", damage _player],
["HitPoints", _hitPoints],
["Money", _player getVariable ["cmoney", 0]] // Money is always saved, but only restored if A3W_moneySaving = 1
];

Now, the way to get the hitpoint translated by ACE3 and its damage I think is kinda:
Code: [Select]

//Get the hitpoint and the index
params [["_selection", "", [""]]];
_selection = toLower _selection;
if (_selection != "" && {!(_selection in GVAR(SELECTIONS))}) exitWith {0};
private _hitpoint = [_player, _selection, true] call ace_medical_fnc_translateSelections;
(getAllHitPointsDamage _player) params [["_allHitPoints", []]];
private _hitpointIndex = -1;
{   //case insensitive find
    if (_x == _hitpoint) exitWith {_hitpointIndex = _forEachIndex;};
} forEach _allHitPoints;
if (_hitpointIndex < 0) exitWith {0};

private _currentDamage = _player getHitIndex _hitpointIndex;

the GVAR macro variable (SELECTIONS) refers to

ace_medical_selections (without quotes)

and refers to the new translated and simplified ACE3 hitpoints.

Now; How do I save it in the DB with this new way?

Make sure you check the ACE3 development progress. They are fixing to if not already have release/d an update with a medical system overhaul