Just to prove to everyone that I do sometimes solve problems on my own, I completed my rudimentary test of using tables to create a gnome character who moves the treasures outside the building into the building by following instrucitons from a table.
[code]“Treasures”
Building is a room. “You are inside a building, a well house for a large spring…”
End of road is a room. “You are standing at the end of a road before a small brick building.” End of road is west of Building. End of road is outside from Building.
The player is in building. The Gnome is a man in building. The Gnome has a number called G_Seq. The G_Seq of The Gnome is 1.
Persuasion rule for asking someone to try doing something: persuasion succeeds.
A treasure is a kind of thing. A treasure has a number called treasure_points.
Some treasures in the Building are defined by the Table of Treasure Scores. The description of a treasure is “[treasure_description]”.
Table 1.0 - Treasure Scores
Treasure Treasure_start treasure_points treasure_description
Gold nugget End of road 10 “Sparkly”
Diamonds Building 20 “Glittery”
Silver bars End of road 5 “Smooth and silvery”
Jewelry Building 5 “Assorted gems and trinkets”
Rare coins End of road 10 “Varied”
Emerald Building 25 “The size of a plover’s eg”
Platinum Pyramid End of road 30 “30 inches on a side”
Pirate’s Treasure Building 30 “Nondescript”
Check examining a treasure:
instead say “The [The noun], [description of the noun] is worth [treasure_points of noun].”
When play begins:
repeat with item running through treasures:
move item to the Treasure_start of item.
Table 2.0 - The Gnome’s actions
Gnome_moves Gnome_takes Gnome_drops
End of road – --
– Gold Nugget –
Building – --
– -- Gold Nugget
End of road – --
– Silver bars –
Building – --
– -- Silver Bars
End of road – --
– Rare coins –
Building – --
– -- Rare coins
End of road – --
– Platinum Pyramid –
Building – --
– -- Platinum Pyramid
Every turn:
let N be the G_Seq of The Gnome;
if N minus one is less than the number of rows in the Table of The Gnome’s actions:
choose row N in the Table of The Gnome’s actions;
if there is a Gnome_moves in row N of the Table of The Gnome’s actions:
let last space be the location of The Gnome;
if The Gnome can be seen by the player, say “The Gnome heads to [the Gnome_moves entry].”;
move The Gnome to the Gnome_moves entry;
if The Gnome can be seen by the player, say “The Gnome arrives from the [the last space].”;
if there is a Gnome_takes in row N of the Table of The Gnome’s actions:
try The Gnome taking the Gnome_takes entry;
if there is a Gnome_drops in row N of the Table of The Gnome’s actions:
try The Gnome dropping the Gnome_drops entry;
say “The Gnome is at turn sequence [G_Seq of The Gnome]”;
increase the G_Seq of The Gnome by 1.
[/code]
Though what you see is all you get I became interested in what it would be like to have friendly helper characters in Colossal Cave. Has anyone re-created any Inform7 versions of Colossal Cave with the source code provided? Failing that, if I do need to create the whole thing from scratch (time cosuming but not that difficult) does anyone know of any comprehensive maps of the game?