2
« on: February 10, 2025, 05:59:38 AM »
The Game class needs a game-specific implementation, right? And that's LSL6, script 0 export 0. That's where saved games get their filenames from and all that.
That game also needs to be referred to in order to control it, so there's a global variable, usually the second (#1, starting at 0), and that needs a name. Variable names aren't stored in the compiled script data so a decompiler has to make a best guess. Now, you could just look for when that particular variable is first used and see how it's used. For example, it could be used as a pointer to a class or instance, so you name it after that class. And it's a global variable so you put a g in front.
A given decompiler may be smart enough to know that all SCI games from a certain period have a similar set of global variables and preset the start of the list to be gEgo, gGame, gCurRoom etc. If so, it'll already know to use gGame way before it's first used. If it didn't, it'd make a best guess and end up with gLSL6 or whatever script 0 export 0 is called.
Same with for example gEgo: if the game has multiple playable characters like LSL5, the first use of global 0 could be best-guessed as gLarry, and suddenly any scripts involving Patti as a playable character make no sense. Hence the hard-coded list.
Plus, there may not be a hard-coded list for that one particular period, so it already knows it's gGame for one set of games, but has to guess for another.
And on top of all that, the whole "put a g in front if it's a global" is not law, so Eric is perfectly within his rights to use theGame. After all, it's what the original code as written by the Sierra devs used!
So yeah, (gLSL6 hideControls:), (theGame hideControls:), (gGame hideControls:), and (global1 hideControls:) are all doing the exact same thing, just with a different name. That's what you get when you mix and match different decompilations. Wack, isn't it?