Based on the sentence I've highlighted in the quotation, I'd also expect this to be the case when a game based on a custom scenario was started.[2] on_init()
This step is only run when starting a new save game or for mods that are new to an existing one. During it, their LuaBootstrap::on_init handler is called to give the mod the chance to set up initial values that it will use for its lifetime. It has full access to the game object and its global table and can change anything about the game state that it deems appropriate.
Note that scenario scripts are treated like mods for this step. [My emphasis.] Also, no other events will be raised for a mod or scenario until it has finished this step.
Yesterday I've created a new game to test one of my mods. I used Creative Mod to research all technologies and placed down some entities. I then went into editor mode, used "Save as scenario", and started a new game based on that scenario. My mod logs the names and arguments of the functions and event handlers that are called. Grepping through the log, I got this sequence of events:
Code: Select all
factorio-current.log:942: Entered event script for on_load
factorio-current.log:1152: Entered event script for on_pre_player_removed
factorio-current.log:1188: Entered event script for on_player_removed
factorio-current.log:1202: Entered event script for on_configuration_changed
factorio-current.log:2428: Entered event script for on_player_joined_game
Found 5 matches for "Entered event script for".