adv3Lite: Examining a Room

Just for kicks, I thought I’d try porting a few rooms of a WIP from adv3 to adv3Lite. Here’s the first problem I’ve bumped into. In adv3, Rooms don’t have associated vocabulary, but in adv3Lite they do.

In adv3 I can create a Decoration or Fixture so that you can examine the room you’re in and get a different output from what you’d get using ‘look’. This is useful, for instance, if the PC is standing in a parking lot (as she is in the opening location of this particular game). ‘x parking lot’ should probably describe the pavement and the cars, but not, for example, the exits. At least, that’s what I want.

In adv3Lite, creating a Fixture produces:

This is obviously not what one wants. So how exactly would I create a Decoration or Fixture that shares vocabulary with the Room and have the Examine action directed to the Decoration, while the Look action produces the expected result, displaying the room’s desc()?

Okay, I seem to have figured that one out. I can use the nonObvious macro in the verify() routine of dobjFor(Examine). That causes the Examine action to prefer the Decoration.

For future reference, it may be worth giving dobjFor(Examine) on Room a lower logicalRank (than Decoration) in the library so that Things are always preferred to Rooms in this kind of case. But before I go ahead and do that (for the next release goodness knows when), can anyone see a problem with it? Would it break anything anyone else has done?

I think I’ve found a simpler solution (for my game, anyway) – just create an interiorDesc for lookAroundWithin that’s different from the desc.

In the general case, this approach would save the author having to create a separate scenery object.

I don’t think it would break anything I’ve done or am doing, though it may have a ripple effect that would require some modest tweaking.

However, in general, I would prefer that the library leave that kind of decision up to me. I want to be the one who decides what text is appropriate for which situation.

There are ample tools already in the library for doing that—dobjFor(Look) and dobjFor(Examine) with different text as appropriate, or simply branching in the room desc…

"<<if Actor.isInTheLight>>Blah blah blah<<else>>blither blather>><<end>> <.p>"

or

"<<getDesc()>>" getDesc() { if(Actor.isInTheLight) "blah blah <.p>"; else "blither blather<.p>"; }

…with isInTheLight a code-controlled flag set on the Actor object.

Jerry