For now I store the playerIndex in the onBuilt event and use it afterwards. That seems to work ok for a single session, but I highly doubt that it will work after continuing a saved game, because the playerIndices probably changed.
If I didn't miss any built-in function I suggest that game.getplayer() don't raise an error, but return the local player instead.
But for now I'm moreintrested in workarounds
