why setKnown() fails when setSeen() succeeds? (adv3Lite)

The PC walks into a hotel and proceeds to walk past the hotel clerk to get in the elevator.

The clerk challenges the PC—elevator is for hotel residents and their guests only. You have to have a key to proceed.

If this is the first time in the lobby and the PC can produce the required credentials, the clerk will take a key out of a drawer and set it on the counter. It’s now up to the PC to take the key or not. If you do, fine, good to go. If you don’t and you try to get on the elevator (or if you take the key, leave, drop it somewhere and return), the clerk will challenge you again.

But since you have already been offered a key, the response from the clerk needs to be different, so I need to test whether the key has been been seen or not.

That’s a bit of a problem for me, given that there are three different properties to test for—known, seen, or familiar—and I don’t understand the difference much less when each of them get set. What I do know, from breakpoint observation, is that they are not getting set the way I want them to be set at the time I think they should be set.

So I want to intervene with my own setEmAll() function…

    obj.familiar = true;

I’d be receptive to some education about how and when each of these three properties are set by the library, but that’s not really the topic of this thread (I’ll post another thread to pose that series of questions).

This post is about the TADS Runtime Error, function pointer required that I get when the setKnown() call is made. Note that the setSeen() call works, it’s the subsequent call to setKnown() that throws the error.

I don’t get it. What function pointer am I missing? The relevant functions are defined in thing.t at line 3485…

    /*  Mark the player character as knowing about us (i.e. this Thing) */
    setKnown() { gPlayerChar(setKnowsAbout(self)); }

…and 3491…

    /*  Mark the player character as having seen this Thing. */
    setSeen() { gPlayerChar.setHasSeen(self); }

Neither one takes an argument. What do I need to add, and where do I add it?


Looks to me like this is a bug/typo in the library code. It should clearly be:

setKnown() { gPlayerChar.setKnowsAbout(self); }

I’ll make the change in the library for the next release, but in the meantime you might like to try changing it in your own copy of the library.