noobax Posted June 18, 2011 Share Posted June 18, 2011 When i went to the follower's safehouse, I liked how the fridge keeps resetting at 2 days of the week. I wanted to do the same for my campground, to signify "supplies" from somewhere, except i wanted it to reset ONCE per day, or reset at only 1 minute in everyday. I know you can set it to reset everyday with the Get.DayOfTheWeek command, but that means that it would reset endlessly during that day, not just once. Help please anyone? Link to comment Share on other sites More sharing options...
SmileyCat Posted June 18, 2011 Share Posted June 18, 2011 This could be controlled with a NPC coming to the container that needs to be restocked using packages. Link to comment Share on other sites More sharing options...
tunaisafish Posted June 19, 2011 Share Posted June 19, 2011 (edited) Could try something like this... int iLastDayRan int iThisDay ;Run when the fridge renders ;so it only gets stocked by the mysterious stranger when the player is not looking BEGIN OnLoad ;convert the global float to an integer set iThisDay to GameDaysPassed ;End script if already done today if iThisDay == iLastDayRan return endif set iLastDayRan to iThisDay ; This section will run once per day ; Check stock and replenish if needed here END Edit: Changed so the whole script doesn't look like one big comment Edited June 19, 2011 by tunaisafish Link to comment Share on other sites More sharing options...
noobax Posted June 19, 2011 Author Share Posted June 19, 2011 (edited) wowww thats seriously too complicated for me. Are there any easier ones? Thanks for writing that out for me, ill try it if there isnt simpler ones Edited June 19, 2011 by noobax Link to comment Share on other sites More sharing options...
NorthWolf Posted June 19, 2011 Share Posted June 19, 2011 By my reckoning that's the most eloquent solution you're going to get for the code... you'd only have to paste in the proper functions at the end of the OnLoad block for refreshing the inventory. Link to comment Share on other sites More sharing options...
noobax Posted June 19, 2011 Author Share Posted June 19, 2011 hmm. i just need to know if theres a command to get teh time of teh day Link to comment Share on other sites More sharing options...
ripple Posted June 19, 2011 Share Posted June 19, 2011 (edited) tunaisafish supplied you with a script and your response is that it's "too complicated" for you? You could also try to do the minimal amount of learning required to get the script to work for your mod.... Edited June 19, 2011 by ripple Link to comment Share on other sites More sharing options...
NorthWolf Posted June 19, 2011 Share Posted June 19, 2011 He has given you the commands to do what you want, and he's put in comments so the code is easy to understand. I thought it was a very good example and it helped me -- if you try learning some basic scripting VIA the GECK wiki you should be able to make sense of what's happening in that code block. Link to comment Share on other sites More sharing options...
noobax Posted June 22, 2011 Author Share Posted June 22, 2011 (edited) ok just let me confirm, i put the resetinventory command line after the set iLastDayRan to iThisDay? P.S. I understood the script, but I was just wondering if there was a command to get the time of the day, which would make the script much shorter. Edited June 22, 2011 by noobax Link to comment Share on other sites More sharing options...
noobax Posted June 22, 2011 Author Share Posted June 22, 2011 ok, ive used the script and i put boxREF.resetinventory below the set ilastdayran to ithisday command line. Now the box doesnt reset at all Link to comment Share on other sites More sharing options...
Recommended Posts