Posted October 6, 2015 (edited) Newbie scripting question here, all advice is welcome.A friend wants fog to appear in his Exile server during certain hours.Been playing around in the editor and this seems to work:_date = date; // If it's after 9pm, roll in fog over 60 seconds. if (date select 3 >= 21) then { 60 setFog [1, 0, 0]; } // If it's after 9am then clear the fog. else if (date select 3 >= 9) then { 60 setFog [0, 0, 0]; }; How would be the best way to implement this into Exile?Save as customFog.sqf, and add:execVM "scripts\customFog.sqf"; to our init.sqf would load the script but, as far as I'm aware, only check the time once.So how do we keep checking without affecting performance?Thanks. UPDATE: Had a thought, could we use waitUntil ?// Would add the fog at 9pm but never clear it? waitUntil {date select 3 >= 21} { // Draw fog code } // Clear it? waitUntil {date select 3 >= 9} { // Clear fog code } Would that work? Will play with the Editor in the morning, is 3am here. Edited October 6, 2015 by DY357LX Share this post Link to post Share on other sites
Posted October 6, 2015 @GR8 Do you have any idea How to call this at a certain time in game then reset to new value at a later time. Or even a certain amount a time the server has been up. Share this post Link to post Share on other sites
Posted October 6, 2015 You will need to use while loops to keep the script checking for the time or the server uptime. Something like this could work while {date select 3 >= 21} do { // Draw fog code // wait uiSleep 10; } Share this post Link to post Share on other sites