Perhaps an easy one … how do I set the initial description of a person to be something more than “You can see … here” but only have it appear in this way the very first time?
Setting a more descriptive initial description in the definition prints it every time. I’ve tried to manipulate “printed name” with a rule, but that isn’t working.
By default, the initial appearance is used unless an object is “handled”. This property is set when the player picks up an object. So, it’s generally never set on a person (since they can’t be picked up).
The easiest way to change this is to set the “handled” property after describing the NPC.
To say set-handled: now the item described is handled.
The initial appearance of Bob is "[set-handled]Text here."
You might want to use the
if expanding text for comparison purposes check in this situation. I don’t know whether the initial appearance property is compared during the look action, but it’s good form.
To say set-handled:
unless expanding text for comparison purposes:
now the item described is handled.
Another approach is to use a “rule for writing a paragraph about” the person, and to set a flag that guarantees that that will only print once:
Parlor is a room. Alice is a woman in parlor. Hall is north of parlor. The player is in Hall.
Alice can be noticed. Alice is not noticed.
For writing a paragraph about Alice when Alice is not noticed:
say "You are surprised to see Alice here.";
now Alice is noticed.
Or you can just say –
Alice is here. She is a woman. "[One of]Alice, petite as her name might suggest, is here. But she is in full battle armor and armed with a broadsword, dagger, spiked feet and claws. And a look that can kill.[or]Alice is here, armed to the teeth.[stopping]". The description is....
When the player first sees Alice, either when the player enters the room and she is there, or does a ‘look’ when Alice comes in, the statement between [One of] and [or] will be printed. All other times, the second shorter statement will print. ‘[One of]…[or]…[stopping]’ can be found in the manual in S5.7–you can actually have it print more than 2 statements, it will print them each once in the order that you list them, but the last one will be printed every time when the options are exhausted.
In Inform 6: I use something like this.
location = conn_start;
move badge to player;
player.description = "A recent Phd grad from Maine Maritime, you have been
appointed as an assitant professor at the University
of North Florida (UNF). You recently received a grant
from the DoD to explore the ocean depths in an
Ah – the question was about Inform 7, and about describing NPCs, not the player.
I must be dense. I will refrain from participating in the future.
Thank you all! I’ve found a solution here!
@fos1 It’s OK, it’s a long tradition for Inform 6 questions to get Inform 7 answers on this board, so you’re owed a little payback!
Know the feeling! But I console myself that my coding pratfalls amuse others, and there’s a sufficiency of skilled coders here to offset my clumsiness, so no newcomers are harmed.