Instead of doing something other than

[code]Touching is sensing. Smelling something is sensing. Tasting something is sensing. Examining something is sensing. Listening to something is sensing.

Instead of sensing when the noun is ethereal:
say “bla”.[/code]

This works fine, but if I instead alter it to:

[code]Touching is sensing. Smelling something is sensing. Tasting something is sensing. Examining something is sensing. Listening to something is sensing.

Instead of doing something other than sensing when the noun is ethereal:
say “bla”.[/code]

This gives the problem:

What am I doing wrong, and how can I achieve what I expected the problematic code to do?

[size=150]EDIT:[/size]

I’ll just describe what I actually want to do.

A player can be focusing a room, or focusing nowhere. Any items in the focused room are ‘ethereal’. Sensing is using any of the five senses. I want something that acts when the player tries to do anything other than sensing an ethereal thing whilst focusing a room.

I so far have:

[code]Focusing relates one person to a room. The verb to focus (he focuses, they focus, it is focused, he is focusing) implies the focusing relation. Focusing on is an action applying to one thing. Understand “focus on [any visited room]” as focusing on.

After deciding the scope of the player while the player is focusing a room (called the projection):
place the projection in scope.

Touching is sensing. Smelling something is sensing. Tasting something is sensing. Examining something is sensing. Listening to something is sensing.

Rule for reaching inside a room (called target) when sensing:
if the player is not focusing the target:
deny access;
otherwise if the player is holding the sensory orb:
allow access.

Definition: a thing is ethereal if it is inside the room focused by the player.[/code]

To answer the first part, it looks like you can’t use kinds of actions in conjunction with “doing something other than” although you can use a regular list like “Instead of doing something other than examining, smelling… etc.” As far as the rest, you appear to be on the right track. If you want the player to only be focused on one room at a time you must say “one room” not “a room” which implies various rooms. [code]Focusing relates one person to one room. The verb to focus (he focuses, they focus, it is focused, he is focusing) implies the focusing relation.

Focusing on is an action applying to one thing. Understand “focus on [any visited room]” as focusing on.
[/code]This is fine, except you haven’t fully created your action, just defined the grammar. When you say “the verb to focus implies…” the word “verb” means “verb I (as the programmer) am going to use to refer to this relation I just created.” This doesn’t connect it to the action which also happens to uses the verb (as in “verb a player will use to trigger this action”) focus. (Two different meanings of “verb” are at work here.) So add some rules (in this case, only the “carry out” is crucial):Check focusing on: unless the player carries the orb, say "You don't have the power to do that... yet!" instead. Carry out focusing on: now the actor is focusing the noun. Report focusing on: say "You are focused on [the noun].". You might also want to add something like this if you want the orb to be a requirement of the focusing power:After dropping, putting, inserting or giving the orb to: say "You've lost your focus on [the list of rooms focused by the player]."; now the player focuses nothing; continue the action.Now this code of yours will work:After deciding the scope of the player while the player is focusing a room (called the projection): place the projection in scope.Now you’ll be able to refer to things in the focused room in commands. However, as you’ve probably noticed, this only works for “examining.” “Tasting, smelling, etc.” require touchability, so (slightly varying your code):[code]Touching is sensing. Smelling something is sensing. Tasting something is sensing. Examining something is sensing. Searching something is sensing. Listening to something is sensing.

Rule for reaching inside a room when sensing:
allow access.[/code]Assuming you haven’t added any other scope rules, the only time you’ll be reaching into rooms is when you’re focused on it, so you don’t need to worry about that again in this rule. I also added searching since it seemed to fit what you’re doing and because when you examine a container without a description, the standard rules automatically redirect to searching (which looks inside). Now sensing works and trying any other action with an object in the focused room gives you the message “You can’t reach into the…” Add this to test it:[code]The Lab is a room. The box is an open container in the lab. The Orb is in the box.
North of the Lab is the Back.

Test me with “focus on back / focus on lab / get orb / n / focus on lab / x box / smell it / taste it / touch it / listen to it / get it / put orb in box / drop orb / x box”.
[/code]HTH :slight_smile:

Thanks, that’s been very helpful. From it I’ve been able to put together what I think I want:

Before doing something while the player is focusing a room (called the projection) and the sensory orb is held: if the noun is ethereal: if the current action is sensing: continue the action; otherwise: say "The orb does not react."; stop the action; otherwise: say "You lose focus and the image on the orb fades to the murky clouds."; now the player focuses nothing; continue the action.