Basic Plans by Nate Cull


This is a set of basic plans to go along with Planner.

Text of a demo game follows.

Example: ** Alchemy - A demo game showing use of these basic actions.

"Alchemy" by Nate Cull

The release number is 2.
The story creation year is 2006.
The story headline is "An Interactive Demonstration"

Include Basic Plans by Nate Cull.

The Laboratory is a room. The description of the Laboratory is "A chaos of glassware, dark sigils, spellcasting apparatus sprawled in disgusting confusion -- in other words, a perfectly normal research lab. A stone archway leads east and another south."

The Library is east of the Laboratory. The description of the Library is "The stony walls are racked with square miles of parchment volumes."

A curiously carved table is a supporter in the Library.

A rosewood bench is a supporter in the laboratory. "A rosewood bench, scarred and burned by years of incantations, fills half of the room."

An iron crucible is an open container on the rosewood bench. "Bob's crucible bubbles merrily on the bench."

A cupboard is a closed openable container in the laboratory. "A cupboard of great antiquity quietly blends into the corner shadows."

A plastic bag is a closed transparent portable openable container on the carved table.

A Chinese puzzle box is a locked lockable closed openable portable container in the plastic bag.

A pinch of ginger is a portable thing in the puzzle box.

A wicker basket is an open container in the cupboard.

An onion, a tomato, a stick of celery, a lemon and a banana are in the wicker basket.

Broth is a thing.

The basic putting things in containers rule does nothing when the desired relation is being-in and the desired param1 is broth and the desired param2 is the crucible.

Planning when the desired relation is being-in and the desired param1 is broth and the desired param2 is the crucible:
     plan 1;
     suggest being-in with the onion and the crucible;
     suggest being-in with the celery and the crucible;
     suggest being-in with the banana and the crucible;
     suggest being-in with the ginger and the crucible;

To decide whether soup is brewing:
     if the onion is not in the crucible, decide no;
     if the celery is not in the crucible, decide no;
     if the banana is not in the crucible, decide no;
     if the ginger is not in the crucible, decide no;
     decide yes;

Every turn when soup is brewing:
     if the crucible is visible, say "The crucible simmers; the contents meld into a rich pungent vegetable broth.";
     repeat with item running through things in the crucible begin;
         now item is nowhere;
     end repeat;
now broth is in the crucible;

The Alcove is a room.

The Alcove is south of the Laboratory. The description of the Alcove is "A tiny niche carved out of the stone, which opens out to the north."

A brass hook is a supporter in the Alcove. "Screwed into the stonework with grim determination is a shiny brass hook." The brass hook has carrying capacity 1.

A silver key is on the brass hook. The matching key of the Chinese puzzle box is the silver key.

Bob is a person in the laboratory. "The mighty wizard Bob potters around his domain."

The description of Bob is "Bob is carrying [if bob carries anything][list of things carried by bob][otherwise]nothing[end if]."

The basic dropping objects in rooms rule does nothing when the desired relation is being-in and the desired param1 is a person.

Every turn:
     have Bob plan an action for being-in with broth and the crucible;

Rule for deciding the concealed possessions of Bob:
     decide no;

Section - Custom Actions

Doing-asking-for is a planning-action.

Planning-acting when the planned action is doing-asking-for:
     try the planning actor trying asking the planned param1 for the planned param2;

Planning rule when the desired relation is being-touchable-by and the desired param2 is the planning actor and a person (called the owner) encloses the desired param1:
     plan 1;
     suggest being-touchable-by with the owner and the planning actor;
     suggest doing-asking-for with the owner and the desired param1;

The block giving rule does nothing when the second noun is Bob.

Section - Custom Messages

Instead of Bob trying asking the player for something:
     say "'I say, old chap,' mutters Bob. 'Do be a sport and give me [the second noun].'";
     now the action success flag is 1;

Planning-failure:
     say "Bob scratches his beard and looks perplexed.";

Planning-success:
     end the story finally saying "You have witnessed the Making of Soup";

Planning-acting-failure:
     say "'Arr, that didn't work,' says Bob. 'Reality be getting a mite thin.'";

Report Bob trying opening the cupboard for the first time:
     say "'Aslan sesameslan!' says Bob, flinging the cupboard doors wide open to reveal [list of things in the cupboard].";
     stop the action;

The previous take holder is an object that varies.

Before Bob trying taking something:
     now the previous take holder is the holder of the noun;

Report Bob trying taking something:
     if the previous take holder is not a room begin;
         say "Bob takes [the noun] from [the previous take holder].";
         stop the action;
     end if;

Section Changelog

Version 3/211124: Bug fixes per (https://intfiction.org/t/planner-basic-plans-npc-actions-are-invisible/10034/)

Fixed a typo in Alchemy example

Version 3/210620: Include Planner

This extension differs from the author's original version: it has been modified for compatibility with version 6L02 of Inform. The latest version of this extension can be found at <https://github.com/i7/extensions>.

This extension is released under the Creative Commons Attribution licence. Bug reports, feature requests or questions should be made at <https://github.com/i7/extensions/issues>.