Jump to content
Sign in to follow this  
florianmuellerch

Understand how a server executes scripts

Recommended Posts

Hi Community

I am not yet clear on how scripts in ArmA gets executed.

I made a little draft on how I thought scripts were executed:

hywq.png

But the first thing is that init.sqf does not get executed when the server is started - the mission will only load when the first player joins.

Another thing is that the initialization block of the player itself does not get executed locally - as I understood so far.

Please enlight me :)

Thank you in advance for your help!

Florian

Share this post


Link to post
Share on other sites

Take a look at this article, it have some information about initialization order and might be helpful.

But the first thing is that init.sqf does not get executed when the server is started - the mission will only load when the first player joins.
Why should it be executed upon server start? AFAIK init.sqf is specific to each mission and it's only executes when that mission begins. :)

Share this post


Link to post
Share on other sites

Thank you both very much for your input, I'll read through detailed this evening and I'll report back if I have any further questions! :)

EDIT: Although, there is still one question: On how I read the articles, I am wondering about how missions are thought on a server. The server is actually able to do mission rotation, but I want a persistent mission which actually starts with the server and never ends. Is this simply realizable with no mission end, persistent = true in the server description.ext and one single map in the map rotation?

Share this post


Link to post
Share on other sites

From memory persistent = 1 is needed in the servers config and the description.ext of the mission must have a respawn = base or instant else mission closes on the last player leaving.

Share this post


Link to post
Share on other sites

Set persistent = 1 in the server configuration and put only your map in the map rotation. It will be loaded as soon as a player connects.

Share this post


Link to post
Share on other sites

Hi guys

Thanks for your responses! So far, I think I understand now a little bit how and where scripts get executed. But another question have come up now:

I have a medic on the server, just standing around. This medic is always the same, so I initialized him on the serverside. But for I used "disableAI", the medic does some moves if my player shoots him down, however he won't die. Is this because "disableAI" was executed locally to the server and therefore won't take effect on the players machine?

If this is correct, this means that certain central things to have to be configured on every players join locally so he won't see anything else than the other players (only the commands that are not global).

Is this correct? And if so, why was it done like this? Why are server-side commands not always global?

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  

×