Jump to content

Scripting help pleaseee


noobax

Recommended Posts

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

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 by tunaisafish
Link to comment
Share on other sites

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 by ripple
Link to comment
Share on other sites

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

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 by noobax
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...