How do opaque layering clothes work?

Hi, I am trying to verify if opaque outer layers of clothes hide the layers under them. Either I’m doing something wrong or this doesn’t work.

Here’s my test code:

#room
(room *)

#edith
(name *)
        Edith
(current player *)
(* is #in #room)
(proper *)
(female *)

#dress
(name *)
        dress
(* is #wornby #edith)
(wearable *)
(your *)
(opaque *)

#underwear
(name *)
        underwear
(* is #under #dress)
(wearable *)
(* goes underneath #dress)
(your *)

When I test this it seems I can see the underwear despite wearing it under the dress:

> examine underwear
It seems to be harmless.

Am I doing something wrong? The documentation on how opaque works for clothes is a little sparse.

2 Likes

It’s because Edith is the current player; the player is assumed to have access to every item they’re wearing. If you create a second character and make them the current player, Edith’s underwear should be out of scope.

3 Likes

That makes sense, however it would be useful to be able to know if clothes would be out of scope if the character weren’t the player, for example to have different (descr *) text:

You can't see your underwear but you know it's there.

Versus when it’s an outer layer or none of the clothes overlying are opaque:

Your underwear is on display for all to see!

EDIT: Here is fixed code for testing what conceals the player’s clothes:

(descr *)
        (current player $Player)
        (if) (* worn by $Player is concealed by $Concealers) (then)
                (if) (empty $Concealers) (then)
                        (The *) you are wearing (is *) on display for all to see!
                (else)
                        (The $Concealers) you are wearing hides (the *) from view.
                (endif)
        (else)
                (* is $Rel $Parent)
                (The *) (is *) (name $Rel) (the $Parent).
        (endif)

($Obj worn by $Person is concealed by [])
        ($Obj is #wornby $Person)
($Obj worn by $Person is concealed by [$Parent|$Tail])
        ($Obj is #under $Parent)
        (opaque $Parent)
        ($Parent worn by $Person is concealed by $Tail)
($Obj worn by $Person is concealed by $Tail)
        ($Obj is #under $Parent)
        ~(opaque $Parent)
        ($Parent worn by $Person is concealed by $Tail)