New command applying to something AND applying to nothing?

Hey!
I want my PC to be able to nod to say yes.
I can do this:

Understand the command "nod" as something new.  Understand "nod" as nodding. Nodding is an action applying to nothing.

Understand "nod my head" as nodding.
Understand "nod head" as nodding.
Understand "nod your head" as nodding.

And that all works fine. Or I can do this:

Understand the command "nod" as something new. Understand "nod at [someone]" as nodding. Nodding is an action applying to one thing.

Carry out nodding:
	say "you nod your head to say yes.".

And that works fine.

But I can’t seem to have both. Is there a way to mishmash these together? I’ve tried so many things my head aches (mostly focussing on “or”, and “Understand”), but Inform doesn’t like any of these because nodding is either an action applying to something or to nothing.
I’ve learned from my first game that people will type the long thing, like “Nod your head at Steve,” instead of just trying “nod.” Even if I tell them explicitly to just nod. So you better be able to nod at Steve.
Thanks!

I think the trouble is that Inform is confused because these are two distinct actions that you’re telling it have the same name. Try renaming your second one as person-nodding, or something like that, and I think it should work (not tested since I’m on my phone, alas - but pretty sure this is the issue).

Edit: of course the difficulty here is that now your rules for nodding need to encompass both actions - it might be an easy matter of just tweaking a couple “after nodding” rules to have “after nodding or person-nodding at Steve” or what have you, rather than needing to write whole different rules. But if it’s getting complicated you could potentially define a new kind of action (say both nodding and person-nodding are agreeable behavior) and use that as the basis for rules?

2 Likes

Hey, that works great. And yeah, it might cause some problems down the road. I see some byzantine rules in my future, which is par for the course, so all is right with the world.
Thanks as always!

1 Like

An alternative would be to have only one action and make use of the rule for supplying a missing noun.

Nodding is an action applying to one thing.

Understand "nod at [someone]" as nodding. 
Understand "nod" as nodding. 
Understand "nod my/your/-- head" as nodding.

Rule for supplying a missing noun when nodding:
	now the noun is the player.

Carry out nodding:
	say "you nod your head to say yes.".
3 Likes

I did not know about this rule! This is incredibly handy. Thanks a million.

1 Like