Jump to content
BlacKnightBK

Whats the init.sqf and the initServer.sqf

Recommended Posts

Hello guys,

 

So I used to execVM my functions file in the init.sqf. But one day out of the blue they decided not to read those files anymore. I still have no idea why but now I execute them normally in the initServer.sqf

 

What is going on? Am i turning crazy?

Share this post


Link to post
Share on other sites

Without showing any code its very hard to help.

 

I ll give you some links instead which you should read to get a clue about the init.sqf and other event scripts.

 

Init Order

event scripts

 

If you run your scripts more than one time I would prefer spawn instead of execVM. Because of that, some more links:

spawn

call

execVM


preprocessFileLineNumbers

compileFinal

Share this post


Link to post
Share on other sites
Just now, sarogahtyp said:

Without showing any code its very hard to help.

 

I ll give you some links instead which you should read to get a clue about the init.sqf and other event scripts.

 

Init Order

event scripts

 

If you run your scripts more than one time I would prefer spawn instead of execVM. Because of that, some more links:

spawn

call

execVM

3

This is my code, I used to have it in my init.sqf and used to work fine but now it won't anymore and I have to keep it in my initServer.sqf

_script = []execVM "scripts\misc\functions.sqf";
waitUntil{scriptDone _script};

Share this post


Link to post
Share on other sites
3 minutes ago, sarogahtyp said:

Without showing any code its very hard to help.

 

I ll give you some links instead which you should read to get a clue about the init.sqf and other event scripts.

 

Init Order

event scripts

 

If you run your scripts more than one time I would prefer spawn instead of execVM. Because of that, some more links:

spawn

call

execVM

 

never mind, thanks, apparently init only executes in singleplayer, which still does not make sense since I always launched in multiplayer

Share this post


Link to post
Share on other sites
2 minutes ago, BlacKnightBK said:

never mind, thanks, apparently init only executes in singleplayer, which still does not make sense since I always launched in multiplayer

 

this is not correct.

look some more below at the init order page.

In multiplayer it is just executed some time later.

Share this post


Link to post
Share on other sites
1 minute ago, sarogahtyp said:

 

this is not correct.

look some more below at the init order page.

In multiplayer it is just executed some time later.

 

Arrgh, what was wrong then??

Share this post


Link to post
Share on other sites
11 minutes ago, BlacKnightBK said:

Arrgh, what was wrong then??

At the moment idk.

 

But everytime you execute a script or call a function you should ask who exactly needs to execute this and which is the appropriate time to execute.

 

Who and when?

Server only on mission start -> initServer.sqf

Player only on mission join ->  initPlayerLocal.sqf

Server only if player joins -> initPlayerServer.sqf

everywhere on mission start -> init.sqf

 

You could post your script to look for the mistake. also look at your .rpt file for any errors and post them.

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
1 minute ago, sarogahtyp said:

At the moment idk.

 

But everytime you execute a script or call a function you should ask who exactly needs to execute this and which is the appropriate time to execute.

 

Who and when?

Server only on mission start -> initServer.sqf

Player only on mission join ->  initPlayerLocal.sqf

Server only if player joins -> initPlayerServer.sqf

everywhere on mission start -> init.sqf

 

You could post your function to look for the mistake. also look at your .rpt file for any errors and post them.

2

Hmm, that's enlightening, well my functions were fine then, I know that much. The rpt file used to tell me the variables which were the function names did not exist. That's how I knew that the file was not being executed.

Share this post


Link to post
Share on other sites
On 3/30/2017 at 2:07 AM, BlacKnightBK said:

Hmm, that's enlightening, well my functions were fine then, I know that much. The rpt file used to tell me the variables which were the function names did not exist. That's how I knew that the file was not being executed.

 

if anything this could've just been defined in CfgFunctions in the description.ext

(if this in fact a file containing a function) 

Share this post


Link to post
Share on other sites

The problem is probably with file patching. Is the "Scripts" folder in your Arma 3 directory? If it is, you will need to enable file patching in order for it to work.

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

×