Incapacitated player being moved through rooms?

Hi folks. I’m new to Inform7, and finding it really interesting but hard to wrap my programmer-brain around in some parts.

One thing I’m trying to do: start the game with the player physically immobilized - able to do things like look around and speak, but unable to move. I can kinda do this with:

Instead of going in the Starting Room, say "You attempt to move, but you seem to be immobilized."

which works, but it repeats that sentence every time. Question #1: How would I display one such message the first time, and a second, different message all subsequent times the player tries to move?

Question #2: During this time of immobilization, the player will be slowly recovering consciousness, which changes the description of the rooms they’re in. I do this with:

At 7:01PM: now the description of the Starting Room is "Things appear clearer as you recover consciousness.  You notice blah blah blah"

and then another similar statement for 7:02PM, etc. This seems to work, except for the fact that time elapses strangely in the first two turns. When play begins 7:00PM, a single “wait” command says “Time passes”, when it seems like the time should have elapsed to 7:01 and displayed the next message. After that, one “wait” seems to reliably elapse one minute. Any idea why?

During this time of immobilization, the player will be wheeled through a series of rooms on a gurney. My best guess for how to do this right now is:

At 7:04 PM:
	say "A nurse wheels your bed into Room 4117.";
	now the player is in Room 4117;
	now the hospital bed is in Room 4117.

Question #3: are there any downsides to this approach, effectively teleporting the player into each new room? I’m realizing that Inform7 provides a lot of ways for representing state and state transitions, and I’m unclear on how much fakery to use versus actual systemic rigor (the classic level design question).

Look into chapter 5 of Writing with Inform, especially 5.7. The [one of][or][stopping] and [first time][only] constructs should provide the functionality you’re looking for.

I’ve noticed that the very first turn in the game, Inform behaves a bit irregularly; the first turn seems to be a kind of zeroth turn instead, in some ways, which causes problems in some edge cases. I’m not sure exactly why that is the case!

What you’ve written will work fine in a simple system without many moving parts, or complex interlocking rules based on movement. The only time I’d say it’d be worth it to actually give the nurse an action like “try the nurse pushing the hospital bed east” is if there are rules involving things being pushed around into certain places, or at certain times, or by certain people, etc.

My rule of thumb is if an event only happens once or a few times, faking it will usually work fine; if it can happen an arbitrary number of times, systematizing it will often save you a headache down the road, either in implementation or debugging.

I agree with ChrisC that moving the bed by hand is almost certainly OK; I’d just add that if the bed is an enterable supporter and the player is on it (both of which should probably be true), then just “now the hospital bed is in Room 4117” should work. I have a WIP with a bus in it, and when the player is in the bus s/he moves with it. (For some reason my code say “move the bus to room X” instead of “Now the bus is in move X,” but “Now the bus is in…” works too.) If you do move the player and the bed separately, then the player will wind up on the floor.

You might also want to include a sanity check to make sure that the player is on the bed, though the player probably won’t be able to exit the bed. But make sure you block that! One of the comp games strapped you down to the bed, and blocked you from getting down from the bed when you tried to go in a certain direction – but it didn’t block you from getting off the bed directly, so I was able to get off and wander around anyway, which was unfortuate.

Fakery is usually fine. Note that faking this has the advantage that you can still move the gurney programmatically even if it is fixed-in-place or scenery.

Note however that the code as written will take the player off the bed, since it moves the player to the new room (so he is now no longer on the bed) and then moves the bed to that room.

One thing I would suggest is to use Scenes instead of time of day. This below may illustrate some of the things you are trying to do. Controlling descriptions and such is much easier with Scenes:

[code]Moving the Patient is a scene. Moving the Patient begins when play begins.

The Hospital Hallway is a room. “[if Moving the Patient is happening]Vague images whirl past. You don’t feel so great. You are dimly aware of being on some kind of gurney, currently being wheeled down a hall to who-knows-where[otherwise]This must be the hallway you came in through. Room 4117 is to the south[end if].” The printed name is “[if Moving the Patient is happening]Hallway?[otherwise]Hospital Hallway[end if]”.

The hospital gurney is a scenery supporter in the Hospital Hallway. Understand “bed” and “hospital bed” as the gurney.

The player is on the gurney. The description of the player is “[if Moving the Patient is happening]You don’t look so hot[otherwise]You look a lot better now[end if].” The description of the gurney is “[if Moving the Patient is happening]You can’t see much of it from this angle aside from the IV bags swaying above you, but it feels like what you imagine being on a hospital gurney would feel like. Of note: you seem to be securely strapped to it[otherwise]It’s a hospital gurney much like any other[end if].”

Instead of doing something other than examining or waiting or looking or listening or taking inventory or telling or asking during Moving the Patient, say “[one of]You can’t move at all for some reason[or]You find you’re strapped down, severely constricting your freedom of movement[or]You are still strapped down on the gurney[stopping].”

Every turn during Moving the Patient:
if the time since Moving the Patient began is 4 minutes:
say “A nurse wheels your bed into another room…”;
now the gurney is in Room 4117.

Room 4117 is a south of Hospital Hallway. The description is “[if Moving the Patient is happening][one of]You can’t make out much of the room at all yet[or]White walls, hospital smells. You can’t make out much else yet[or]You can make out white walls, windows, and a TV[stopping][otherwise]An ordinary hopsital room with the usual windows and TV. The gurney you were brought here on is still here. To the north is the hallway[end if].” The printed name is “[if Moving the Patient is happening]Another Room[otherwise]Room 4117[end if]”.

Moving the Patient ends when the time since Moving the Patient began is 10 minutes.
When Moving the Patient ends:
say “You get better. You unstrap yourself from the gurney and pull out all the IV drips and whatnot.”;
try getting off the gurney.

test me with “jump / stand / l / x bed / x me / l / stand / l / x me / get gurney / get gurney / n / jump”.[/code]

These are fantastic answers, thanks so much folks!