Initialisation Order: Difference between revisions
SilentSpike (talk | contribs) (Includes Arma 3 information) |
SilentSpike (talk | contribs) (Merged page sections and added colour coding) |
||
Line 8: | Line 8: | ||
== Arma 3 == | == Arma 3 == | ||
Take note that the order of initialization is different in single player and multiplayer environments. If an entry is unmarked then it applies to both. | |||
== | {| class="bikitable" | ||
|- | |||
|+ Key | |||
!Item | |||
!Meaning | |||
|- | |||
|bgcolor="#95F0AD"| | |||
|Single Player Only | |||
|- | |||
|bgcolor="#95DEF0"| | |||
|Multiplayer Only | |||
|} | |||
In multiplayer the following is relevant to every machine including the server and [[Arma 3 Headless Client|headless clients]]. If the server is non-dedicated then it should be considered both a server and client. | |||
{| class="bikitable" | {| class="bikitable" | ||
|- | |- | ||
! | |+ Order of Initialization | ||
! | ! Task | ||
! | ! Applies To | ||
! | ! JIP | ||
! Related To | |||
|- | |- | ||
|Functions with ''recompile'' attribute are recompiled | |Functions with ''recompile'' attribute are recompiled | ||
Line 53: | Line 53: | ||
| | | | ||
|- | |- | ||
|Persistent | |bgcolor="#95F0AD"| init.sqs is executed | ||
|bgcolor="#95F0AD"| Single Player | |||
|bgcolor="#95F0AD"| | |||
|bgcolor="#95F0AD"| [[Event Scripts]] | |||
|- | |||
|bgcolor="#95F0AD"| init.sqf is executed | |||
|bgcolor="#95F0AD"| Single Player | |||
|bgcolor="#95F0AD"| | |||
|bgcolor="#95F0AD"| [[Event Scripts]] | |||
|- | |||
|Persistent functions are called | |||
|Client | |Client | ||
|✔ | |✔ | ||
Line 88: | Line 98: | ||
| | | | ||
|- | |- | ||
|init.sqs is executed | |bgcolor="#95DEF0"| init.sqs is executed | ||
|All | |bgcolor="#95DEF0"|All | ||
|✔ | |bgcolor="#95DEF0"|✔ | ||
|[[Event Scripts]] | |bgcolor="#95DEF0"|[[Event Scripts]] | ||
|- | |- | ||
|init.sqf is executed | |bgcolor="#95DEF0"|init.sqf is executed | ||
|All | |bgcolor="#95DEF0"|All | ||
|✔ | |bgcolor="#95DEF0"|✔ | ||
|[[Event Scripts]] | |bgcolor="#95DEF0"|[[Event Scripts]] | ||
|} | |} |
Revision as of 18:43, 28 November 2014
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
Take note that the order of initialization is different in single player and multiplayer environments. If an entry is unmarked then it applies to both.
Item | Meaning |
---|---|
Single Player Only | |
Multiplayer Only |
In multiplayer the following is relevant to every machine including the server 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 | ||
init.sqs is executed | Single Player | Event Scripts | |
init.sqf is executed | Single Player | Event Scripts | |
Persistent 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 |