I have a Hint system with a two-tiered Goal. That is, the Goal is available if I’m in the next room, there are multiple items in the hints list, one of which is a reference to another goal that is not available unless I’ve read the letter.
Thusly…
[code]topHintMenu: TopHintMenu ‘Hints’;
-
HintMenu ‘Testing the availability of hints.’
;
++ Goal ‘What's available to us?’
[
‘There's this.’,
‘There's that.’,
letterContents]
openWhenTrue = gPlayerChar.location == nextRoom
closeWhenTrue = letter.isIn(gPlayerChar)
;
+++ letterContents: Hint ‘You need to read the letter.’ [whatLetterSays]
;
++ whatLetterSays: Goal ‘What does the letter say?’
[
‘If the letter says this, then do this.’,
‘If the letter says that, then do that.’
]
openWhenTrue = letter.hasBeenRead
;
[/code]
And, indeed, when I view the hints in the game window, the only goal available at first is What’s available to us?.
When I view all of the available hints, I see…
…with You need to read the letter a simple, non-dynamic string. This is all as I believe it should be from my reading of the section on hints in Learning T3 Lite. The What does the letter say? Goal and its buried items are indeed hidden, since its openWhen condition is not yet true. However…
When I hit the enter key to return to the previous (top-level) menu, I see…
There it is, the What does the letter say? item that is supposed to be hidden at this point is available, and when I view that item, I see the hint text that is not supposed to be available until I’ve read the letter.
I’ve verified the value of letter.hasBeenRead (a property I have defined on the letter object) to be nil.
Here’s the test bed code…
][code]#charset “us-ascii”
#include <tads.h>
#include “advlite.h”
versionInfo: GameID
IFID = ‘445C38A3-AD1B-4729-957A-F584600DE5C1’
name = ‘test’
byline = ‘by Jerry Ford’
htmlByline = ‘by
Jerry Ford’
version = ‘1’
authorEmail = ‘Jerry Ford jerry.o.ford@gmail.com’
desc = ‘Testing Hints.’
htmlDesc = ‘Testing Hints.’
;
gameMain: GameMainDef
initialPlayerChar = me
paraBrksBtwnSubcontents = nil
;
me: Actor ‘me’ @room
“The main man.<.p>”
isHim = true
person = 2
;
room: Room ‘room’
“The room. <.p>”
east = nextRoom
;
nextRoom: Room ‘next room’
“The next room.”
west = room
;
-
letter: Thing ‘letter’
“The letter.<.p>”readDesc = “To Whom it May Concern: Blither blather and blah.<.p>
<<setHasBeenRead(true)>>”hasBeenRead = nil
setHasBeenRead(state)
{
hasBeenRead = state;
}
;
topHintMenu: TopHintMenu ‘Hints’;
-
HintMenu ‘Testing the availability of hints.’
;
++ Goal ‘What's available to us?’
[
‘There's this.’,
‘There's that.’,
letterContents]
openWhenTrue = gPlayerChar.location == nextRoom
closeWhenTrue = letter.isIn(gPlayerChar)
;
+++ letterContents: Hint ‘You need to read the letter.’ [whatLetterSays]
;
++ whatLetterSays: Goal ‘What does the letter say?’
[
‘If the letter says this, then do this.’,
‘If the letter says that, then do that.’
]
openWhenTrue = letter.hasBeenRead
;
[/code]
What have I missed?
Jerry