Skip to content

Mission initialization

Broström.A | Evul edited this page Nov 12, 2023 · 30 revisions

cScripts make use of CBA pre and post-init this to allow usage of CBA Settings.

The pre init hold the CBA Settings and global variables allowing eden to access them. This also means that code can be loaded in eden editor. The ACE Arsenal loadouts is one such example.

On mission start the pre init is loaded setting up the global variables. Then Init is executed, after this post init.

NOTE In a single player environment init runs twise. First time before pre init and then after. This means that you need a check to stop this from loading in sp.

When on the map screen more or less everything is setup. When you launch, your loadout is applied togheter with your abilities.

Initialization order

Here is the basic initialization order when mission is loaded on the server.

  1. Mission load screen
  2. cScripts Pre-init
  3. Init
  4. Object init fields
  5. cScripts Post-init
  6. Mission map screen
  7. Player Loadout is applied (First load)

Player init

Once the mission have reached the mission screen the loadout is applied to the players. If you join a server mid mission this will be applied once you selected a spawn or when you exit the map.

See also