Page 1 of 1

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

Posted: Fri Apr 18, 2025 2:22 pm
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.