Can't drop item from carried handbag

Hello,

My player has a handbag, as every lady, and I just realised that I can’t immediately DROP something that is in the bag, for example, if the bag contains the lipstick:

Is there a way to actually not have to TAKE something that is in a carried container before using it or dropping it? Does making the container a “player’s holdall” solve this?

Thanks,
Giannis

There’s a specific rule for that.

The can't drop what's not held rule does nothing when the noun is in a container that is carried by the player.

Note that Mike’s solution will move the lipstick to the floor without the player taking it. If that matters–say, there’s some kind of effect that takes place when you handle the lipstick–you can insert a rule that tries to take things out of the held container before dropping them:

[code]Lab is a room. The player carries a handbag. A lipstick is in the handbag.

Check dropping when the noun is in a container (called vessel) held by the player (this is the try to remove things from held containers rule):
say “(first taking [the noun] out of [the vessel])[command clarification break]”;
try silently taking the noun;
if the player does not hold the noun: [the taking failed]
stop the action.

The try to remove things from held containers rule is listed before the can’t drop what’s not held rule in the check dropping rulebook.

After taking the lipstick:
say “As you take the lipstick it smudges your fingers.”

A hot potato is in the handbag.

Before taking the hot potato: say “It’s far too hot!” instead.[/code]

I hope this isn’t too dumb a question, but this thread has me curious: does it work if the container is closed? Any implicit opening involved? :question: :blush:

I tried playing around with it, and it looks like the important thing to note is that objects in a container go out of the player’s scope when the container is closed. So you’ll have to adjust the scope before you can refer to anything in a closed container.

[code]Lab is a room. The player carries a jewelry box. The jewelry box is a lockable openable container. A jewel is in the jewelry box. The player carries a small key. The small key unlocks the jewelry box.

After deciding the scope of the player when the player is holding a container (called vessel):
place the contents of the vessel in scope.

Before taking when the noun is in a closed container (called vessel) held by the player (this is the open containers before taking from them rule):
say “(first opening [the vessel])[command clarification break]”;
try silently opening the vessel;
if the vessel is closed: [the opening failed]
stop the action.

Before dropping when the noun is in a container (called vessel) held by the player (this is the try to remove things from held containers rule):
say “(first taking [the noun] out of [the vessel])[command clarification break]”;
try silently taking the noun;
if the player does not hold the noun: [the taking failed]
stop the action.[/code]
(pretty much copied everything from Matt’s code above, but it turns out they have to be “Before” rules and not “Check” rules due to the order of existing rules)

And that gives you something like

[code]Lab

close box
You close the jewelry box.

drop jewel
(first taking the jewel out of the jewelry box)
(first opening the jewelry box)
Dropped.[/code]

You can also make the container transparent, which will automatically take care of the scope issue. If you do that (or add stuff to scope) and don’t add anything else, then dropping the lipstick will yield the message “The handbag isn’t open.” This is from the basic accessibility rule (which runs on either dropping or taking, since both require a touchable noun–that is, they’re defined as “applying to a thing” rather than “a visible thing”). You can’t touch a thing inside a closed container.

So there isn’t any implicit opening of containers in the Standard Rules, probably because unless the container is transparent you won’t be able to see the things inside it anyway, but you can write a rule like Brian’s. In fact you can wrap up every case using “the action requires a touchable noun,” like in the last rule here:

[code]Lab is a room. The player carries a handbag. A lipstick is in the handbag. The handbag is closed, openable, locked, and transparent. The player carries a tiny key. The tiny key unlocks the handbag.

Check dropping when the noun is in a container (called vessel) held by the player (this is the try to remove things from held containers rule):
say “(first taking [the noun] out of [the vessel])[command clarification break]”;
try silently taking the noun;
if the player does not hold the noun: [the taking failed]
stop the action.

The try to remove things from held containers rule is listed before the can’t drop what’s not held rule in the check dropping rulebook.

After taking the lipstick:
say “As you take the lipstick it smudges your fingers.”

A hot potato is in the handbag.

Before taking the hot potato: say “It’s far too hot!” instead.

Before doing something when the action requires a touchable noun and the noun is in a closed openable container (called the vessel) (this is the try opening openable containers rule):
say “(first opening [the vessel])[command clarification break]”;
try silently opening the vessel;
if the vessel is closed:
stop the action.[/code]

So:

Making the container transparent is probably a more sensible solution since the player can just see what items are inside by taking inventory without needing to remember it all.

Although I remember that in one game, there were just so many items that I would stuff unneeded ones into a bag and close it so that the inventory list wasn’t so big.

Well it depends on whether the container is actually supposed to be transparent! You might also want to have the handbag be opaque, but have the player remember the things in it, and then it’d certainly make sense to put its contents in scope when the player has it.