SOVIET_IDIOT 2 Posted December 20, 2020 I'm trying to use the Dynamic AI Spawn System script to execute every time the mission is on a specific daytime. I tried using this: if (daytime >= 12) then { execVM "DynamicAISpawn.sqf"; }; It doesn't work. Can anybody help? Share this post Link to post Share on other sites
SOVIET_IDIOT 2 Posted December 20, 2020 No, I don't have loop. Share this post Link to post Share on other sites
gc8 977 Posted December 20, 2020 Well you certainly need a loop: while { true } do { if (daytime >= 12) exitWith // Exit loop { execVM "DynamicAISpawn.sqf"; }; sleep 2; }; 1 Share this post Link to post Share on other sites
SOVIET_IDIOT 2 Posted December 20, 2020 It gives me "Error missing )" line 5 Share this post Link to post Share on other sites
gc8 977 Posted December 20, 2020 9 minutes ago, SOVIET_IDIOT said: It gives me "Error missing )" line 5 there was invisible character, try now Share this post Link to post Share on other sites
SOVIET_IDIOT 2 Posted December 20, 2020 It works now. Thank you very much, sir. Share this post Link to post Share on other sites
pierremgi 4822 Posted December 20, 2020 For a single event, you don't need a loop: 0 = [] spawn { waitUntil {sleep 5; dayTime > 12}; your code }; If your mission lasts for several days (acceleration time or else), you need a loop and certainly not exit it: 0 = [] spawn { while {true} do { waitUntil {sleep 2; dayTime > 12}; your code waitUntil {sleep 2; dayTime <= 12}; }; }; 1 Share this post Link to post Share on other sites
SOVIET_IDIOT 2 Posted December 20, 2020 16 minutes ago, pierremgi said: For a single event, you don't need a loop: 0 = [] spawn { waitUntil {sleep 5; dayTime > 12}; your code }; If your mission lasts for several days (acceleration time or else), you need a loop and certainly not exit it: 0 = [] spawn { while {true} do { waitUntil {sleep 5; dayTime > 12}; your code waitUntil {sleep 5; dayTime <= 12}; }; }; Does skiptime affects the loop? I tried skipping it a day it won't repeat. Share this post Link to post Share on other sites
pierremgi 4822 Posted December 20, 2020 2 minutes ago, SOVIET_IDIOT said: Does skiptime affects the loop? I tried skipping it a day it won't repeat. I decrease the sleep time....from 5 to 2. It's just because you're testing without waiting the condition meets the code. let waituntil works. 1 Share this post Link to post Share on other sites