by Graf Zahl » Fri Nov 08, 2019 5:32 am
They'd be present, surely - but don't forget that during LevelCompatibility you do not have a working level! All you got is partially initialized data in a state a map manipulator can work with. For example, no actors have been spawned and no static int linedef types been set up, not to mention that the ACS VM is in a state of semi-limbo.
The actual level init happens after the compatibility processing is done.
In short: Running an event handler from in there most definitely qualifies as very much undefined behavior in the purest sense of that term. You may try but you have no guarantees what you get and even less guarantees that the behavior remains stable in future releases.
Better treat this class as a black box - using anything but its own function interface and the basic level structures (vertices, linedefs, sectors, sidedefs) should be considered unsafe and even with the level data, not all fields are guaranteed to produce useful results. It lies in the nature of its reason for existence that it is so limited, but with ZScript being closer to a real programming language than what game scripting normally allows, it is not possible to plug all these holes, at some point the safeguards will stand in the way of legitimate use cases.
They'd be present, surely - but don't forget that during LevelCompatibility you do not have a working level! All you got is partially initialized data in a state a map manipulator can work with. For example, no actors have been spawned and no static int linedef types been set up, not to mention that the ACS VM is in a state of semi-limbo.
The actual level init happens after the compatibility processing is done.
In short: Running an event handler from in there most definitely qualifies as very much undefined behavior in the purest sense of that term. You may try but you have no guarantees what you get and even less guarantees that the behavior remains stable in future releases.
Better treat this class as a black box - using anything but its own function interface and the basic level structures (vertices, linedefs, sectors, sidedefs) should be considered unsafe and even with the level data, not all fields are guaranteed to produce useful results. It lies in the nature of its reason for existence that it is so limited, but with ZScript being closer to a real programming language than what game scripting normally allows, it is not possible to plug all these holes, at some point the safeguards will stand in the way of legitimate use cases.