Jump to content
  • 0

dayz_thirst, dayz_hunger


kooopa

Question

3 answers to this question

Recommended Posts

  • 0

Hello,

 

I'm a n00b in scripting but apparently, in e.g. z\addons\dayz_code\actions\player_drink.sqf, from line 86:

dayz_lastDrink = time;
dayz_thirst = 0;

It tells me that the thirst is reset to zero after you drink. The same analogy goes for he hunger, which means to me that unlike your blood level, hunger and thrist are not some HP-like quantities but the urge to eat and drink.

 

Thus they cannot be negative numbers as they are both zero when you have no urge to eat or drink.

 

I hope my explanation is correct.

 

Best Regards

 

Kisvakond

Link to comment
Share on other sites

  • 0

Another thought: in the file player_spawn_2.sqf:

	//Broadcast Hunger/Thirst
	_messTimer = _messTimer + 1;
	if (_messTimer > 15) then {
		_messTimer = 0;
		player setVariable ["messing",[dayz_hunger,dayz_thirst],true];
	};

	// Update blood only if PVAR does not match GVAR.
	_currentBlood = player getVariable ["USEC_BloodQty", 12000];
	if (_currentBlood != r_player_blood) then {
		player setVariable["USEC_BloodQty",r_player_blood,true];
	};

The thirst and hunger is 16 times less often updated compared to the blood (if it changed). The function sleeps 2 seconds each cycle, so I assume you have to wait more than 30 seconds to actually see a drop of 16*0.25 = 4 in thirst or hunger. I don't know what the scaling of thrist and hunger is, so I can't judge if this delta value of 4 is significant or not, if valid at all.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...