Considering Actions

I’ve been trying to make a game little to no restrictions, so that if you wish to eat your couch or jump off the roof, you will do just that (with limited success and plenty of consequences, of course). So, instead of the game actually stopping you from doing rediculous things, I resolved to just add some action, called Considering. That is, typing “consider eating cabbage” will give you some text concerning the actors opinion on cabbage eating; likewise, “consider standing” will give you the actors sentiments on standing.

Or in less words, I’m trying to make the ability to examine an action.

I began with: An action has some text called the considerations. The considerations of an action is usually "Very simple." Report considering something: if the considerations of the noun is "Very simple.": say "Why not?" otherwise: say "[the considerations of the action]"But I ran into trouble when I got to making what “considering” is. I turned round and round “Considering is an action applying to an action”, but I can’d find a way.

How could this be done :question: That is, without writing a new “consider” for each and every possible action in the game.

Understand tokens can’t take whole actions like that, because the action and 2 nouns are stored in global variables. Instead, you have to work around it. Think of “consider” as a prefix.[code]
Currently considers is a truth state that varies.
What’s being considered is a stored action that varies.

After reading a command:
now currently considers is whether or not the player’s command includes “consider”;
if currently considers is true, cut the matched text.

Before an actor doing something when currently considers is true:
now what’s being considered is the current action;
try the actor considering instead.

Considering is an action applying to nothing.

Check an actor considering when what’s being considered is eating something inedible: say “Are you sure you want to eat [the noun part of what’s being considered]?” instead.
[/code]

I didn’t test that, but I assume you can figure it out from there?

Ah, that should be: Before an actor doing something except considering when currently considers is true: to prevent a loop.

Ron, your solution is very clever!

Acavado, note that you will still need to do substantial work to get this acting how you want it. If you don’t expand the grammar for all actions, input will have to look like this:

…which is pretty poor grammar. To get input like “consider eating the pen”, which is what you’re after, the grammar of each command we want to be able to consider will need to be expanded to include the present participle (-ing). This code demonstrates, and fixes a minor issue with the “after reading a command” rule:

[code]Lab is a room. The pen is in the Lab.

Currently considers is a truth state that varies.
What’s being considered is a stored action that varies.

After reading a command:
now currently considers is false;
if the player’s command includes “consider”, change currently considers to true;
if currently considers is true, cut the matched text.

Before an actor doing something except considering when currently considers is true:
now what’s being considered is the current action;
try the actor considering instead.

Considering is an action applying to nothing.

To decide whether we are considering:
if currently considers is true, decide yes;
decide no.

Instead of an actor considering when what’s being considered is jumping:
say “Wouldn’t achieve much.”

Check an actor considering when what’s being considered is eating something inedible: say “Are you sure you want to eat [the noun part of what’s being considered]?” instead.

Understand “jumping” as jumping when we are considering.
Understand “eating [something]” as eating when we are considering.

[/code]

Adding all of these participles will be a lot of work, but I don’t think there’s you can get what you’re after any other way. The index should help you track down all the grammar and input variations, though maybe someone else out there has already distilled the actions defined in the Standard Rules into a an easily referenced form?

–Erik