Open alainbryden opened 1 month ago
Additional context: This same error is what causes several of our tests to be flaky. If the game takes long enough to load, it can crash with this error (even the production game, if it takes super long and hits the right weird circumstances - I saw it happen once).
We really ought to fix this at the source (somehow).
Just capturing what's been discussed in Discord.
Player scripts invoked on startup (either because their running state is part of the save, or they are set as the startup script) can run before the game is fully initialized, and this can lead to an error if one of them triggers routing.
Normally, this error silently goes unnoticed (because the game's error handling isn't in place yet?), so the end-result is that the script that should have run on startup crashes and appears to have not run.
If the user script has any kind of error-handling though, they would catch an error like this:
Here's a sample script that can be used to reproduce the error fairly reliably just by running it, saving, then refreshing the game:
You might have to update the faction to one you've joined.
As discussed, some possible solutions are: