I’ve done some due Googling. Do y’all know of an extension that will help my player tape an object to self, or should I just work my way through Ex 228 Otranto in Recipe Book §10.6 Ropes?
The action should be similar to what you could manage with “toupee tape,” “a cheap rug,” and the player a baggie of cocaine and an exercise band. There’s no need for weight-bearing capacity or any particular length or pulling anything from one place to another.
Something like Otranto would be overkill. This sounds like something that could be implemented just by making the toupee wearable and adding a rule or two, like:
Lab is a room.
Parlor is north of lab.
toupee is wearable thing.
player carries toupee.
the toupee can be taped.
after doing anything except looking or taking inventory when player wears the toupee and the toupee is not taped and the noun is not the toupee:
say "The toupee slips from your head, but you catch it";
now the player carries the toupee;
continue the action;
and then in your carry out taping the toupee rule,
now the toupee is taped.
I suspect most of the extensions (as well as working through the example you mention) will include a way more complex implementation than you need or want, so I’d probably just use the existing tying it to action, maybe something like this?
Lab is a room. The tape is in the lab. The toupee is in the lab. It is wearable.
Understand "my/-- bald/-- head/dome/pate" as yourself.
Check wearing the toupee:
If the tape is not part of the toupee, say "You put the rug on your head, but as soon as you swivel your neck it falls right off." instead.
After wearing the toupee:
Say "The tape's adhesive makes for a snug fit, but the toupee is now naturalistically perched atop your head."
Instead of putting the toupee on the player, try wearing the toupee.
The can't put onto what's not a supporter rule does nothing when the second noun is the toupee.
Check putting something on the toupee:
If the noun is not the tape, say "Even if you could cram that into the toupee, you're not sure what good that would do you." instead.
After putting the tape on the toupee:
Say "You fold the tape into a big loop and stick to the underside of the toupee.";
Now the tape is part of the toupee.
Instead of inserting something into the toupee, try putting the noun on the second noun.
The block tying rule does nothing when the noun is the toupee. The block tying rule does nothing when the noun is the tape.
Understand "tape [something] to/on/onto [something]" as tying it to.
Instead of tying something to the toupee, try putting the noun on the second noun.
Carry out tying the toupee to the player:
If the tape is part of the toupee, say "You can just WEAR it, now that it's all taped up." instead;
If the tape is not in the location, say "With what tape?" instead;
Try putting the tape on the toupee;
Try wearing the toupee.
Probably would want some additional synonyms and checks, but hopefully this at least gestures towards something that would work.
EDIT: ninja’d by Zed! I think these are pretty similar approaches, though as always his is more elegant.
Thanks, @Zed and @DeusIrae.
I misled everyone by trying to anonymize my puzzle. Instead of something the player might try wearing, my “toupee” is closer to “a baggie of cocaine.” I’m trying to get the player to say “tape/bind/strap the baggie to me with the exercise band.”
I think I need to bone up on relationships and actions that include “with the second noun.”
That’s going to be tricky, because out of the box Inform doesn’t like more than two nouns in a command, and as a result Inform players have been trained not to try wording like that.
I guess I can stop searching for examples of that phrasing then. Meeting the audience where they are is more important than this construction.
Yeah, it’s possible to make Inform accept a third noun (I’ve written an extension for it), but player expectations are a difficult thing to fight.
For a minute, I thought, “Well, I could always write 'Yeah? And whaddaya wanna do that with?” rules, but I’m not yet able to grok your Third Noun extension. I’m torn between rewriting the scene and pursuing a code solution…
The Third Noun extension is a bit of a hack, but basically, it lets you add a [third something] token to any grammar line.
Binding it to is an action applying to two things.
Understand "bind [something] to [something] with [third something]" as binding it to.
Instead of binding the baggie to the player when the third noun is the tape...
Okay! I added a property:
A thing can be bound or unbound. A thing is usually unbound.
So once I guide my player into that three-noun command, I can tag the thing as bound so it won’t blow away in the tornado. I’ll write a check so that binding the cocaine to other things is “not very useful.”
Thanks very much!
If the actor is the only thing the baggie will ever need to be taped to, you don’t really need a third noun:
Self-taping it with is an action applying to two carried things.
Understand "tape [thing] to/-- me/self/myself/yourself/-- with [thing]" as self-taping it with.
e.g. (as a rudimentary example)
EDIT: if you want to intercept attempts to tape things to a thing other than oneself with a hint at the correct approach:
Understand "tape [text]" as a mistake ("One can only tape something to oneself. Try 'tape (something) to (myself or yourself) with (something)").
Ooh! I like this solution because the second of the three nouns is always going to be the player; I want error messages when trying to tape the first noun to any other second noun.
It’s been very useful to hear the range of approaches. Since I’m asking the player to do something relatively complicated, I should prepare for more than one way to get to the solution.
I surmise that “now the actor carries a random thing which is part of the noun” is Inform for “now the actor carries whatever the tape was taping.” I wouldn’t have stumbled on that use of random on my own, and I suspect it’s hard to look up. Extra thanks!
Oops. Tape is the second noun. Got it!
‘Now the second noun is part of the noun’ is intended to prevent the tape appearing in inventory when it’s binding the baggie. ‘Now the actor carries a random thing which is part of the noun’ reverses this, so that the tape is a separate item again rather than being part of the baggie. Because after the command ‘remove baggie’ we have no second noun to refer to, we need the unintuitive ‘a random thing which is part of the noun’ to refer to the tape (there are other ways of solving this dilemma, but this is the most succinct). If we can only ever use the tape and no other thing to bind the baggie, we could of course have just written ‘now the actor carries the tape.’
Now I’m struggling with how to respond if the player self-tapes and then tries to remove the duct tape.
Before/Check/After taking off the duct tape:
if the duct tape is part of a random thing (called whatsit):
now the whatsit is unbound;
now the actor carries the duct tape;
now the actor carries the whatsit;
say "I think that worked. Check the inventory."
Before, After, and Check simply return that the player is not wearing the duct tape. (Drop the duct tape → “You haven’t got that.”)
Writing “Instead” messes with the act of self-taping. The player ends up carrying the noun with the duct tape mysteriously dropped.
Before taking off the duct tape when something (called the whatsit) incorporates the duct tape:
try taking off the whatsit instead.
Before dropping the duct tape when something (called the whatsit) incorporates the duct tape:
try taking off the duct tape.
As an aside, you probably don’t actually need the bound/unbound property. Rather than test whether the baggie is bound you can simply test whether it incorporates something (in this scenario, that something would be the duct tape).
In fact, since you probably want to block the player putting on (as in wearing) the baggie directly by typing ‘put on baggie’, you can also simply test ‘if the baggie is worn’ or ‘if the player is wearing the baggie’ to determine whether it is bound, since then the only way it should end up being worn is if it has been self-taped.