API Docs don't mention updates to SimulationDefinition
Posted: Wed Oct 23, 2024 2:27 am
eg, game.camera_position calls should now use game.simulation.camera_position
https://lua-api.factorio.com/latest/typ ... ition.html
Edit: Changes are alluded to here in the version history, actually:
In game, files like \Factorio\data\base\menu-simulations\menu-simulations.lua have already been updated to use game.simulation.whatever
I only happened to notice this when my game crashed (debugging my mod) and the "paused" view of my game world was replaced with a black screen that says "Cannot execute command. Error: LuaGameScript doesn't contain key camera_position."
Seems like menu simulations start running right after the game finishes crashing, even if it's still showing the crashed game's world.
https://lua-api.factorio.com/latest/typ ... ition.html
Edit: Changes are alluded to here in the version history, actually:
camera_position wasn't mentioned specifically, so I missed it.Added LuaSimulation available through LuaGameScript::simulation (read).
https://wiki.factorio.com/Version_history/2.0.0#2.0.8
In game, files like \Factorio\data\base\menu-simulations\menu-simulations.lua have already been updated to use game.simulation.whatever
I only happened to notice this when my game crashed (debugging my mod) and the "paused" view of my game world was replaced with a black screen that says "Cannot execute command. Error: LuaGameScript doesn't contain key camera_position."
Seems like menu simulations start running right after the game finishes crashing, even if it's still showing the crashed game's world.