So, I have code like this:
[code]/*
claGhost
This inherits from the Actor class, and defines generic behaviour for ghosts.
*/
class claGhost: Actor ‘;;spirit spook ghost;’
{
// As ghosts, there’s a lot they can’t do (such as pick up items and the like).
feelDesc = ‘{The subj dobj} {is} not solid and cannot ordinarily be touched except by other ghosts.’
shouldNotKissMsg = ‘{The subj dobj} {is} not kissable by mortals, as {that subj dobj} {is} not solid.’
smellDesc = ‘Being a ghost, {the subj dobj} {is} without any kind of scent you can detect.’
shouldNotAttackMsg = ‘{The subj dobj} {is} already dead and a ghost; trying to attack {the subj dobj} {is} pointless.’
}
[…]
npcShamus: claGhost ‘Shamus;;spirit guide;’
{
location = romAutopsyExaminationRoom
isHim = true
desc ()
{
// Salient points - transparent blue; looks as if he’d be in his early 30s if alive; mid-late 50s fashion (sweatshirt, casual shirt, trousers); trimmed looking beard and moustache; cheerful looking.
“<.p>TODO: Shamus desc
}
}
[…]
romAutopsyExaminationRoom: Room ‘Autopsy Examination Room’
{
desc ()
{
// The description for what is going to be called the “Autopsy Examination Room” (yeah, I know) is to be based upon the room where Paul found the organs measurement board.
“<.p>It’s a fairly brightly-lit room with the window, but one whose decorations would have been purely for function. From what you gather some autopsies were conducted in here, though you wouldn’t know it with everything having been stripped from the room, down to the light fixtures. Even the door in here was taken off its hinges. When this place had been open perhaps the white tiles on the walls would’ve been cleaner. As it is, like everything else in this place they’re covered in a layer of grime, having been neglected for years.
}
south: TravelConnector
{
canTravelerPass (traveler)
{
if (npcShamus.location != nil) // So long as Shamus is present, the player is not going to try to leave the location.
{
return (nil);
}
return (true);
}
explainTravelBarrier (traveler)
{
“<.p>You haven’t finished what you came here for.”;
}
travelDesc ()
{
// The epiphany event has happened, so allow the player to leave; give a brief outro and then end the game.
“CCCCCC”;
finishGameMsg (‘To be continued’, []);
}
}
}[/code]
Basically, one room, with one NPC which inherits from a class.
But I’ve come across something odd with the smell command. Specifying just ‘smell’ gets the response “Being a ghost, {the dobj subj} is without any kind of scent you get.” - which is clearly incorrect behaviour, but I am unsure why. Commands like “smell shamus”, “smell me” etc. work as expected. It may be a bug with adv3lite, but I’m more suspecting it’s something dumb I’ve done somewhere down the line.