Restrict actions when in bed

New to inform. Seems a simple problem. My character starts off in a bed. I wish to restrict what they can do until they exit the bed (standing up). Obviously they shouldnt be able to examine things in the room if they’re in bed! This is the kind of thing I’ve been attempting:

[code]
The player is in the bed.

Instead of doing something other than exiting:
say “You cannot do that from the confines of the warm bed.”
Instead of exiting:
say “You pull back the covers and swing your feet out. Your naked toes curl at the cold of the stone floor. You rise out of the warm bed and look around.”[/code]

Thanks for the consideration and help (in advance) :slight_smile:

Does that not work?

[code]>exit
You pull back the covers and swing your feet out. Your naked toes curl at the cold of the stone floor. You rise out of the warm bed and look around.

x wall
Which do you mean, the West Wall, the South Wall, the East Wall or the North Wall?

x west wall
You cannot do that from the confines of the warm bed.
[/code]

Instead rules generally stop the action. Which is what you want in the first case, but in the second case it prevents the player from getting out of bed.

The first rule should probably be “instead of doing anything other than looking or exiting when the player is in bed”, and the second one should be “after exiting when the player was in bed” and/or end with “continue the action”.

Thanks. Any chance of pointing me to a concrete example I could follow? Still cant seem to get it working with your suggestions.

This should work, if I did it right:

[code]The player is in the bed.

Instead of doing something other than exiting when the player is in the bed:
say “You cannot do that from the confines of the warm bed.”;
stop the action.

Before exiting when the player is in the bed:
say “You pull back the covers and swing your feet out. Your naked toes curl at the cold of the stone floor. You rise out of the warm bed and look around.”;
continue the action.

[/code]

Thank you very much. Works exactly as wanted. Plus I learned something in the process. You’re a star. :slight_smile: