Smelling the air

[EDIT: Figured it out, with the help of the ACTIONS command! The solution is:
Instead of smelling a room, try airsmelling.]

I want the command “smell [nothing]” to be understood as smelling the air, but nothing I’ve tried seems to work:

The air is a backdrop. The air is everywhere.

airsmelling is an action applying to nothing.
Instead of smelling the air, try airsmelling.
Instead of airsmelling:
	say "Ahh, city air...*cough*[line break]".

[this is the problematic part...none of these work:]
Understand "smell [nothing]" as airsmelling.
Instead of smelling nothing, try airsmelling.
Instead of smelling anything:
	If the noun is nothing:
		try airsmelling;
		continue the action.
1 Like

You need to use Understand “smell” as air smelling.

There is no [nothing] grammar tag.


I had tried that before finding the “instead of smelling a room” solution (see my edit above) but it made it so that smelling anything resulted in airsmelling, and I still want the player to be able to smell other specific things.

Ah, you’re right. Serves me right for replying from my phone while on the bus.

Here’s a working example:

Lab is a room.

The ball is a thing in Lab.

Understand the command "smell" as something new.
Understand "smell [something]" as smelling.

airsmelling is an action applying to nothing.
Understand "smell" as airsmelling.

Report airsmelling:
	say "You smell onions.";

test me with "smell ball/smell".
1 Like

A minor point: The default definition of this action (and also the listening action) is for >SMELL with no noun provided to result in smelling <the location>.

You can define your own action, but you can also probably get the results you want by writing rules that use a room or description of rooms in their preamble. For example:

Definition: A room is smelly rather than fresh if...

Report smelling a fresh room:

Report smelling a smelly room:

The Standard Rules already includes a rule for supplying the missing noun for smelling. It sets the noun to the “visibility ceiling” of the actor, which is usually the room. The end result is, you don’t need to create a new action to handle smelling the room, you just need to add a rule to handle smelling the room.

Using Phil’s example:

Lab is a room.

The ball is a thing in Lab.
Instead of smelling the lab:
	say "You smell onions."

test me with "smell ball/smell".

And, if you expect to have many rooms with smells, you can do something like this:

A room has some text called the ambient odor.

Lab is a room. The ambient odor is "You smell onions".

The ball is a thing in Lab.

Check an actor smelling:
	if the noun is the location:
		if the ambient odor of the location is not "":
			say "[the ambient odor of the location]." instead.

test me with "smell ball/smell".

EDIT: Neither Phil’s solution, nor mine, by the way, addresses what happens if the player issues the command SMELL LAB or SMELL AIR.