"for the first time" inside invented action

I’m trying to avoid using flags when “for the first time” would work. Trouble is, I can’t get it to work inside an action I created.

[code]Digging is an action applying to nothing.
Understand “dig” as digging.

Check digging:
If the player is in the basement,
say “There’s no place to dig here” instead.

Carry out digging:
If the player is digging in the North Lawn for the first time[/code]

Is there a syntax here that will work?

Thanks!

Incidentally, using “instead of” after the action definition meant that whatever was in that block happened despite my check rules.

Yeah, Instead rules are processed before Check – see the diagram in 12.2. “How actions are processed.” As far as the syntax for the above:Carry out digging in the North Lawn for the first time:

Hey Mike,

Thanks for the info…

Carry out digging in the North Lawn for the first time:

But suppose I want digging in the basement and the indoor rooms to give one error via check rules (“You can’t dig indoors”), digging in the North Lawn for the first time to unearth something, and digging in the North Lawn thereafter to be fruitless.

I couldn’t write “Carry out” twice, and I couldn’t think of a way to do a check that said something like “Instead of digging in the north lawn except for the first time”.

Wait, is it “after the first time”? I’m not sure if I tried that.

“more than once” or “at least twice”. (see chapter 7.16 in the manual)

Personally I would use the following structure:

[code]Check digging when the location is the North Lawn:
say “You’ve already unearthed everything of value.” instead.

Check digging when the location is the basement or the location is indoors: [assuming “indoors” is a property of a room]
say “You can’t dig indoors.” instead.

Check digging: [catches all other cases]
say “There’s no reason to dig here.” instead.

Instead of digging when the location is the North Lawn for the first time: [a special event]
say “You find a spork!”;
now the player carries the spork.[/code]

Thanks Nitku. Much better.

Similar situation:

Treasures are hidden everywhere, and they all have a similar name. What I don’t want is for the player to start up the game, enter a room, say “Take treasure” on pure whim, and be rewarded for that. So in most cases I have the treasure appearing, say in a container, only after she examines the container. This tends to work fine.

In one case I have a NPC carrying a treasure. I don’t want you to know that until you examine Suzy, so that you don’t walk into a room, ask for a treasure and get a response when you’ve bypassed the game play that leads you to know that Suzy is carrying it.

I started with “Rule for determinining the concealed possessions of Suzy: yes.”

But that meant:

x suzy
Suzy is carrying the red treasure.

Take red treasure
You can’t see any such thing.

So what I want is (sloppycode)

Instead of taking the red treasure:
if Suzy has been examined at least once,
say “Suzy won’t give it up easily”
otherwise,
say “you don’t see it here”.

and

Instead of asking Suzy for the red treasure
(same thing).

“Examined at least once” didn’t work and I couldn’t find a syntax that did.

I ended up doing this, which seems inelegant:

A person can be examined or unexamined.
After examining Suzy for the first time, now Suzy is examined.
If Suzy is examined, … game recognizes that you know about the treasure.

Is there a better way? I keep finding that most of my booleans aren’t necessary and are only making the code weirder, longer or harder to read.

Edited to add: The reason I don’t have Suzy’s treasure appearing only after you examine her is because I want to say
The description of Suzy is “[if Suzy carries the treasure]Suzy is carrying…[otherwise]Suzy looks like whatever”
I think there might have been another reason too. I’ll have to think about that.

The most “elegant” way that I can think of is

Rule for deciding the concealed possessions of Suzy: if we have examined Suzy, no; otherwise yes.

Oh jeez, that’s simple. Thanks Nitku!!!