Chapter 11: Out Of World Actions and Effects
11.4. Scoring

Not every work of IF allots a numerical score to the player: for some authors, this emphasises the idea of a game rather than a narrative. The simple sentence

Use no scoring.

abolishes the concept. Otherwise, Inform will provide built-in support for a single number measuring progress ("score"), and will expect to measure this against a maximum possible ("maximum score", which can either be set by hand or worked out automatically from a table of ranks).

An especially insidious style of bug allows the player to type the same sequence of commands over and over, earning score endlessly for the same insight, and to avoid this it is usually safest to write source like:

After taking the Picasso miniature for the first time: award 10 points; say "As they say in Montmartre: dude!"

If there are many "treasure" items like this, it is best to be systematic, as in No Place Like Home.

A single number does not really sum up a life, or even an afternoon, and Goat-Cheese and Sage Chicken and Panache offer more detailed citations.


122
*** Example  No Place Like Home
Recording a whole table of scores for specific treasures.

WI

Suppose we want to assign scores for a whole range of objects the player might pick up. One systematic way to do this would be with a table of point values for things:

"No Place Like Home"

The Hall of the Gnome King is a room. The emerald cow is a thing in the Hall of the Gnome King. The ivory chessman is a thing in the Hall of the Gnome King. The book of incantations is a thing in the Hall of the Gnome King.

Table of Point Values
item   score   
cow   10   
incantations   4   
chessman   1   

Report taking an item listed in the Table of Point Values:
    award score entry points;
    blank out the whole row.

Test me with "take all".

"Blank out the whole row" removes the line from the table, so that each award will occur only once. The player will not be able to earn more and more points by dropping and taking the same item again.

237
*** Example  Goat-Cheese and Sage Chicken
Implementing a FULL SCORE command which lists more information than the regular SCORE command, adding times and rankings, as an extension of the example given in this chapter.

WI
147
*** Example  Panache
Replacing the score with a plot summary that records the events of the plot, scene by scene.

WI


PreviousContentsNext