ProjectsWhat's NewDownloadsCommunitySupportCompany
Forum Index » S.T.A.L.K.E.R.: Shadow of Chernobyl Forum » Mod discussion
Check for hunger?

Posted by/on
Question/AnswerMake Newest Up Sort by Descending
  20:41:01  28 November 2013
profilee-mailreply Message URLTo the Top
rkr5
(Novice)
 
On forum: 09/05/2009
Messages: 41
Check for hunger?

As the title states, I cannot for life of me perform a check for the level of satiety our poor little Marked One is feeling at any given time.
game_stats.script has a actor.satiety that I can't use, and that's about the best I could find in a folder-wide search of the scripts folder for the words "satiety" or "hunger".
I've also searched for UI elements that pop up when hunger sets in, figuring that would get me on the right path - no dice.

I'm kicking myself because it's bound to be remarkably simple.
  22:50:20  3 December 2013
profilee-mailreply Message URLTo the Top
rkr5
(Novice)
 
On forum: 09/05/2009
Messages: 41
Did some searching and found that satiety doesn't actually exist as a value I can check, so following what was suggested in the threads I found, I started on my own hunger system built from scratch.

Using dez0wave's scripted timer article on the mod wiki, I now have a system wherein a value is added to my new satiety variable every x seconds, and is saved/loaded using amk.save_variable.

But, I've hit a snag. The satiety value is saved/loaded correctly, but obviously the timer resets every time a save is loaded (possibly on level change too, but I haven't tested that yet).
I'm guessing, I could save the current expiration time on every update with
amk.save_variable("exp_time, expiration time), and start a new timer using the saved value on game load/level change, but I have no idea how to implement this last part.
Am I going to need an entirely new section in the timer script, or is this something I can bruteforce my way through in bind_stalker.script?
 
Each word should be at least 3 characters long.
Search:    
Search conditions:    - spaces as AND    - spaces as OR   
 
Forum Index » S.T.A.L.K.E.R.: Shadow of Chernobyl Forum » Mod discussion
 

All short dates are in Month-Day-Year format.


 

Copyright © 1995-2021 GSC Game World. All rights reserved.
This site is best viewed in Internet Explorer 4.xx and up and Javascript enabled. Webmaster.
Opera Software products are not supported.
If any problem concerning the site functioning under Opera Software appears apply
to Opera Software technical support service.