Give (item with "to" in it) to person

The fix for TALK TO [noun] and TALK [noun] issues - #8 by AmandaB was enlightening, and it reminded me of a similar problem with “to” that I had with another game. I used a hack to fix things, but it would be neat to know if/how I could do better!

r1 is a room. the alien is a person in r1.

To Serve Man is a thing in r1. description is "It's a book! It contains a voucher for a free UFO ride."

The parser sees “give man to alien” as follows:

“give (object) (subject)” which overrides the “give (subject) to (object)”.

>give man to alien
You can only do that to something animate.

>give to serve man to alien
You can only do that to something animate.

>get to serve man

>give it to alien
The alien doesn't seem interested.

Now, the fix I used in Ailihphilia was roughly to take “to serve man/to serve” in the command line and understand “tsm” as To Serve Man and, in “after reading a command”, replace the phrase(s) above with “tsm”. This is adequate, but awkward!

Is there any better way to account for an item with “to” in it if we want to give it to someone? Or would I just have to un-define some of the “give (object) (subject)” syntax?


understand the command "give" as something new.
Understand "give [something preferably held] to [someone]" as giving it to.

doesn’t untangle things, either.)


1 Like

oh boy! Free UFO ride!

You can leave “give” alone and just futz with the book.

Lab is a room. The alien is a person in the Lab.

The block giving rule does nothing.

Cookbook is a privately-named thing. [omit privately-named if you do want "cookbook" to be understood as the cookbook]
The printed name of cookbook is "To Serve Man".
"It's a book! It contains a voucher for a free UFO ride."
Understand "to/-- serve man/--" or "man" as the cookbook.
The player carries the cookbook.
Persuasion rule for asking the alien to try giving the cookbook to player: persuasion succeeds.
Test me with "give serve to alien / alien, give man to me / give to serve to alien / alien, give serve to me / give serve man to alien / alien, give to serve man to me".
1 Like

This leaves open the option of “–/–”, which I think means the empty string can be understood as the cookbook, which could be bad. EDIT: Sorry, misread the code! That problem does not occur.

I just write

Understand "to serve", "serve", "man" as the cookbook.

It occurred to me that it might be worth mentioning why this approach works where the original didn’t, for anyone who might stumble upon this to whom it’s unclear…

A lot of stuff is implicitly specified when you assert blobbety blah de the blah is a thing. A thing is created whose name is “blobbety blah de the blah” and whose printed name is “blobbety blah de the blah”. And every non-article word in it is added to the dictionary as something in a player’s command that can possibly refer to this thing (unless it’s privately-named – that’s what that really means – don’t automatically add stuff to the dictionary for this thing). So far as I know, only articles are excluded: you can perversely say with of my to on is a thing. and the player could refer to it with any of those words… until there was a conflict with a preposition used with a verb in a command.

>get to on
You are carrying:
  with of my to on
>drop on
>get on
You must supply a noun.

In short (too late), the key thing here is that To Serve Man is a thing. results in “to” by itself being something that can possibly refer to the book. Zarf’s and my alternatives avoid that, allowing “to serve” or just “serve” to refer to the book, but not just “to”.