Is there a way to block someone from taking an item and putting it in their inventory outright, but allow it when another action requires an implicit take? Currently I have a generic “instead” notice that tells players of this single-room game that there’s no need to carry anything, but consequently PUT THING IN OTHER THING is failing, and I likewise anticipate problems when I start coding STAB SOMEONE WITH THING (as well as the fallout of that, which I was figuring would include the NPC grabbing hold of a random dangerous item not held by the player…)
(Sorry if this has been asked before, I couldn’t find it.)
Instead of taking something when the implicitly taking activity is not going on:
say "There's no need to explicitly take anything in this story."
This is still going to end up with the player carrying the item thus implicitly taken, however. If you want to prevent that, you may instead want to disable the Check rules for the various actions that require the object be carried in the first place.
This is also going to waste a turn if they do try to take something, which may or may not matter. Another alternative is to not use a rule like the above but to instead disable the taking grammar:
Understand nothing as taking.
Understand "take [things]" or "carry [things]" or "hold [things]"
or "get [things]" or "pick up [things]" or "pick [things] up"
as a mistake ("There's no need to explicitly take anything in this story.").
This allows the taking action to still occur if some other action requires it (e.g. via implicitly taking) but does not allow the player to initiate it. It also doesn’t take a turn since it’s recognised as a mistake.
Oh, I like the mistake idea. I get that allowing implicit taking will still leave the player holding the thing (and am okay with that as far as I know - I’m more concerned with preventing the player from carrying things like loose flour/jam and from picking up things that aren’t “fixed in place” but that aren’t useful, than about absolutely barring them from holding anything ever. Since I know that when I play IF, I grab everything that isn’t nailed down!)
On a non-technical design note, what do you think would be the best way to let players know on the rare occasion that they’re holding something, lest it seem to have disappeared from the room in a game that doesn’t use the inventory much? Print in the room description, print each turn…? Silently drop any carried thing?
My immediate thought is, if you want them to only hold a single thing and use it immediately after taking it, put it in the command prompt: “[Holding the spoon]>” or the like.
If you don’t want them to ever explicitly be holding anything, though, I’d just move everything from the player’s inventory to the room in an every turn rule. That allows things to be held long enough to complete a single action (like inserting), then puts them back where they belong if they somehow haven’t gotten moved elsewhere already.
You do have to be a little careful with this, though. It’s probably possible for the player to construct an action that results in them taking something while moving to another room, and then the object might get dropped in the wrong place (at which point the story might become unsolvable if they can’t manually move it back again).
So if you want to go this route, rather than moving things back to the player’s location, you should give each object a “home” and explicitly move each object to its home. That’s as easy as:
Every turn (this is the housekeeping rule):
repeat with item running through all carried things:
now item is in the home of item.
Bonus: you could also write this as a when play begins rule (omitting carried) and then you only need to set the home of each item and the rule will take care of actually putting them there at the start of the game.
Although I guess if this is truly a “single-room” game then this may not matter.
If you don’t mind breaking the “simulationist” sense of the world a bit, you can declare:
A thing is usually fixed in place.
can't take what's fixed in place rule response (A)
is "[regarding the noun][They're] just set-dressing."
And now you have to explicitly name things as portable if you want them to be able to be taken; everything else is automatically blocked as “just set-dressing” (assuming it survives a few earlier checks that might give a different response).
This may make it a little easier to use this only for objects intended to solve puzzles, while making it clear that other objects are just there for flavour text.
It’s also possible to define a separate new adjective (perhaps “interesting” or “useful”) and use that rather than hijacking the “portable”/“fixed in place” adjective, which may make sense if there are actions other than taking that you want to similarly block.