I’ve been working on a project where I am filling a locker with a random assortment of ‘evidence’ that the player will then go through and investigate. After looking through all of the evidence, they will make a decision about the ideology of the owner of the locker based on what they’ve seen. (Jock and Nerd to keep the concept playful and simple for now.)
I’ve now got as far as filling the locker with stuff. My problem now is that the name of each piece of evidence kind of gives away the detail. ‘Star Wars binder’ or ‘Basketball backpack’ already betrays too much; I want the player to have to examine each thing.
I’ve got a rule that adds some randomness about which kind of evidence gets selected and places it in the locker, and then I run that rule a bunch of times.
What I’d like to have is a way to rename the evidence once it’s placed in the locker as simply ‘evidence’ or ‘first evidence,’ (second, third, fourth) etc. And then when they examine the evidence, they’ll see the description which will then be the actual clue.
Or maybe there’s a way to suppress the printed name until it’s viewed?
And maybe that renaming or suppression happens as another rule when each item is entered into the locker?
Evidence is a kind of thing. Evidence can be nerdy, jockish, or ambiguous.
A binder is a kind of evidence.
A notebook is a kind of evidence.
A backpack is a kind of evidence.
A lunchbox is a kind of evidence.
The Star Wars binder is a nerdy binder. The description of the Star Wars binder is "It has a sticker that says 'may the force be with you' on it."
Could that ‘after examining binder’ rule revert the name back to its original name?
Or maybe there’s something in your first suggestion:
The printed name of a binder is usually “binder”; until it is examined.
If I create a table of precedent words as well (‘first’ ‘second’ ‘third’) then maybe I could use those precedent words as the temporary name substitution.
Something like
The printed name of a binder is usually “[precedent] binder”; until it is examined.
Or maybe that’s a logic I apply to the listing after it has been summoned by the fill-locker rule.
This is a rough example, but maybe something along these lines?
A thing can be examined or unexamined. Carry out examining something: now the noun is examined.
Sequence is a kind of value. The sequences are first, second, third, fourth, fifth, sixth, and unsequenced.
A piece of evidence is a kind of thing. Every piece of evidence has a sequence. A piece of evidence is usually unsequenced. Understand the sequence property as describing a piece of evidence.
Before printing the name of a piece of evidence (called item) when the item is unexamined:
say "[sequence] ".
A box is nowhere.
A notebook is a piece of evidence in box. The printed name of the notebook is "[if examined]notebook[otherwise]evidence[end if]".
A pencil is a piece of evidence in box. The printed name of the pencil is "[if examined]pencil[otherwise]evidence[end if]".
Lab is a room.
When play begins:
let item be a random piece of evidence in box;
now item is first;
now item is in Lab;
let item 2 be a random piece of evidence in box;
now item 2 is second;
now item 2 is in Lab.
The “Early Childhood” example in the documentation has examples of properties that can change during play.
I don’t think any of these solutions account for the “inherent” name of the object being a synonym for that object regardless of its current printed name. You may run into a situation where the first and third pieces of evidence are both binders, and after revealing only the first piece of evidence as a binder, a command like >X BINDER get the response “Which do you mean, the Star Wars binder or the third piece of evidence?”
(For a second I considered using the privately-named property, which denies “star” and “wars” and “binder” as synonyms of the Star Wars binder. I checked, and it turns out you can add and remove this property at runtime, which had never occurred to me before. But this option is complicated if binder, pencil, and so on are kinds, because now “binder” is inherently a synonym of the Star Wars binder whether it’s privately-named or not…)
Treating unexamined pieces of evidence and examined pieces of evidence as separate objects—switching them around sneakily—would account for both printed names and synonyms, but whether it would be cleaner overall remains to be seen:
The box is a thing.
The Star Wars binder is in the box. The Linda Ronstadt poster is in the box.
The locker is a thing.
A piece of evidence is a kind of thing.
The first piece of evidence is a piece of evidence in the locker.
The second piece of evidence is a piece of evidence in the locker.
Before examining a piece of evidence:
remove the noun from play;
let new evidence be a random thing contained by the box;
now new evidence is in the locker;
try examining new evidence instead.
It’s named list_filter_permits in the library. If you flip that flag in the middle of a “list the contents of…” routine you can probably get an object to incorrectly appear or not appear in the list. But it’s not maintained between turns, so just banging it in an action rule won’t affect anything.
Once again, thank you. (Ryan has already offered lots of ideas and supports to earlier iterations of this concept!)
The privately-named property might not be applicable (or too complicated for the use case) but this switcharoo of unexamined and examined evidence does sound viable so far. I think I’ll try to pursue this line at least so far. I think bg’s idea is interesting and I need to examine the documentation he points to as well, but this does address the possible confusion at the parser level that I’ve been worried about.
Just to circle back to the initial intent or question: the main thing I want to do is incentive the player to examine each item before deciding on it. This led me to not wanting to call the Star Wars Binder exactly that, because then the player doesn’t need to pick it up or examine in terms of assessing it’s ideological value. (At least, mostly. Some may consider Star Wars to be more neutral than nerdy these days! But hopefully the point makes sense.)
So if that’s the main thrust: ensuring they examine it before deciding, is the switcharoo the best method? Or is there already a built-in method to suppress the full name of a specific thing before it’s examined or picked up?
Something like:
In the locker you see an assortment of binders, notebooks, and a backpack.
^Examine a binder
You look more closely at one of the binders. You see [description of the Star Wars Binder.]
^Examine Locker
In the locker you see an assortment of binders, notebooks, and a backpack. One of the binders is a Star Wars Binder.
It looks like what you’d really be doing is modifying the list-contents-of-locker sequence:
A thing can be noted.
Before examining something:
now the noun is noted.
Instead of examining or searching the locker:
do some routine that generates a "you see an assortment of binders etc." sentence;
if the locker contains a noted thing:
say "So far you have noted [a list of noted things in the locker]."
This still will yield exchanges like “>X BINDER” / “Which did you mean, the Star Wars Binder, the Wolfman Jack binder, or the binder of botanical woodcuts?” unless you use some sort of switcheroo technique. OR modify the disambiguation rules in some fancy way I don’t know how to do.
Okay… I’ve tried the switcharoo technique, and though the game will compile, I don’t seem to be getting the behavior I’m looking for.
And I’ve also created ‘clues’ rather than ‘evidence’ because I’ve already got a lot of terminology in the code using evidence.
I tried making it a rule:
This is the investigate-clue rule:
remove the noun from play;
let new evidence be a random thing contained by the box;
now new evidence is in the locker;
try examining new evidence instead.
I’m successful at putting all the ‘evidence’ in the box and the clues in the locker.
A clue is a kind of thing.
The first clue is in the locker.
The second clue is in the locker.
The third clue is in the locker.
The fourth clue is in the locker.
The fifth clue is in the locker.
The sixth clue is in the locker.
The seventh clue is in the locker.
The eighth clue is in the locker.
The ninth clue is in the locker.
The tenth clue is in the locker.
Lastly, here’s how I’m trying to call the rule:
Before examining a clue:
abide by the investigate-clue rule.
I’ll keep poking at it, but let me know if anything obvious is missing in terms of what we’re trying to do with the switcharoo technique!
You’ve told Inform that a clue is a kind of thing, but Inform doesn’t know that “first clue,” “second clue,” etc. belong to that category. Try, for example,
A clue called the first clue is in the locker.
Also, as a safeguard ahead of a line like “a random X in some place,” you may want to confirm that there actually is an X in that place, or you could get a run-time error. You could just add “if there is a thing in the box,” for example, just above that line.
That did it! This is yet another reminder that I need to be really specific and focused with my terms… just because ‘clue’ is in the title, doesn’t mean it’s being classified as the thing. This is probably my most repeated hurdle in learning Inform 7.
I did try adding the ‘if there is a thing in the box’ to the rule, but got an error! Maybe I need that ‘if’ not inside the rule but elsewhere. I’ll replicate the error if that’s of any curiosity.
But also, check this out!
You can also see a box (closed), a locker (closed) and The Judge here.
x locker
You see nothing special about the locker.
open locker
You open the locker, revealing a violet pen, two indigo pens, a blue pen, the first clue, the second clue, the third clue, the fourth clue, the fifth clue, the sixth clue, the seventh clue, the eighth clue, the ninth clue and the tenth clue.
x first clue
The backpack is made to look like it is part of an imperial stormtrooper outfit.
i
You are carrying nothing.
x locker
In the locker are a Star Wars backpack, a violet pen, two indigo pens, a blue pen, the second clue, the third clue, the fourth clue, the fifth clue, the sixth clue, the seventh clue, the eighth clue, the ninth clue and the tenth clue.
I did get that bit to work! (At least I think so, I haven’t stress-tested it, but it’s not crashing and hasn’t affected the switcharoo technique.)
This is the investigate-clue rule:
remove the noun from play;
if number of evidence in the box > 0:
let new evidence be a random thing contained by the box;
now new evidence is in the locker;
try examining new evidence instead.