Normally if you forget to mark a Canvas reference with
transient, save a game, and attempt to load it, you get the error, "Attempt to instantiate abstract class Canvas." There's nothing unusual here, this is expected.
However, if there's a SkyViewpoint also present in the level, you instead get the following error:
Code: Select all
VM execution aborted: tried to read from address zero.
Called from SkyViepoint.OnDestroy at gzdoom.pk3:zscript/actors/shared/skies.zs, line 64
There doesn't need to be any F_SKY displaying the 3D skybox, the canvas can be completely unrelated to a skybox, and it doesn't have to be used anywhere in the map. All that is needed is a member variable of type Canvas somewhere in ZScript (so that it can be serialised), and a SkyViewpoint present somewhere in the map. What's more bizarre (and more severe) is that this prevents you from starting any map in the session, be it restarting the current map or even starting a stock Doom 2 map. The whole engine has to be restarted.
I've attached a simple example map with a handler that stores a Canvas reference in a variable and assigns it a texture. The map contains an F_SKY that shows a skybox, and the canvas is used directly in the level, assigned to a TEXTURES texture, but neither of those is necessary to cause the issue.
You can check this video too, showing the expected behaviour and then the unexpected one after adding a SkyViewpoint: