FlashyJoer Posted October 27, 2017 Share Posted October 27, 2017 Hi all, quick question as Im trying to ascertain if something I want to do is possible... for the preamble: I have a RefAlias script running that controls my main mod. In it, when certain conditions are met, it starts a new player activity quest. When that player activity quest hits a certain point, I want another RefAlias script to start up. I have created this quest and the script, which fires fine and does it's thing, for the record. My problem is, this particular script runs regardless of the quest being Start Enabled or not, so if someone starts a new game, this script is doing its thing from minute one even though the quest is set to NOT start up. The conditions that trigger this particular quest would not, for the player, likely kick in until they are level 20+, months of gametime play into their save. What I want is to have the timer refalias script (called WatchDog) run through its cycle once on startup and then not have the timer restart - this is easy enough; just dont have a StartTimerGameTime() in the WatchDog script. My question is, if I build a function into WatchDog that simply tells the script to start the gametime timer, can I execute this function from my MAIN mod script, thus restarting the WatchDog for its conditional 24 hour cycle, with required repeat cycles (using a variable to control whether or not the restart function is called or not)? In a nutshell... Game starts -> WatchDog fires once, as it will regardless of how I set the quest upWatchdog runs one cycle of 24 game time hours, its conditions arent met, so it does nothing and then stops with no reset of timerWhen the specific conditions are met in MAIN MOD script, execute the function in WatchDog that starts the timerWatchDog then does its thing, repeating as necessary until all conditions are met and a canceltimer() is called Is this possible? I just dont want to have a 24 hour timer running from the minute someone starts a new game, doing nothing, until the point where WatchDog is actually needed. Just to reduce system load for the game player's PC. For the record, I have tried to put two gametimetimers into my MAIN script, but it just doesnt work... real time timers, yes, game time, no... unless I am doing it wrong. StartTimerGameTime(336,0) <- Main timerStartTimerGameTime(24,1) <- WatchDog timer When put these in the MAIN script together, it doesnt acknowledge timer 1 (Watchdog) during OnTimerGameTime, where I have: Event OnTimerGameTime(int TID) If TID == 0{Does its thing}Endif If TID == 1{does its thing}Endif EndEvent This simply does not work - it never acknowledges WatchDog's 24 hour timer... unless I am doing something wrong. Either way, Ive opted for the other approach of using a separate refalias script for WatchDog. Can anyone offer some insight to what I may be doing wrong, or for my sanity (to not have to recode my entire MAIN script for these two timers to be in one script together), how to make MAIN Script restart the timer on Watchdog when conditions are met. Any help would be lovely and I thank you! Link to comment Share on other sites More sharing options...
SKKmods Posted October 27, 2017 Share Posted October 27, 2017 I try and centralise as much in a quest main script as possible to trace and maintin, but as you describe there seem to be all sorts of variable related issues in quest main scripts for triggering when the owning quest is not actually started or staged. Since the default game to world time ratio is 20:1 have you tried running standard ontime timers at say 60 real world minutes ? Maintaining your ticks isnt elegant but its not going to be much more than care and feeding refalias events. On the quest starting without being start enabled, check that all script OnInit() are empty and there is no alias with onPlayerLoadGame() attached. To lock it out, create a non optional refalias, say PlayerRef and leave it unfilled as a quest will not run in this condition. Unlock by filling it with a ForceRefTo when ready to run. Link to comment Share on other sites More sharing options...
FlashyJoer Posted October 28, 2017 Author Share Posted October 28, 2017 Oooh thats an awesome amount of information! Thanks very much for this! :) Link to comment Share on other sites More sharing options...
Recommended Posts