Selecting a thing from a subset

So out of all possible things in my game, I’m trying to randomize one item to be plot relevant (The “evidence”, or B). The idea is you need the evidence in order to complete the game.

But selecting from all items in the game is too much, so I wanted to designate a subset of things that the evidence can be pulled from (“proof” or A). In the source, the text reads

The sharp knife is proof.

I believe the source command to pull B from A is working, but when I try to test it, it generates an error. (I have a similar command in place to select a random NPC as “the thief”).

The action is as follows, and works fine without the evidence portion. It properly shows the thief. But it will not show the evidence. I’m hoping to resolve this test action as I would also like to drop [evidence] as a variable in conversations with NPCs.

Cheating is an action applying to nothing. Understand “cheat” as cheating.
Instead of cheating, say “The evidence is the [evidence] and the thief is [thief].”

The error it generates is "You wrote ‘say “The evidence is the [evidence] and the thief is [thief].”’ but ‘evidence’ is used in a context where I’d expect to see a (single) specific example of a sayable value, not a description.

You haven’t shown all of your code, but it sounds like you’re defining “proof” and “evidence” as properties that a thing can have. E.g.

A thing can be evidence.
A thing can be proof.

That’s fine, but it allows the possibility that several things (or no thing) can be evidence at any given time. So it doesn’t really make sense to refer to the evidence.

You could refer to a random evidence thing. This picks exactly one, and if only one thing in the game is currently evidence, it will be picked. But it sounds like you need a clearer statement of what you’re trying to do. Do you want to list all the evidence things, or can there never be more than one, or what?

1 Like

Apologies for the confusion. My intent is there will only ever be one piece of evidence selected or present in a game. To select one, I have the following:

When play begins:
now the evidence is a random thing that is proof.

Your correction to add a random evidence thing appears to have solved my initial issue (thank you) and now the game will compile and the test command will correctly display. But as I only want to ever have one piece of evidence is there a cleaner/more elegant way to go about that?

If you define the evidence as a variable, it should work:

1 Like