Second row of table not working

I copied a table from the source examples (shown below). I am stymied. After the first row, I7 does not recognize any more rows of the table as valid. I cannot see a distinction between my table and the source table from Bosch, section 11.4 of Recipe Book. (This posting editor removes the tab char from the source code, even when inside a code block. Notice how it destroyed Bosch’s source.]

Table of XP
relevant action 	point value	turn stamp
examining backpack	2	-1
burning the unlit torch	2	-1
taking the spear	10	-1

Bosch, from section 11.4 of Recipe Book

Table of Valuable Actions 
relevant action
point value
turn stamp
taking the emerald leaf
15
-1
eating the gilded lily
5
-1

Any help would be greatly appreciated.
-Falsoon

The problem is “burning the unlit torch”, which isn’t quite a proper action description. Inform lets you write rules like “instead of burning the unlit torch” or “instead of burning something when the player is in the Library”, but an action description used as a value in and of itself needs to be more specific than this. It needs to be an action name, an actor, a noun, and a second noun. So “burning the torch” is valid (action = burning, actor = player, noun = torch, second noun = nothing) but “burning the unlit torch” isn’t (action = burning, actor = player, noun = torch, second noun = nothing, ??? = unlit).

Daniel,
Thanks for the quick reply. I don’t understand well when an action is specific enough (I get this error frequently.) Actions require objects as nouns, instead of kinds. Is that right? I also tried “burning the torch”, but that did not work either. Perhaps because I made torch a kind of thing, so therefore it is still generic?
It seems to me that “unlit torch” is more specific than “torch.”

I got a small table compiled for a few other entries, but even then, scores were not increased when the action was there. It was like the action performed by the player could not be found in the table. I compiled the Bosch example and it worked, so I can’t distinguish the difference between the working example and my story. Very frustrating. I would like to give scores for items found, puzzles solved, and rooms entered for the first time. The table should solve the first case, but will it work for the latter two? If not, I may have to go through the source and add these scores individually by hand. Any suggestions?

Side note: Interestingly, “lighting the torch” didn’t work, even as an action during the game. I always had to say “burning” instead of “lighting”. Not sure why the synonym would break down.
Thanks for your response. It was helpful.
-Falsoon

Could you post a stripped-down but compilable version of your code that shows the error? That’ll make it easier to diagnose. But yes, unfortunately kinds of things are too generic for this, and if “a torch” is a kind of thing, then “an unlit torch” is still a description of things, not a specific individual item that can be pinpointed at compile time.

Daniel,
Here is the full code extracted. It does compile. I was able to get the backpack to score when examined, but not the torch to score when lit.
I also got a few specific items to work, so I think I am good there. (I commented out the items I think I can get working.) The problem is getting the score to work with the torch. Notice that torch is a kind of thing, and a starter torch is what I used for specificity, and put it into the player’s backpack. I can pull the torch and light it, but it does not score. It does not seem to recognize a starter torch in the table with the starter torch being lit.
-Falsoon

"MyTableTest" by Falsoon
Example Location is a room. 
Use scoring.
The maximum score is 50.

[ACTIONS AND POINTS DEFINED FOR SCORING]	
Table of XP
relevant action 	point value	turn stamp
examining backpack	2	-1
burning a starter torch	2	-1

[taking the spear	10	-1
taking bandolier	5	-1
taking throwing knife	5	-1
taking spear	10	-1
taking scroll	10	-1
examining human fighter	1	-1
examining dwarf fighter	1	-1
examining dwarf thief	1	-1
examining big orc	1	-1
examining small orc	1	-1
examining wizard	1	-1
putting throwing knife in bandolier	5	-1
entering secret door	2	-1
opening hulking door	3	-1
]

test pack with "open pack / x backpack".
test torch with "open pack / get torch / light torch".

When play begins: 
	now the left hand status line is "SCORE: [score] / [maximum score]";
	now time of day is 8:00 PM;
	now the right hand status line is "Time: [time of day]";
	now the command prompt is "> ";

