Change Name after Smelling

The title sounds funny but I would like to reveal the actual name of an object after the PC smells it.

I tried the following but I don’t think this works on Things. I got it from the Actor class. (this is not the full object desc)

myThingObj: Thing 'strangeThing' 
"Some unknown thing. "
smellDesc() { "The unknown thing smells new. ";
                myThingObj.changeName('newThing');
             }

changeName(newName)
{
    name = newName;
}
;

For example, if after the PC has smelled the object and tries to ‘Put newThing in box’. The command fails. But if the PC tries ‘Put strangeThing in box’ the command works as expected.

Thank you in advance,

Deborah

2 Likes

You need myThingObj.replaceVocab(‘newThing’);

4 Likes

In the smellDesc?

I swear I tried that! Trying again.

Thank you!

2 Likes

not on smelling, but I use the very same code for a similar renaming:

dobjFor(LookIn)
   {
     action()
     {
       inherited;
       Mward.changeName();
       Mward.searched = true;
       painting.proven = true;
     }
   }
changeName()
  {
    Mward.addVocab('Miryarai\'s wardrobe; Miryarai\'s angel\'s angel');
  } 
;

(I use addVocab instead of replaceVocab for QoL reasons, I guess that players should be capable of using the former vocabulary (which refers to the spatial layout of these furnitures in the location, so still makes sense to players)

Best regards from Italy,
dott. Piergiorgio.

3 Likes