Jump to content
cklymowsky

Understanding how preInit and postInit attributes work

Recommended Posts

HI All, 

 

I'm trying to figure out how the  preInit and postInit attributes work, and I've read a couple of threads

Quote
Quote

 

and still am missing something...

 

I thought the following would display "Hello BEAKO" before the mission start but nothing happens.

 

I created:

 

descrition.ext

class CfgFunctions
{
	class BEAKO
	{
		class preInit
		{
			file = "functions\preInit";				
			class test 
			{
				preInit = 1;
			};
		};
	};
};

initServer.sqf

[] call BEAKO_fnc_test;

fn_test.sqf (inside folders "functions" sub-folder "preInit")

hintC format ["Hello %1",name player];

 

Share this post


Link to post
Share on other sites

Since preInit runs before the mission begins or is even initialized, you'll never see the hint.

Take a read.

 

In most cases you'd never need preInit or postInit unless you want to run extremely cpu expensive functions where it doesn't impact gameplay (grabbing all buildings on the entire map etc).

 

Cheers

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

×