Initialization Order

From Bohemia Interactive Community
Revision as of 19:11, 28 November 2014 by SilentSpike (talk | contribs) (Includes Arma 3 information)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
This page is currently a WIP (Work in Progress) and not in a finished state

Introduction

Whenever a mission is launched (or joined in multiplayer) certain tasks are performed to ensure the mission's various components are initialized correctly and that everyone is synced in multiplayer games (particularly JIP players). Initialization order refers to the order in which those tasks are executed and it's important to take into account when setting up the start of a mission.

Event Scripts are a key part of a mission's initialization order and will be utilized often when working with SQF.

Arma 3

Be aware that a mission's initialization order is different depending on whether it's being ran in a single player or multiplayer environment.

Single Player

  1. Functions with recompile attribute are recompiled
  2. Functions with preInit attribute are called
  3. Object Init Event Handlers are called
  4. Object initialization fields are called
  5. init.sqs is executed
  6. init.sqf is executed
  7. Modules are initialized
  8. Functions with postInit attribute are called
  9. "BIS_fnc_init" variable is set to true

Multiplayer

The following is relevant to every machine including the server itself and headless clients. If the server is non-dedicated then it should be considered both a server and client.

Task Applies To JIP Related To
Functions with recompile attribute are recompiled All Functions Library (Arma 3)
Functions with preInit attribute are called All Functions Library (Arma 3)
Object Init Event Handlers are called All
Object initialization fields are called All
Persistent multiplayer functions are called Client BIS_fnc_MP
Modules are initialized All
initServer.sqf is executed Server Event Scripts
initPlayerLocal.sqf is executed Client Event Scripts
initPlayerServer.sqf is executed on the server Client Event Scripts
Functions with postInit attribute are called All Functions Library (Arma 3)
"BIS_fnc_init" variable is set to true All
init.sqs is executed All Event Scripts
init.sqf is executed All Event Scripts