kooopa Posted September 6, 2014 Report Share Posted September 6, 2014 Hello, can some explain why this isnt working? dayz_hunger = dayz_hunger - 0.25; dayz_thirst = dayz_thirst - 0.25; While this works perfectly r_player_blood = r_player_blood - 100; Link to comment Share on other sites More sharing options...
0 Kisvakond Posted September 7, 2014 Report Share Posted September 7, 2014 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 kooopa 1 Link to comment Share on other sites More sharing options...
0 Kisvakond Posted September 7, 2014 Report Share Posted September 7, 2014 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. kooopa 1 Link to comment Share on other sites More sharing options...
0 kooopa Posted September 7, 2014 Author Report Share Posted September 7, 2014 Thanks Kisvakond, that helped me alot, in player_spawn_2.sqf i found useful code for me :) TYVM Link to comment Share on other sites More sharing options...
Question
kooopa
Hello,
can some explain why this isnt working?
While this works perfectly
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now