Where define hunger and thirst levels?

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

Where define hunger and thirst levels?

« posted: Mar 30, 2019, 09:47 AM »
This is the way to get the hunger and thirst values ​​that ACEX Fields Rations uses:

Code: [Select]
player getvariable ["acex_field_rations_hunger", 0]
player getvariable ["acex_field_rations_thirst", 0]

 In my effort to make the original survival system converge with that of ACEX3, I need to know where I define in ArmA3_A3Wasteland that the values ​​of "hungerLevel" and "thirstLevel" are the value of the acex field rations system. in this way I do not have to modify so much the alert systems, causes of death, database, etc ... I think it's in getPlayerData.sqf, line 13 and 14; it is right?

Actual code:
Code: [Select]
["Hunger", ["hungerLevel", 0] call getPublicVar],
["Thirst", ["thirstLevel", 0] call getPublicVar],

What am I supposed to do?

 I know that I must still modify several things in initSurvival to adapt it, but to begin with I need to define that hunger or thirst levels refers to acex_field_rations_


By the way, today I managed to run the killfeed and the statistics with the ACE3. I'm so proud of myself. The only thing that AI kills does not count, but who cares, right?
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.
  • Offline Animatek
  • SNET Admin
  • First Blood
  • ***
  • Posts: 72
  • Editor de Profesión - ArmA III Admin from Cuba

Re: Where define hunger and thirst levels?

« Reply #1 posted: Mar 30, 2019, 10:08 AM »
What about this

Code: [Select]
["Hunger", ["hungerlevel", [_player getVariable ["acex_field_rations_hunger", 0]]] call getPublicVar],
["Thirst", ["thirstlevel", [_player getVariable ["acex_field_rations_thirst", 0]]] call getPublicVar]
It will works?
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: Where define hunger and thirst levels?

« Reply #2 posted: Mar 30, 2019, 11:02 PM »
No I don't think that's going to work.

Acex puts a variable on the player. A3W appears to put a variable in the mission namespace for the client.

You'll either have to edit initSurvival.sqf to work with Acex's variables.
  • Offline Animatek
  • SNET Admin
  • First Blood
  • ***
  • Posts: 72
  • Editor de Profesión - ArmA III Admin from Cuba

Re: Where define hunger and thirst levels?

« Reply #3 posted: Mar 31, 2019, 11:39 PM »
Code: [Select]
["Hunger", ["hungerlevel", [_player getVariable ["acex_field_rations_hunger", 0]]] call getPublicVar],
["Thirst", ["thirstlevel", [_player getVariable ["acex_field_rations_thirst", 0]]] call getPublicVar]

Well, this actually works. it even saves it correctly in the DB. Now what I'm trying to achieve is to read it from there and apply it to the player.
Obviously, I had to disable and modify the majority of initSurvival, I just left the alerts.

What I need now is to make this possible in applyplayerdata

Code: [Select]
case "Hunger" : { hungerlevel = _value }
Turned to something realistic based on this:

Code: [Select]
case "Hunger" : { hungerlevel = (player setVariable ["acex_field_rations_hunger", _value]) };
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.
  • Offline Animatek
  • SNET Admin
  • First Blood
  • ***
  • Posts: 72
  • Editor de Profesión - ArmA III Admin from Cuba

Re: Where define hunger and thirst levels?

« Reply #4 posted: Apr 01, 2019, 12:20 AM »
If I do not define hungerlevel or thirstlevel in applyPlayerData, doing this, for example

Code: [Select]
case "Hunger": {player setVariable ["acex_field_rations_hunger", _value]};
instead of original one

Code: [Select]
case "Hunger": {hungerLevel = _value};
the system does not correctly save in the DB the level of hunger, or thirst, depending on the case; and in the HUD puts an error "-I do not remember- NaN"

How can I define that hungerlevel is the value (_value) readed from the DB already applied to acex_field_rations_hunger?
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.
  • Offline Animatek
  • SNET Admin
  • First Blood
  • ***
  • Posts: 72
  • Editor de Profesión - ArmA III Admin from Cuba

Re: Where define hunger and thirst levels?

« Reply #5 posted: Apr 01, 2019, 10:23 PM »
All Ok

I just set both values

case "hunger" : { hungerLevel =_value };
                           { player setVariable [acex_field_rations_hunger, _value };

Its work fine. It read and write in DB.
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.