Guest 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, so if someone starts a new game, this script is doing its thing from minute one. 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 up Watchdog runs one cycle of 24 game time hours, its conditions arent met, so it does nothing and then stops with no reset of timer When the specific conditions are met in MAIN MOD script, execute the function in WatchDog that starts the timer WatchDog 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 timer StartTimerGameTime(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
CPU Posted October 27, 2017 Share Posted October 27, 2017 The timer event can be done only once per script. You may want to create a second script for the watchdog, and put a reference to it using a property in the other script. Link to comment
Guest Posted October 27, 2017 Share Posted October 27, 2017 Thanks, you have confirmed my suspicion and Ive already coded WatchDog as a separate script - in play testing, it works like a charm! Now I can do some wonderfully incredible things for Four-Play Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.