Two questions...


#1

In my game, I had few lines like this–

A new textbook is a thing. The description is "It's just a copy of the same textbook you use in proctology class[period] [if we have not examined the missing page]Maybe you can find the page that was missing from your textbook? You open the book to get a look, and indeed there it is--[otherwise]You open the book to read the page again--[end if][exmpage]". To say exmpage: try examining the missing page.

On the surface, it appears about right–but when you run it, it seems that only the second substitution–the otherwise–will print, whether you’ve examined the missing page or not. Why is this?

Second question is, what could it be about text substitutions, such the ones above, that could cause the ‘Rules on’ function to crash? I am aware that I have E. E.'s Epistemology included–could there be an interaction there that I’m not aware of? I tried the code above in a dummy game, and could not reproduce the crash–though it did reproduce the first oddity.

By the way, the following edit works perfectly, even with the ‘Rules on’ function–

A new textbook is a thing. The description is "It's just a copy of the same textbook you use in proctology class[period] [if we have not examined the missing page]Maybe you can find the page that was missing from your textbook? You open the book to get a look, and indeed there it is--[otherwise]You open the book to read the page again--[end if][no line break]". After examining the new textbook: try examining the missing page; continue the action.

Only curious about why that happened.
Thanks!


#2

When you EXAMINE something, Inform first checks to see whether the description of that thing is empty or not (i.e. compares it with the empty text). In doing so, it expands out all of the text substitutions, though without printing anything. That causes problems in cases, like this one, where those substitutions are causing things to change in the game world; because when Inform comes to actually print the description, it’s actually the second time those substitutions have been expanded.

This can be avoided using the “[if not expanding text for comparison purposes]” substitution. (I don’t think it’s documented in Writing with Inform, though it very definitely ought to be.)

A new textbook is a thing in XXX.  The description is "It's just a copy of the same textbook you use in proctology class[period]
  [if we have not examined the missing page]Maybe you can find the page that was missing from your textbook?  You open the
 book to get a look, and indeed there it is--[otherwise]You open the book to read the page again--[end if][if not expanding text
 for comparison purposes][exmpage]".

#3

Thanks JRB.

It’s not a big deal, but when I toggled on ‘Rules’ earlier, just to see what happened, the rules list stopped–it listed the first dozen-odd rules, then I think right after ‘[Rule “standard examining rule” applies]’ it cut right off and that side of the screen just went totally inactive (no command prompt, nothing), though I could continue other activity, and even re-compile and resume testing. Could it have locked up after doing that comparison?

Thanks.


#4

Sorry, no idea about that. Random computer glitch?


(Andrew Plotkin) #5

This will be easier if you define [exmpage] as “[description of the missing page]”. Then it won’t involve an examining action, so the condition “if we have examined the missing page” won’t be triggered.


(matt w) #6

This kind of sounds like something got messed up with the “more” prompt for when the output overflows the screen?


#7

Thanks, Zarf. You know, I could make the two objects(the new textbook and the missing page) the same thing by fusing their descriptions–right now one is a part of the other. Now that I think of it, the ‘new textbook’ has no importance of itself, and the player has no access to it until discovering the page is missing. In an earlier edit, this was not true–the player would have access to the new textbook, but no real reason to look at it–but I’ve changed those rules.

Thanks.


#8

Matt,

There was no overflow–it stopped mid-screen, each time I tried. Sorry.