defining a new action, problems with irregular verb tenses

I’m following the code in Jim Aikin’s Inform 7 handbook (v 2.0 May 2015) (pg 159) to define a new action which is digging up a pile of dirt. Inform is not recognizing the past tense of the verb “dig” (either as the correct “dug” or the alternative “digged” which makes me feel weird but any port in a storm, right?) anywhere where the past tense needs to be used. Do I need to use a regular tense verb like “shovel/shoveling/shoveled” instead?

I’m not crazy about it, but if it’s just a regular/irregular verb tense issue, I’ll survive. I figure I’d ask before switching just in case someone else had a thought allowing me to use dig/dug instead.

Thanx in advance. All the help I’ve gotten so far has been top drawer. I really appreciate it!

[code]The pile of dirt is scenery in the Backyard. The description of the dirt pile is “[if the pile of dirt is dug]You shovel away the dirt revealing a series of letters. Once you move enough dirt to expose the letters, you brush the remaining loose dirt away to reveal this message: ‘DIGDUGBADGUY.’[otherwise]The pile of dirt looks like it has been there for some time, though you know it wasn’t there on your last visit before Uncle Corey’s death. There are weeds, small tufts of grass, and even a few wildflowers growing from the dirt. It looks vaguely like the ground in Wall-E when they first return to Earth. On the cement, partially obscured by the dirt, you can see what looks like part of a three inch high letter done in purple paint. ‘B’ maybe or ‘D.’ ‘R’? It’s definitely a letter. You just can’t tell which one. It’s packed much too hard to dig up with your hands. Maybe if you had a shovel.” The printed name of the pile of dirt is “[if the pile of dirt is dug]dug up [end if]pile of dirt.”

Understand “dirt” and “dirt pile” as the pile of dirt.

Digging is an action applying to nothing. Understand “dig” and “dig up” as digging.

Check digging:
if the player carries the shovel:
say “You need to be more specific about what you want to dig up.”

Dig-upping is an action applying to one thing. Understand “dig [something]” and “dig up [something]” as dig-upping.

Check dig-upping:
if the noun is the dirt pile:
if the dirt pile is dug:
say “You already dug up the dirt.”;
otherwise if the player carries the shovel:
try digging the dirt pile with the shovel instead;
say “You’ll need to find a shovel if you want to do that.”;
say “[The noun] [look] fine the way [they] [are].”

Digging it with is an action applying to two things. Understand “dig [something] with [something]” and “dig up [something] with [something]” as digging it with.

Check digging it with:
if the second noun is not the shovel:
say “The [second noun] isn’t for digging. You use shovels for that. Duh.” instead;
otherwise if the player does not carry the shovel:
say “You best locate a shovel if you want to do that.” instead;
otherwise if the noun is not the dirt pile:
say “[The noun] [look] fine the way [they] [are].” instead;
otherwise if the dirt pile is dug:
say “You did that already. Remember?” instead.

Carry out digging it with:
now the dirt pile is dug.

Report digging it with:
say “You dug that dirt like a Dig Dug pro.”[/code]

So the issue here is that, with the ways that you’re using “dug”–setting it explicitly with “now the dirt pile is dug,” checking it with “if the dirt pile is dug”–it needs to be an explicitly assigned value, which isn’t directly derived from your action name. So you can just add:

The pile of dirt can be dug.

and it’ll work. Well, if you add the room and shovel to this code fragment to make it compile:

The Backyard is a room. "There is a pile of dirt here." A shovel is in the Backyard.

There’s another thing you can sometimes use that does rely on the past tense of the action verb (it’s in §9.12 of the built-in Inform documentation): you can say something like “If we have examined the pile” and that will be true if anyone in the game has successfully carried out an “examining the rock” action. But Inform can only do this for actions applying to nothing or one thing, so you can’t actually make this work for checking whether you’ve dug the dirt pile with the shovel. In any case, when you’re having trouble getting something like this to work it’s almost always easier to use a flag that you set explicitly, which is what you’ve effectively done with “now the dirt pile is dug”–you just had to define “dug” as a property of the dirt pile!

(FWIW it does seem like Inform expected “digged” as the past tense of “dig>” I wonder if this is a UK thing?)

Does this apply?


You’ll want to add the line:

to dig is a verb

Somewhere early on. Apparently NI has a secret list of irregular verbs, so this will probably get you the correct past participle. Give it a shot?

Hanon has it right in this case–if you want Inform to know that the past participle of the digging action is “dug,” you have to tell it explicitly. That’s just one they missed I guess.

However, let me emphasize for the original poster that this whole approach doesn’t fit into that code–it’s better to stick with making “dug” a property of the pile of dirt and setting it by hand.

Using “The pile of dirt can be dug.” was the perfect solution. Incidentally, I thought about trying “diged” in case Inform wanted to just add an -ed without the double consonant. I was hoping it would work, but Inform hated it.

Thanx again. Slowly but surely I’m working my way through this. I appreciate everyone’s time and thoughts.