Page 1 of 1

[0.17] Event inconsistencies

Posted: Fri Apr 12, 2019 2:40 pm
by _Attila_
Not sure what is intended, but...

In on_init event, during game creation, game.print does nothing. When on_init is delivered on mod being added to a saved game, game.print works.

There is no way to get info on what is going on in on_load, as there is no game, so no way to log anything.

on_player_joined delivery is different depending on how many players have been added to an mp game:

ex:
Create mp (Host new game) game, save it, load it in mp, get on_player_joined.
Create mp game, save it, load it in single player, NO on_player_joined.
Create mp game, have 2nd player join (LAN), save game, load it in single player, get on_player_joined.

Just send on_player_joined under all circumstances, single player also. Would solve a lot of code being written trying to determine when a player has started a session.

Re: [0.17] Event inconsistencies

Posted: Fri Apr 12, 2019 2:57 pm
by Rseding91
Thanks for the report however none of those are inconsistencies. You can't print to a player that doesn't yet exist so when you do "game.print()" before the player has even joined the game it doesn't do anything. You can see the API documentation for game.print() says it prints to all of the players in the game. https://lua-api.factorio.com/latest/Lua ... ript.print