I have written my own ZMachine interpreter and am adding extra “mouse operable” features to reduce the amount of typing required. One of these features is to popup a list of objects currently available for the player to interact with.
I build my list by navigating the object tree for the current location and player, however I don’t want to show objects the player cannot yet “see” or interact with, (eg objects locked inside other objects) in order to reduce “spoilers”.
Each game seems to use a different Attribute No or property for this purpose even if they are of the same zcode version (eg 3). At the moment I have resorted to issuing “behind the scenes” a “look” and “inventory” command and redirecting the output to an internal variable that I then use for scanning comparison against my object list in order to try and determine visibility.
Whilst this works for the most part, I have to save the entire game state and restore it after each automatic command in order to ensure automated triggers (some causing death) and time/move counts are not effected as a result of these extra commands just to popup my list of objects. This of course has its own set of extra issues with synonyms for objects in the text which don’t always directly match the object names. (mostly worked around this)
I have even had my code try to analyse startup routines (as each game does its own look on startup) to try and identify attribute numbers to test.
So, here we come to my question :). Is there an easier, reliable, multi game friendly way for the interpreter to identify if an object is visible to the player so I can filter it from my list.
Any advice greatly appreciated