Is there a way to know if a map is a scenario or a freeplay?
single player or multi player?
freeplay or scenario
Re: freeplay or scenario
Freeplay is a scenario.mophydeen wrote:Is there a way to know if a map is a scenario or a freeplay?
In 0.15 a remote interface will be added to freeplay and sandbox, you can probably check for that.
Checking the count of LuaGameScript.players should be able to tell you. I'm not sure what this will look like if the game was started in multiplayer with only one player, though. Or if the game is considered to be multiplayer then.mophydeen wrote:single player or multi player?
Re: freeplay or scenario
I could start a multiplayer and play it alone. It's multiplayer but only 1 player ..daniel34 wrote: Checking the count of LuaGameScript.players should be able to tell you.
Re: freeplay or scenario
I probably edited my answer while you were writing yours, but yes, I didn't find a way to distinguish between a singleplayer game and a multiplayer game with 1 player (connected_players returns 1 in a singleplayer game).
The question is though: why would you need to do that? Factorio behaves the same way (from the API side) in both cases.
The question is though: why would you need to do that? Factorio behaves the same way (from the API side) in both cases.
Re: freeplay or scenario
daniel34 wrote: The question is though: why would you need to do that? Factorio behaves the same way (from the API side) in both cases.
on_join is not called in singleplayer