freeplay or scenario

Place to get help with not working mods / modding interface.
daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: freeplay or scenario

Post by daniel34 »

mophydeen wrote:Is there a way to know if a map is a scenario or a freeplay?
Freeplay is a scenario.
In 0.15 a remote interface will be added to freeplay and sandbox, you can probably check for that.
mophydeen wrote:single player or multi player?
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.
quick links: log file | graphical issues | wiki
mophydeen
Filter Inserter
Filter Inserter
Posts: 529
Joined: Sun Nov 22, 2015 5:02 pm
Contact:

Re: freeplay or scenario

Post by mophydeen »

daniel34 wrote: Checking the count of LuaGameScript.players should be able to tell you.
I could start a multiplayer and play it alone. It's multiplayer but only 1 player ..
daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: freeplay or scenario

Post by daniel34 »

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.
quick links: log file | graphical issues | wiki
mophydeen
Filter Inserter
Filter Inserter
Posts: 529
Joined: Sun Nov 22, 2015 5:02 pm
Contact:

Re: freeplay or scenario

Post by mophydeen »

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
Post Reply

Return to “Modding help”