After doing something:
	repeat through Table of XP:
		if current action is the relevant action entry and turn stamp entry is less than 0:
			now the turn stamp entry is the turn count;
			increase the score by the point value entry;
	continue the action.
	
Understand "full score" or "full" as requesting the complete score.
Requesting the complete score is an action out of world.

Check requesting the complete score:
	if the score is 0, say "You have not yet achieved anything of note." instead.

Carry out requesting the complete score:
	say "So far you have received points for the following: [line break]";
	sort the Table of XP in turn stamp order;
	repeat through the Table of XP:
		if turn stamp entry is greater than 0:
			say "[line break][relevant action entry]: [point value entry] points";
	say line break.			


Section -- Torches

A torch is a kind of thing. 
A torch can be lit. A torch is usually not lit. Understand "lighted" or "flaming" or "burning" as lit.
The description of a torch is "[if lit]The torch's bright flame gives off light and heat.[otherwise]The torch is a normal wooden stick about two feet long with a greasy bulbous end.".

Before printing the name of an unlit torch, say "unlit ". 
Before printing the name of a lit torch, say "flaming ". 

test notorch with " x torch / get torch / x torch".


[Burning a torch, lit or unlit.]
Instead of burning the noun: 
	if noun is not carried by the player :
		say "You do not have the [noun][paragraph break]";
	otherwise if noun is lit torch :
		say "It is already lit.";
	otherwise if noun is an unlit torch : 
		now noun is lit;
		say "The torch flares up, and its bright flame gives off light and heat.";

test torchon with "get torch / x torch / light torch / x torch".

Section -- The Player
The carrying capacity of the player is 3.
The player is wearing a backpack and a dagger.

The backpack is a player's holdall. 
The backpack is wearable and closed. 
The backpack contains a starter torch.
Understand "pack" as backpack.

Starter torch is a torch. It is unlit.
The printed name of a starter torch is "torch".

The description of dagger is "It has a 12 inch, well-balanced blade, recently sharpened by the town[']s blacksmith. The handle is fine leather. You are very proud of it.".

The description of backpack is "This is the standard adventurer[']s backpack. It is made with sturdy fine-grain canvas, comes with multiple compartments and tardis-like features. It is made by the XYZZY Company. It can hold more than you think it can.".

Before examining something:
	if player wears noun:
		say "You take off the [noun] that you are wearing so that you can examine it better.";
		now player carries noun

Daniel,
Here is the full code extracted. It does compile. I was able to get the backpack to score when examined, but not the torch to score when lit.
I also got a few specific items to work, so I think I am good there. (I commented out the items I think I can get working.)
The problem is getting the score to work with the torch. Notice that torch is a kind of thing, and a starter torch is what I used for specificity,
and put it into the player’s backpack. I can pull the torch and light it, but it does not score. It does not seem to recognize a starter
torch in the table with the starter torch being lit. I apologize if some of the code is missing. The full editor is not as wide as this submit window.
I would prefer to attach a file instead of including this much code. It is as small as I could get it.
-Falsoon

"MyTableTest" by Falsoon
Example Location is a room. 
Use scoring.
The maximum score is 50.

[ACTIONS AND POINTS DEFINED FOR SCORING]	
Table of XP
relevant action 	point value	turn stamp
examining backpack	2	-1
burning a starter torch	2	-1

[taking the spear	10	-1
taking bandolier	5	-1
taking throwing knife	5	-1
taking spear	10	-1
taking scroll	10	-1
examining human fighter	1	-1
examining dwarf fighter	1	-1
examining dwarf thief	1	-1
examining big orc	1	-1
examining small orc	1	-1
examining wizard	1	-1
putting throwing knife in bandolier	5	-1
entering secret door	2	-1
opening hulking door	3	-1
]

