Noob Question - Can't do "instead of ..."

I am essentially trying to make a simpler version of Dunnet, in inform 7.

I’m stuck on doing “Instead of” actions. Here is my code:

Shaking is an action applying to one  thing.

Instead of climbing the tree:
        say "You manage to get about two feet up the tree and fall back down.  [line break]You notice that the tree is very unsteady.";

Instead of shaking the tree:
        say "You shake the tree, and a coconut falls onto you.";
        end the story;

And here is the error:

→ You wrote ‘Instead of climbing the tree’ (source text, line 11), which
seems to introduce a rule taking effect only if the action is ‘climbing the
tree’. But that did not make sense as a description of an action. I am
unable to place this rule into any rulebook.
→ You wrote ‘Instead of shaking the tree’ (source text, line 14), which
seems to introduce a rule taking effect only if the action is ‘shaking the
tree’. But that did not make sense as a description of an action. I am
unable to place this rule into any rulebook.
++ Ended: Translation failed: 2 problems found
Inform 7 has finished.

Is that all your code? The error message says the first error is line 11, so there must be some stuff missing, right? Presumably you have a room defined, otherwise I’m pretty sure it wouldn’t have gotten to the error you got. But have you defined the tree as a thing?

If I take your code, add a room called “Starting Room” and then add the following code, the code compiles:

The tree is a thing in the Starting Room.

So I think you’re just missing the tree.

I feel like an idiot. I am missing the tree.

The error really threw me off guard. :face_with_head_bandage:

Yeah, I guess that error message is a little confusing.

Note also that for the player to actually be able to shake the tree, you need to add something like the following to add an actual command the player can type:

Understand "shake [something]" as shaking.
1 Like

Yeah, I know. I was just trying to actually get the code to compile! :stuck_out_tongue:

probably wouldn’t have gotten the syntax correct first try tho :madness: