Issue #25517: DNMasterQuest - Inappropriate condition checks on ElevatorGoingUpDownScene
This scene plays the "Going Up" and "Going Down" lines when an elevator starts moving. It is used by any and all elevators and load elevators in this game.
To discern which line to play, the two dialog topics on this scene (one for "Going Up", the other for "Going Down" ) have to check which state the elevator is in (i.e. whether it's at its top or at its down position) when it starts moving (because that's when the scene is called from ElevatorMasterScript and LoadElevatorMasterScript, respectively)..
However, load elevators and normal elevators are stroing this information in different variables because they are running entirely different scripts:
(1) Normal elevators store the information in the bElevatorIsAtTop bool on ElevatorMasterScript. This bool is flagged as conditional, so can be used in condition checks.
(2) Load elevators store the information in the LoadElevatorDown global.This global is used by any and all load elevators in the game.
Using the same global for all load eleavtors does usually not cause any conflicts (at least not in elevator handling) because the player can't use more than one elevator at a given time. It creates a problem for the condition checks on the aforementioned scene dialog topics though. The check for the "Going Down" line are currently looking as follows:
GetGlobalValue LoadElevatorDown == 1.0000 OR GetVMScriptVariable elevatormasterscript, bElevatorIsAtTop == 1.0000 AND GetGlobalValue LoadElevatorDown != 0.0000
This only works for load elevators. If the elevator is not a load elevator, the global can have any value (it:s unpredictable), so the first check may return 'true' even if no load elevator is used, and as a result, the elevator announcer will not say the right line.
HasKeyweord UFO4P_IsLoadElevator == 1.0000 AND GetGlobalValue LoadElevatorDown == 0.0000 OR HasKeyweord UFO4P_IsLoadElevator == 0.0000 AND GetVMScriptVariable elevatormasterscript, bElevatorIsAtTop == 1.0000