Jump to content
Sign in to follow this  
engima

Init file execution

Recommended Posts

Hi there!

Can someone please clarify (or post a link or something) some info about initial execution (i.e. init.sqf). When does the file start executing? How are commands executed? When does it start executing? What is executed during briefing, and what is not executed until player enters 3D world? And what else do I have to know about initialization to make a mission that is robust regarding initialization?

I have a big mission with a large init.sqf file, and things appears strange making me wonder about the above stated questions.

Thankful for any information!

Share this post


Link to post
Share on other sites

You can easily check it yourself, a diag_log with diag_ticktime, time, diag_frameno, some text, etc. put into the right places like init.sqf, object inits and so on will tell you exactly when things are running.

You can even put the command into description.ext with __EXEC but you only get the output when the config file is parsed (mission.sqm works too).

Afair init.sqf gets 100ms for (the initial) execution, but commands like sleep or waitUntil inside init.sqf will postpone further execution of it.

It also depends on how you start scripts inside inits, execVM and spawn will always postpone execution at least one frame (scheduled code can sometimes get delayed several frames and in worst case several seconds depending on various factors).

So, again, some diag_logs into the right places and you can check what happens with inits, init.sqf, briefing, when the player is inited, when the player actually sees the 3D game world and so on, and so on.

Edit: There are also several tricks to precompile hundreds of KB of code in just one frame (a frame in the game can have a timespan of several seconds in that case).

Xeno

Edited by Xeno

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×