Help unborking an untying rule

Either I am going mad, or I already am, because I cannot for the life of me figure out why this code won’t compile:

A thing can be knotted or unknotted.  A thing is usually unknotted.

Understand the command "untie" as something new.  Understand "untie [thing]" as untying it.  Untying it is an action applying to one thing.  

Check untying it:
	If the noun is not knotted, say "No knot there!" instead.
	
The yarn is an object in the bedroom.  The yarn is knotted.

After untying the yarn:
	Now the yarn is unknotted.

The After rule throws up a compiler error, saying that “untying the yarn” doesn’t make sense as a description of an action. But it sure seems like it is when I comment out that rule and use ACTIONS to see how the parser understands UNTIE YARN. I must be overlooking something incredibly basic, but I can’t for the life of me find it. Thanks much for any assistance!

Take “it” out of the action definition and the Understand line.

1 Like

Thank you!

(This presumably doesn’t mean much coming from me, clearly a dummy on the evidence above, but Hadean Lands was beyond brilliant).

This is confusing because if you define an action applying to two things, you should use “it”.

Inserting it into is an action applying to two things.

But for a one-thing action, “it” causes problems.

1 Like

Yeah, I defined untying by analogy to tying it to – cargo cult logic led me astray.

A further improvement you can make to this is to replace the above with:

Carry out untying:
	now the noun is unknotted.

Report untying:
	say "You carefully un-knot [the noun]."

(After rules are really intended for story-specific overrides that happen between Carry Out and Report and stop the latter from happening. Default behaviour for actions – even story-specific ones – should ideally be defined solely with Check, Carry Out, and Report. That way you can use the other rulebooks for special cases.)

2 Likes

Thanks Gavin! That is more or less how I had it set up, before I started to try to break out specific cases to see if that helped with the debugging process.