assumed nouns

I’ve created a car and a “drive” verb which brings up a menu of potential destinations
Right now you have to type “drive car” or “drive volvo” and this is fine.
But how can I set it up so that if the player is in the presence of the car just typing “drive” will automatically fill in the “car” part?

The most straightforward way is to define a separate verb:

Vague-driving is an action applying to nothing.
Understand "drive" as vague-driving.

Instead of vague-driving:
	if the car is in the location:
		try driving the car;
	else:
		say "You are wheelless."

You can also set a single action up the way you want, using the “supplying a missing noun” activity.

I’d recommend using the “supplying a missing noun” activity as it’s simpler and creatig another action could mean you end up having to do everything twice. In order to use the “supplying a missing noun” activity, you will also need to include this.

Understand "drive" as driving.

Assuming you already have something like this.

Driving is an action applying to one thing. Understand "drive [something]" as driving.

The reason for this can be demonstrated here.

[code]“Test”

Rule for supplying a missing noun while locking:
now the noun is the standard door;
say “([the noun])[command clarification break]”.

Rule for supplying a missing noun while unlocking:
now the noun is the standard door;
say “([the noun])[command clarification break]”.

Rule for supplying a missing second noun while locking:
now the second noun is the key;
say “(with [the second noun])[command clarification break]”.

Rule for supplying a missing second noun while unlocking:
now the second noun is the key;
say “(with [the second noun])[command clarification break]”.

Understand “Lock” and “Lock [something]” as locking it with.

Understand “Unlock” and “Unlock [something]” as unlocking it with.

The Testing Room is A Room. A key is in the testing room. The key unlocks the standard door.

The standard door is a locked door. The Standard Door is south of The Testing Room. The Other Room is south of The Standard Door.

Test me with “unlock / lock / unlock door / lock door / unlock door with key / lock door with key / unlock door with key / s”.[/code]

Blanking out the two understand lines stops the “rule for supplying a missing noun” and “rule for supplying a missing second noun” activities from firing.

Hope this helps.

I aver that my example is simpler than yours. :slight_smile:

The point is that you don’t do everything twice; all the driving logic goes in the “driving” action. The only purpose of “driving vaguely” is identify an available vehicle and toss over to “driving”, or else print a failure message.

Thanks a lot! I’m gonna use the first way because it’s simpler but I’ll remember the second way if I ever need a more robust solution.

I have another problem and don’t want to make another thread (because if i let myself do that i’ll be posting new threads every day while i learn inform and clogging up the forum front page)

I made the car out of a thing (car from the outside) and a room (car from the inside) and then i linked them like so:

Instead of entering the volvo 340, now the player is in insidecar. Instead of going inside in location of volvo 340, now the player is in insidecar.
the player can open and look in the hood but they can’t prop it open with the metal rod, so any time they do anything except for looking at the engine or specifically closing the hood, the hood closes automatically

Hood open is a recurring scene. Hood open begins when opening the hood. hood open ends when the hood is closed. before doing something other than examining or closing during hood open: say "You let the hood go and it slams shut violently. You rub your greasy hands on the front of your jeans."; now hood is closed.
The problem is that when I try to enter the car, the hood closing message prints twice. I believe that this is because it fires once for entering/going in and again for being moved to insidecar. I was able to fix this by changing the rule to

before doing something other than examining, entering, going inside or closing during hood open:

so that it only prints once for “now the player is in insidecar” but my new problem is that if i try to go anywhere (south, east, whatever) it doesn’t print either

is there some special way to specify I want to allow “going inside” but not “going” anywhere else?

Movement between rooms also triggers the looking action (which is not listed in the conditions of exceptions to your before rule) – and it does so before the scene changing rules end the hood open scene. That is why the before rule runs twice.

You may want to add the looking action to the actions that do not trigger the ‘before doing anything’ rule, but whether or not you do so, it’s probably better not to make that rule dependent on a scene’s going on, but directly on the hood’s being open. Like so:

Before doing something [other than examining and closing &c] when the hood is open:

The important point here is that the scene-changing mechanism happens at the end of the turn. Scenes do not change in the middle of an action.