The curse of your former self

My game has corpses. A person has a thing called ‘slab’, which is set to be the object that will be used as their corpse if they die. My default value for a person’s slab is nothing, which I don’t state. I just give it no default state.

When I do ‘showme (some person)’ for a person with no corpse, it says their slab value is ‘your former self’.

I can’t remember if it was always like this. But there’s one person who, when they die, actually deposits the ‘your former self’ object in the room.

I thought I’d stopped my/your former self from even entering the playing field by initially declaring the PC to be Johnny Appleseed or whomever?

Anyway I’m confused on both points - why is an empty variable holding ‘your former self’? And why does it only act as if it’s not empty sometimes?

  • Wade

Every kind has a default value, which is typically the first-defined object of that kind. The “yourself” object is defined early, so it is the default thing value. Thing properties always default to that, not to “nothing”. You aren’t allowed to stuff “nothing” in that slot, in fact.

You can cope with this in one of two ways:

  • “A person has an object called the slab.” The default object (unlike the default thing) is truly nothing.
  • Define an offstage thing called the “no-corpse”. Use it as the default value of the slab property. Treat it specially in your slabbing code.

You can also do something like this (from ATTACK):

The stand in for no one is a person variable. The stand in for no one variable translates into I6 as "nothing".

You can then set any person variable to the stand in for no one. But you’ll have to be careful that you don’t try to do anything with that variable without first checking whether it is the stand in or not.

(This is really very similar to defining an offstage thing called the “no-corpse”, except that no I6 object is defined.)

Cool. Thanks for the explanations everyone.

  • Wade