(WIP) Simple skills

Dunno if this has been done better, but we’re making a simple extension to restrict the actions of the player and other people in the setting.

Skills by Sunroses begins here.

A person has a list of action names called skills.

The all-skills-list is a list of action names that varies.

Definition: an action name is difficult rather than easy if it is listed in the all-skills-list.

Before doing something (this is the can't do something if unskilled at it rule):
	Let V be the action name part of the current action;
	If V is difficult and V is not listed in the skills of the player:
		Say "[We] [don't] know how to do that." instead.

Persuasion rule for asking someone to try doing something (this is the can't persuade an unskilled person rule):
	Let V be the action name part of the current action;
	If V is difficult and V is not listed in the skills of the person asked:
		Say "[The person asked] [don't] know how to do that.";
		Persuasion fails;

To restrict (A - an action name), with player knowing how:
	Add A to the all-skills-list;
	If with player knowing how:
		Add A to the skills of the player;

To teach (A - an action name) to (P - a person):
	Add A to the skills of P.

Skills ends here.

You can use the restrict phrase to make an action require a skill to use. For convenience we also added a phrase option to let the player have that skill by default.

Very silly example usage below.

Story code:

The Foyer is a room. James is a person in the foyer.

The ballroom is east of the foyer.

When play begins:
	Restrict the going action, with player knowing how.
	
Persuasion rule for asking someone to try doing something:
	Persuasion succeeds.

Results:

Foyer
You can see James here.

>james, go east
James doesn't know how to do that.

>go east

ballroom

>go west

Foyer
You can see James here.

>
2 Likes

I wonder, would it be better to use a relation here?

Knowledge relates various people to various action names.
The verb to know means the knowledge relation.

The player knows waiting.
The player knows looking.
The Pythia knows prophesying.
2 Likes

Oh we did try that, but we can’t. Inform apparently doesn’t like relations being applied very broad kinds like numbers and such, and actions and action names fall under that umbrella too.

2 Likes

Huh, I expected it for actions, but I’m actually really surprised for action names. Under the hood, action names are basically just an enumeration. That’s a really unfortunate limitation.

2 Likes

Yeah, for sure. We can work around it well enough here though i guess? Is there a way to make a verb like “know how to” check something other than a relation?

1 Like

There is:

Knowledge relates a person (called X) to an action name (called Y) when Y is listed in the skills of X.
The verb to know means the knowledge relation.

I’m not sure what the official name for these relations is, but they’re very useful sometimes.

If it’s just a property, you can do that without a relation:

A thing has a number called weight.
The verb to weigh means the weight property.
3 Likes