Closed DavidKinder closed 2 years ago
Commit c62b00e0274c1f6f4db5d4ff84c762785f31f413 fixes SCREAM in Shades of Gray.
The problem is that SCREAM is included in AGiliTy's list of verbs that games should not be able to over-ride, yet Shades of Gray clearly does try to over-ride it, and it does seem to work in the AGT interpreter that comes with Shades of Gray. The above referenced commit treats SCREAM as a special case for the version of AGT used by Shades of Gray (and earlier versions), and allows it to be over-ridden.
The problem with SIGNAL is an interesting one. SIGNAL occurs twice in the definitions of "dummy verbs":
Dummy verb 10: hail, signal
Dummy verb 33: signal
That second definition looks to be a mistake, as no commands depend on dummy verb 33. If SIGNAL is parsed as being dummy verb 10, then it all works. But AGiliTy scans the verb table from the end backwards, on the sensible grounds that user definitions should over-ride system ones, which has the result that SIGNAL is parsed as dummy verb 33, which is why SIGNAL COMPANIONS does not work.
Looking at the Pascal source code for AGT 1.7, it's clear that the dummy verbs are laid out oddly in memory: first is dummy verb 1, then dummy verb 25, then dummy verb 2, then dummy verb 26, and so on, up to dummy verb 50. If the possible matches in the dummy verbs are parsed from the end backwards when they are in this order, SIGNAL will match dummy verb 10 first, making it all work.
One possible solution is to change how AGiliTy reads AGT files to have it not sort out the order of dummy verbs, and just use the order in the file, which matches the above odd order from the AGT Pascal source code. But that will most likely break every AGT game that has been converted to an AGX file, which is not ideal. Less elegant, but more practical, would be to try changing the order in which verbs are scanned when parsing.
Commit 9f02c7f876f6dbc838e5c509a7531b2c68eea2e7 changes the order of scanning dummy verbs during parsing for non-AGX games, to match the original AGT interpreters. With this SIGNAL COMPANIONS works.
I just tested this fix in Spatterlight, and it works! However, I noticed that my test file is in AGX format, which I suppose means that it shouldn't have worked. Not sure what is going on here.
I just tested this fix in Spatterlight, and it works! However, I noticed that my test file is in AGX format, which I suppose means that it shouldn't have worked. Not sure what is going on here.
The fix I went for in the end doesn't require rebuilding the AGX file, it just changes the order of dummy verb scanning. I may have misled you in the previous comment about "parsing for non-AGX games", what I meant to indicate was that the fix applied to AGT games, not any compiled with MAGX, which internally in AGiliTy is referred to as "AGX00" format. Confusingly, this is separate from the question of whether the game data is in an AGX file or not.
Thanks for the clarification. Great job with the fix!
I want to look at https://github.com/DavidKinder/Windows-AGiliTy/issues/15, and then it will probably be time to make a release of this, probably as AGiliTy 1.1.2.
At the start Shades of Gray, HOWL works, but SCREAM does not. In the original either end the intro section.
Later on in Shades of Gray, in the Sherwood Forest section, HAIL works, but SIGNAL does not. Both should be synonyms for "PUT GLASS ON WINDOW".