inform 7: Digging problem

Here is the whole code with numbers for my problems (the numbers are not in my code there just there to pin point where my problem is). my problem is for the check digging with something the only options that work are 1,2 and 3if i try options 4 or five it just says what option 2 says.

[code]A tree is here. The shovel is a thing carried by the player.

digging it with is an action applying to two things.
Check digging something with something: 
  1. if the player is not carrying the Shovel, say “You Have absolutely nothing at all to dig with!” instead;
  2. if the second noun is not the shovel, say “[The second noun] is not digging materal.” instead;
  3. if the noun is the shovel, say “Nice trick if you can do it!” instead;
  4. if the noun is the player, say “That would be disastrous!” instead;
  5. if the noun is a tree, say “You dont want holes in your beautiful desk.” instead.

Understand “dig [something unshovellike] with [shovel]” as digging it with (with nouns reversed).

Definition: a thing is unshovellike if it is not the shovel.

Understand “dig [something unshovellike] with [shovel]” as digging it with.
Understand “dig [something] with [something]” as digging it with.

Understand “dig [something] with [something]” as digging it with (with nouns reversed).

Carry out digging something with something:
say “wow! [The noun] Clutches its chest and falls down dead! [if something is part of the noun][The list of things which are part of the noun] clatter to the ground! [end if][paragraph break]”;
now every thing which is part of the noun is in the location;
remove the noun from play.[/code]

Why did you reverse the nouns? That’s the root of your problem. Since you wrote the understand phrase with nouns reversed, it’s expecting “dig [shovel] with [non-shovel]”, which is going to give you problems.

Also, for the love of all things good and beautiful, PLEASE put your code in code tags.

Edit: Also, why would you need to specify “with a shovel”? Why not just “dig hole”?

sorry about the code tags fixed that. so reverse the nouns means to switch them? i was reading it re verse like a verse from a poem.
i need they player to use a shovel because its part of one of my puzzles. the shovel is a hint for what to do in a certan ash pile.

Thanks for fixing the code tags.

What were you expecting the “(with nouns reversed)” to do? What were you expecting from a poetry-verse understand clause?

Let’s pretend you want an action with two things, but you’ve got two different places for the subject of the sentence. For example, “give [x] to [y]” is functionally the same as “give [y] [x]”. But Inform doesn’t really understand grammar. By default, the first “thing” named in a sentence is the noun, and the second one is the second noun. But “give [y] [x]” is not functionally equivalent to “give [y] to [x]”, so you need to indicate that in this instance, the second noun is where the first one usually is, and vice versa. That’s what “(with nouns reversed)” means - the nouns are in a reversed order from where you originally defined them.

You can include the shovel in the game, and require it for digging, without making the player specify it in the action.

Consider:

[code]Digging is an action applying to one thing. Understand “dig in [something]” or “dig [something]” or “dig [something] up” as digging.

Check digging:
if the player does not enclose the shovel, say “You’re not going to dig with your bare hands!” instead.[/code]

Or:

[code]Digging is an action applying to nothing. Understand “dig” or “dig a hole” as digging.

A thing is either diggable or not diggable. A thing is usually not diggable.

Check digging:
if the player does not enclose the shovel, say “You’re not going to dig with your bare hands!” instead;
if the location does not enclose a diggable thing, say “There’s nothing here to dig.” instead.[/code]

(Not tested, but that’s the general idea, assuming there will be only one diggable thing per location, and they’re not portable.)

You can also auto-select the second noun if you really feel like it’s necessary (I believe there’s an example in the manual). But if the player is only ever going to dig with the shovel, and it’s always clear what he’s going to dig, then it’s kind to simplify things a bit.

On the other hand, you should probably also code whatever’s necessary for “dig in dirt with shovel” or “dig with shovel” or whatever – it’s pretty annoying to try “dig in dirt with shovel” and get the message “I only understood you as far as wanting to dig.”

–Well, really, if I were you I’d get something working first, and then program in the alternatives later.

Ah, right, the alternative command structures should totally be handled.