[I7] Creating new verbs

Looking at your post it looks like you are attempting to create a new action, I dont see exactly where you are creating verbs and using them (perhaps I overlooked it). I created a small example of picking a lock and then playing a message on a micro-recorder that was locked in the box. Playing is an action in the example and it is used in conjunction with the micro-recorder.

Indoors is a room.  There is a hairpin in Indoors.  
There is a screwdriver in Indoors.
The metal box is a locked container.  The metal box is in Indoors. 
The metal box is locked.  There is a micro-recorder in the metal box.

Playing is an action applying to one thing.
Understand "play [something]" as playing.

Instead of playing the micro-recorder:
	say "Get out, get out now... this message will self destruct in 10 seconds!!";
	
Instead of unlocking the metal box with anything (called pick):
	If pick is the hairpin:
		say "Your struggle but eventually pick the lock.";
		Now the metal box is unlocked;
	Otherwise:
		say "You try to pick the lock with the [printed name of pick] but it is no use.".

Regarding creating verbs (not new actions), I learned a little more about verbs myself when I saw some example code that defined left, right, atop, and under as verbs that could be used with objects in Inform7. The concept of directions just seemed to make it easier for me to understand. Once the right, left, atop, under relations are created you can use them to say different things like:

say "[item_i] is [if item_i is left of item_j] left [otherwise if item_i is right of item_j] right [otherwise] neither right nor left [end if] of [item_j].[line break]";

Here is the simple verb example I was talking about below. This code came from a larger thread talking about positioning objects in 2D coordinates in Inform7. I will link it below.


[Define a point.]

A point is a kind of thing.

[Define relations and verbs to use with points]

Leftness relates various things to various things.
The verb to be left of means the leftness relation.
The verb to be right of means the reversed leftness relation.

Atopness relates various things to various things.
The verb to be atop means the atopness relation.
The verb to be under means the reversed atopness relation.

[Define some points in the demo room]

Demo is a room.

point_a, point_b, point_c, and point_d are points in Demo.

[Orient the points]

point_a is right of point_b.
point_b is right of point_c.
point_d is atop point_a.
point_e is atop point_d.

[examine points]

Instead of examining a point (called temp):
	let item_i be a point;
	let item_i be temp;
	let J be the list of points;
	repeat with item_j running through J:
		say "[item_i] is [if item_i is left of item_j] left [otherwise if item_i is right of item_j] right [otherwise] neither right nor left [end if] of [item_j].[line break]";
		say "[item_i] is [if item_i is atop item_j] atop [otherwise if item_i is under item_j] under [otherwise] neither atop nor under [end if] of [item_j].[line break]";
	say "[line break]";
2 Likes