test pack with "open pack / x backpack".
test torch with "open pack / get torch / light torch".

When play begins: 
	now the left hand status line is "SCORE: [score] / [maximum score]";
	now time of day is 8:00 PM;
	now the right hand status line is "Time: [time of day]";
	now the command prompt is "> ";

After doing something:
	repeat through Table of XP:
		if current action is the relevant action entry and turn stamp entry is less than 0:
			now the turn stamp entry is the turn count;
			increase the score by the point value entry;
	continue the action.
	
Understand "full score" or "full" as requesting the complete score.
Requesting the complete score is an action out of world.

Check requesting the complete score:
	if the score is 0, say "You have not yet achieved anything of note." instead.

Carry out requesting the complete score:
	say "So far you have received points for the following: [line break]";
	sort the Table of XP in turn stamp order;
	repeat through the Table of XP:
		if turn stamp entry is greater than 0:
			say "[line break][relevant action entry]: [point value entry] points";
	say line break.			

Section -- Torches
A torch is a kind of thing. 
A torch can be lit. A torch is usually not lit. Understand "lighted" or "flaming" or "burning" as lit.
The description of a torch is "[if lit]The torch's bright flame gives off light and heat.[otherwise]The torch is 
a normal wooden stick about two feet long with a greasy bulbous end.".

Before printing the name of an unlit torch, say "unlit ". 
Before printing the name of a lit torch, say "flaming ". 

test notorch with " x torch / get torch / x torch".


[Burning a torch, lit or unlit.]
Instead of burning the noun: 
	if noun is not carried by the player :
		say "You do not have the [noun][paragraph break]";
	otherwise if noun is lit torch :
		say "It is already lit.";
	otherwise if noun is an unlit torch : 
		now noun is lit;
		say "The torch flares up, and its bright flame gives off light and heat.";

test torchon with "get torch / x torch / light torch / x torch".

Section -- The Player
[All things carried by player must be defined before using them here.]

The carrying capacity of the player is 3.
The player is wearing a backpack and a dagger.

The backpack is a player's holdall. 
The backpack is wearable and closed. 
The backpack contains a starter torch.
Understand "pack" as backpack.

Starter torch is a torch. It is unlit.
The printed name of a starter torch is "torch".

The description of dagger is "It has a 12 inch, well-balanced blade, recently sharpened by the 
town[']s blacksmith. The handle is fine leather. You are very proud of it.".

The description of backpack is "This is the standard adventurer[']s backpack. It is made with sturdy fine-grain 
canvas, comes with multiple compartments and tardis-like features. It is made by the XYZZY Company. It can 
hold more than you think it can.".

Before examining something:
	if player wears noun:
		say "You take off the [noun] that you are wearing so that you can examine it better.";
		now player carries noun

The reason lighting the torch isn’t scoring is that lighting the torch gets handled by an “Instead” rule and scoring gets handled by an “After” rule. “Instead” rules interrupt action processing unless a “continue the action” phrase is executed (see §7.2 of Writing with Inform), so the “After” rule never runs. You can see what’s going on if you type “rules” before trying “light torch”:

The rule processing jumps straight from the Instead rule to the turn sequence rules, skipping your After rule.

A simple fix in this case is to change your “After doing something” rule to an “Every turn” rule–those rules will run no matter what happened with the action processing. Though that might not yield the results you want in every case–with an action like “examining the backpack” you might well not want the player to score points for trying to examine the backpack and failing (in darkness, for instance).

(By the way, it’s a good idea to copy-paste your code into code tags instead of converting the tabs to spaces. Even though the tabs may look messed up, it will still be possible for other people to copy the code into their Inform applications and run it–if you convert the tabs to spaces, anyone who wants to test your code has to reconvert, and in cases where the indentation is important it can lead to confusion.)

Matt,
Thanks so much for this. To my naive understanding, these are nuances that are not clear to me in learning INFORM.
I appreciate the advice.
-Falsoon