I had the idea a while back to create a “metroidvania” style game in Inform, with equipment-based progression being the rule of thumb. First, I decided to make an “Equipment Testing Facility” for coding how the equipment would work independent of any puzzles, so I can work on the puzzles with knowledge of what the equipment will do.
Where I’ve run into trouble is with making a grappling hook item. What I want this item to do is allow the player to traverse certain gaps, preferably within rooms. In order to have this, I’ve realized I need a way to create gaps in rooms. This is what I have so far:
[code]Equipment is a kind of thing. Equipment can be equipped or not equipped. Equipment is usually not equipped.
Carry out taking equipment:
say “[Noun] taken.”;
try silently examining the noun.
After taking something:
try silently equipping the noun.
Equipping is an action applying to one thing. Understand “q [something]”, “equip [something]”, and “put on [something]” as equipping.
Carry out equipping a thing:
if the noun is not equipment, say “You can’t equip that.”;
if the noun is equipment:
if the noun is equipped:
say “You’ve already equipped that.” instead;
if the noun is not equipped:
now the noun is equipped;
say “[Noun] equipped.”.
Unequipping is an action applying to one thing. Understand “unequip [something]” and “take off [something]” as unequipping.
Carry out unequipping a thing:
if the noun is not equipment, say “That can’t even be equipped, much less unequipped.”;
if the noun is equipment:
if the noun is not equipped:
say “That’s not equipped.”;
if the noun is equipped:
now the noun is not equipped;
say “You remove [the noun] with no trouble.”.
Grapple Room is a room. “This room is for testing the grappling hook.
You stand on one of four platforms above a featureless void. The four platforms are northside, southside, eastside, and westside. You stand on the [player position] platform. Above you are a few I-beams.”
After entering Grapple Room:
now the player position is eastside.
Check going somewhere when the location is grapple room:
if the internal position is eastside:
continue the action;
otherwise:
say “The door’s over on eastside, you numbnut.” instead.
The Grappling Hook is a thing in Grapple Room. It is equipment. Understand “grapple” as the grappling hook. The description of the Grappling Hook is “It’s a simple affair, a thin but strong-looking cable with a weighted, four-hooked grapple attached at one end. Attached to the other end is a note: 'Use the command ‘grapple to (direction)side’ to get to that location.”
Understand the command “grapple” as something new.
Grappling to is an action applying to an internal position. Understand “grapple to [an internal position]” as grappling to.
Carry out grappling to:
if the grappling hook is not equipped:
say “How are you going to do that?” instead;
otherwise if the grappling hook is equipped:
say “You throw the hook up to an I-beam, and after a quick check that it’s secure, swing across to the [internal position] platform with no trouble at all. Nice!”;
now the internal position is the player position.[/code]
The equipping and unequipping goes fine. What doesn’t work is the “internal position” value. Specifically, the error pops up in the “carry out grappling” section, where it says that the [internal position] thing doesn’t work, but doesn’t give a great solution. If there’s a better way to divide a room into sections, I would love to hear it; I took that from Inform’s documentation because I couldn’t find another method.