Load-bearing space between conditionals-- what is even happening?!

Oh, this is a fun one! It comes down to how Inform decides if something has a description or not. Rather than just checking if the property is assigned, it evaluates the description of the object and checks if the result is the empty string. (This means that, if it only conditionally has a description, it’ll still say “You see nothing special…” instead of a blank line when that condition isn’t met.)

And when evaluating strings (rather than printing them), [first time] constructs aren’t evaluated, because presumably you want that text to appear when it’s first shown to the player, and not get used up on a random comparison deep in the guts of the library.

This means that, when the doodad is not known, the space makes the description evaluate to " " instead of “”, and " " is not the empty string, therefore the description should be shown.

To fix it, try using a [one of]First time text here[or][stopping] construction instead of a [first time]First time text here[only]. They’re treated slightly differently by the comparison mechanism, while displaying exactly the same.

Alternately, use this:

To say comparison shim:
    if expanding text for comparison purposes, say "~".

Now sticking a [comparison shim] anywhere in your description will ensure it always evaluates to a non-empty string, without affecting how it’s actually printed to the screen.

8 Likes