Skryp _ LotzoTheUltraBear

waitUntil, sleep possible on Serverside?

4 posts in this topic

4 hours ago, Skryp _ LotzoTheUltraBear said:

Hey ho,

is it possible to creat a waiting postion on the "serverside" like a timeloop, until the code is going on? 

e.g. tried this three option.

waitUntil {time > (_finishTime)};

sleep _finishTime;

[] spawn {	waitUntil {time > (_finishTime)}; };

thx :-) 

You can only use uiSleep, sleep, and waituntil in a scheduled environment. 

You can check if it's a scheduled environment by doing canSuspend

Things that create scheduled environment's are:

[] spawn {};

[] execVM "";

and a pre-init / post-init, initServer, initPlayerLocal, etc... etc...

things that create non-scheduled environment's are:

eventHandlers, [] call {}; onEachFrame, etc..


so basically, if that script is run in a scheduled environment you can uiSleep, and waitUntil. 

_finishTime = 20; // Will wait 20 seconds.

uiSleep _finishTime;


_finishTime = diag_ticktime + 20; // add 20 to current time.

waitUntil { diag_ticktime >= _finishTime };

The reason why i use uiSleep is beacuse sleep goes off of the in-game time. and uiSleep goes off of real-life time, so if the server FPS is at let's say 1 fps, the sleep can take a long time to finish. uiSleep will execute exactly after 20 seconds, because it's going off of real time, and not executing time. 


If you have anymore questions, hmu on steam.

  • Like 2

Share this post

Link to post
Share on other sites

if your trying to make it so the player cannot login to the server until the scripts are all loaded, you can do that from the exile_server_config.pbo under config.cpp



Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.