Dropping Stuff Onto a supporter

Hi again.

Things are progressing nicely with my story thanks, in no small part, to all your help. I’ve said it before, but it bears repeating, this forum is an oasis on the internet. You guys could all just answer every question with “search for it” or “look in the documentation” but I’ve never seen that answer, even for really basic stuff. It’s almost like you like this hobby and want to get others to enjoy it too by encouraging them rather than gatekeeping it. Such an unusual concept.

Anyway, I’m currently trying to drop things in a very small room and want them to “land” on a supporter in the room. I’ve been through “Croft” and “Celadon” but I feel like maybe there’s some subtlety in the code I’m not grasping.

I wrote the code below, which seems to work fine but I’m suspicious I’m missing something.

instead of dropping something when the player is in the supply closet:
	now the noun is on the shelf.
3 Likes

I’d have gone with:

Before dropping something in the supply closet,
  instead try putting the noun on the shelf.

Wherever applicable, try to dispatch inventory-manipulating actions to taking, dropping, removing it from, inserting it into, or putting it on so you get to take advantage of existing check / carry out / after / report rules.

Your instead rule might be fine much of the time, but:

  • there’s no output
  • if there’s a check rule that would prevent dropping the thing, it would be bypassed (of course, if you want to prevent a player getting rid of something, you’d have to independently put such a rule in all of dropping, inserting it into, putting it on, giving it to, and even eating if the thing were edible)
  • it would succeed whether or not the shelf was at or beyond its carrying capacity
  • it would act on things that are worn without comment on ‘(first removing thing)’
  • the dropping action doesn’t require a carried thing, just a touchable thing. So the parser would accept “drop thing” for anything in scope and that thing would get teleported to the shelf independent of any sanity-checking. If anything were on the floor, one could “drop” it on the shelf; if another person were in there, one could “drop” things from their inventory or even the person themself, all with no output.
  • if you say “drop thing” a second time while it’s on the shelf, there’s again no output

Maybe you know that many of these cases will never apply… but in anything but the shortest of games it’s easy to forget that when you’re adding something that does apply later. And it takes no more code to dispatch to the existing action.

8 Likes

Those are exactly the types of things I wouldn’t have considered. A timely reminder that it’s best to futureproof and code properly to start with.

3 Likes

and perhaps (as the player may not expect or intend the item to end up there)

Before dropping something in the supply closet:
	say "(putting [regarding the noun][them] on the shelf)[command clarification break]";
	instead try putting the noun on the shelf.

for successfully dropping single items, you’d get the (perhaps nevertheless unexpected) clarifying response ‘You put the (whatever) on the shelf’, but for ‘drop all’ you just get the response ‘Done.’ for each item- and if something is printed in response to a failed attempt to put something on the shelf, it may be even more confusing as to why.

2 Likes

That’s a nice refinement. Thank you.