Toggle search
Search
Toggle menu
Toggle personal menu
Editing
Modding/Startup Order
From Desynced Wiki
Read
Edit
Edit source
View history
Page
Discussion
More actions
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
Startup sequence (each step is performed on all active mod packages in dependency order where packages with no dependencies are called first): # Run the entry lua file of all active mod packages # When starting a new game, run the function package:setup_scenario(settings). This function can modify the settings table. This step is skipped when loading a save or joining a multiplayer game. # Load all files set in package:includes and call either package:init_ui() or package:init(). The function init_ui is not called when there is no local player (i.e. on a dedicated servre). Packages with init_ui are allowed to write to local variables defined outside of the function scope. # Call package:post_init() # When starting a new game, run the function package:on_world_spawn() # For the local player or any newly joining multiplayer players, run the function package:get_new_player_faction_id(faction_id) which can return a faction id to be used for that player (only called on server!). The passed faction_id will be nil on the first package this is called on. # When a new player faction is spawned or respawned, run the function package:on_player_faction_spawn(faction, is_respawn, player_faction_num) https://modding.desyncedgame.com/syntax.html#modpackage
Summary:
Please note that all contributions to Desynced Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Desynced Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)