Start game inside a container?

The first room in my game is the bedroom which contains a supporting container called The Bed.

How on earth do I have the player start the game on the bed rather than just in the room with the bed?

Thanks!

The bed is an enterable supporter in the Bedroom. The player is on the bed.

Way too easy.

Thanks!

There’s also a container (footlocker) in the room which I don’t want them to see until they get off the bed. Is that possible?

Thanks again.

If you want an object to be totally hidden from the player before a certain event happens, then the usual solution is to start the game with the object offstage and only move it to the location when the event occurs.

Bedroom is a room. "This small bedroom contains a narrow bed."

The bed is an enterable scenery supporter in the Bedroom. Understand "narrow" as the bed. The player is on the bed.

The footlocker is a closed openable fixed in place container. "A footlocker is pushed up against the foot of the bed. It's [if closed]closed[else if there is nothing in the footlocker]empty[else]open and contains [the list of things in the footlocker with indefinite articles][end if]." Understand "foot" or "locker" as the footlocker.

A stuffed bear is in the footlocker.

After getting off the bed for the first time:
	now the footlocker is in the Bedroom;
	continue the action.
	
Test me with "x footlocker / get up / x footlocker / open footlocker / x footlocker / l / take bear / x footlocker / l / close footlocker / l".

If you just want the item to be undescribed, but still able to be interacted with by a knowing player, then you can start the game with it as scenery and make it not scenery when the event occurs.

Bedroom is a room. "This small bedroom contains a narrow bed."

The bed is an enterable scenery supporter in the Bedroom. Understand "narrow" as the bed. The player is on the bed.

The footlocker is a closed openable scenery container in the Bedroom. The initial appearance is "A footlocker is pushed up against the foot of the bed. It's [if closed]closed[else if there is nothing in the footlocker]empty[else]open and contains [the list of things in the footlocker with indefinite articles][end if]." Understand "foot" or "locker" as the footlocker.

A stuffed bear is in the footlocker.

After getting off the bed for the first time:
	now the footlocker is not scenery;
	continue the action.
	
Test me with "x footlocker / get up / x footlocker / open footlocker / x footlocker / l / take bear / x footlocker / l / close footlocker / l".

If you were using this technique with an object meant to be portable, then you’d not only need to make it not scenery, but you’d also need to change the fixed in place property that is implied by scenery with “now the foo is portable.” When working this kind of stuff out, the “showme” debugging command can be useful. E.g., try “showme footlocker” to see a list of its properties.

Note also that Inform interprets bare double quoted text in the definition of a scenery object as its description, while it interprets it as the initial appearance for a non-scenery object. This is because a scenery object is not described in a room description, so its initial appearance property would typically go unused.

Fantastic. Thanks for the great information!

So I switched the bed to a container (it’s actually a bed with a lid, think: coffin type thing, so this makes more sense) but now this code doesn’t work:

After getting off the bed for the first time: now the footlocker is not scenery; continue the action.

I suspect it’s that “getting off” has nothing to do with containers. But what does?

After exiting from the bed for the first time:
	now the footlocker is not scenery;
	continue the action.

If you want to know what action a certain command triggers, you can (1) use the actions debug command (“actions on”/“actions off”) before typing the command, or (2) check out the Commands portion of the Actions Index on the Index panel (look for “Cm”), where’s there a list of mappings between commands and actions.

Thanks again. I tried “after exiting” but not “after exiting from”. Also thanks for the reference.