adv3lite - worn / held items in NPC descriptions

Hi all.

I think I could hack this together, but I am curious if there is an idiomatic way to to show an NPC’s inventory in descriptions and examines, specifically items worn by NPCs. I have an NPC who could be wearing a red cloak or a blue cloak for example, and I want the cloak listed (along with anything else being worn and possibly held that the PC can see)

I could work it into the description of the NPC itself using conditionals, but this doesn’t seem the right way. In the code is this on Thing which seems to say a Carrier will never be able to show its contents, even if areContentsListedInExamine is true

 /* 
     *   Additional information to display after our desc in response to an
     *   EXAMINE command.
     */
    examineStatus()
    {        
        /* First display our stateDesc (our state-specific information) */
        display(&stateDesc);
        
        /* 
         *   Then display our list of contents, unless we're a Carrier (an actor
         *   carrying our oontents) or our contentsListedInExamine is nil.
         */
        if(contType != Carrier && areContentsListedInExamine)
        {          
            /* 
             *   Start by marking our contents as not mentioned to ensure that
             *   they all get listed.
             */
            unmention(contents);
            
            /* Then list our contents using our examineLister. */
            listSubcontentsOf(self, &examineLister);            
        }                   
    }

examineStatus is overridden on the Actor class to:

examineStatus()
    {
        inherited();
                       
        if(contentsListedInExamine && listableContents.length > 0)        
            nestedActorAction(self, Inventory);      
        
    }

So all you should need to do is to set contentsListedInExamine = true on the Actor (or Actors) in question.

6 Likes

You’re right Eric thanks for the quick reply. I’m a few versions behind on the core adv3lite.