A way to tell you're in a simulation during initial control.lua

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
i142857
Inserter
Inserter
Posts: 24
Joined: Mon Nov 04, 2024 9:56 am
Contact:

A way to tell you're in a simulation during initial control.lua

Post by i142857 »

The official way to tell if you're in a simulation is game.simulation. Unfortunately, game is not defined yet while control.lua is first run, so it's seemingly impossible to tell at that point if we're in a simulation or the real game.

Could you add some way to tell we're in a simulation earlier? I don't need the full LuaSimulation object, just a way to tell. (Oh and I'd love to hear that there is one already that I missed, thank you!)

My mod does some pretty advanced stuff while registering event handlers and I would like to do it slightly differently in simulations. Workarounds are possible, but a solution here would really make my life easier, so I'd appreciate it. If it's hard then no worries.
Post Reply

Return to “Modding interface requests”