saxon7610 Posted October 10, 2015 Share Posted October 10, 2015 I am working on a mod that will build a new casino in searchlight over a number of days after the player has completed a quest to close the radiation canisters in the firehouse. I was hoping to get a pro tip on this script, i.e. "will it work", the examples I have seen with staged timers have all use GetSecondsPassed instead of GameDaysPassed. scn zzSearchlightTimerFloat timerShort Day3Short Day15Short Day30short CasinoBegin GamemodeIf getstage Quest >= 100 && (Day30 == 0) Set timer to GameDaysPassed + 30Endif;enables foundation and guardsif (timer == GameDaysPassed - 27) && (Day3 == 0) xxxxxx.enable set Day3 to 1endif;enables casino exteriorif (timer == GameDaysPassed - 15) && (Day15 == 0) xxxxx.enable Set Day15 to 1endif;opens casino for businessIf (timer == GameDaysPassed - 30) && (Casino == 0) xxxxx.enable Set Casino to 1EndifEnd Link to comment Share on other sites More sharing options...
Ladez Posted October 10, 2015 Share Posted October 10, 2015 Your script wouldn't work like you expect. You're not setting the Day30 variable anywhere, so the timer is set to days passed + 30 with every iteration.If we start at day 7: 30 + 7 = 37 days. The next day it would be 38, and so on.Additionally, your conditions are way off. The following will never evaluate to true: timer == GameDaysPassed - 27The difference is always going to be exactly 57, they will never equal one another. And equality is a bad comparison to make anyways with GameDaysPassed, since it actually returns a floating point value. It'll only return a natural number in a splitsecond, if at all. Best to use larger/smaller than comparisons instead. I've written a new script for you that I'm quite sure will do what you want. There's a few comments in there to explain things. ScriptName SearchlightTimer float fTimeStamp Begin GameMode ; Save the time when the quest completed If GetStage Quest >= 100 && fTimeStamp == 0 Set fTimeStamp to GameDaysPassed ; Halt script if we don't have a timestamp yet Else Return EndIf ; If xxx is disabled and 3 days has passed, enable it If GameDaysPassed - fTimeStamp >= 3 && xxx.GetDisabled xxx.Enable ; If zzz is disabled and 15 days has passed, enable it ElseIf GameDaysPassed - fTimeStamp >= 15 && zzz.GetDisabled zzz.Enable ; This can be copied for as many days/things to enable you want EndIf End Link to comment Share on other sites More sharing options...
saxon7610 Posted October 11, 2015 Author Share Posted October 11, 2015 (edited) Thank you very much If I hadn't forgotten set Day30 to 1 would the timer stay at the same value, or would it still count up? Edited October 11, 2015 by saxon7610 Link to comment Share on other sites More sharing options...
Ladez Posted October 11, 2015 Share Posted October 11, 2015 If you'd set it when you set the timer, then no, it wouldn't count up. But it still wouldn't work. Say timer gets set at day 7, so the value is 37. Three days after, the first condition is supposed to be true, but it will evaluate to 37 == -17, which is false. You would need to subtract by 3 instead of 27. Link to comment Share on other sites More sharing options...
saxon7610 Posted October 11, 2015 Author Share Posted October 11, 2015 Yeah I figured that out after reading your first response, but again I must say Thank you so much for your help. Link to comment Share on other sites More sharing options...
Recommended Posts