Clearing a room variable

After experimenting, I gather that a variable of the room kind always has to be set to an existing room in the game, correct?

I’m trying to clear a room variable and tried setting it to nothing, nowhere, nil, 0… and kept getting various errors. One run-time error with destination being a kind of room:

*** Run-time problem P60: Attempt to set a variable to the wrong kind of object: you wrote ‘now the destination of X is nothing’, which sets the value to nothing - but that doesn’t have the kind ‘room’.

And I also noticed that any variables of the room kind that haven’t been specifically set, default to the first room in the source, much like the player’s starting room does.

So if I want to clear that variable, I guess I have to create a “limbo” room of some kind and set it to that… is that right?

That is the default behavior. If you make the destination an object variable instead of a room variable it can be set to nothing, or you could use a hack like this: To decide which room is nowhere: (- nothing; -).

Yes.

(It shouldn’t break anything for a room variable to hold the value “nothing”, but it requires an I6 hack to set it that way, and it’s not really worth the effort.)

If you define the limbo room first, it will become the default value for room variables, which is handy. Although then you’ll need an explicit “The player is in…” to set the starting room.

Thanks guys!