The Angler (theangler) wrote in inform_dev,
The Angler

planning stages - question about large containers vs rooms

I'm trying to figure out how best to address the following problem. Let's say that the game begins with the PC on a boat. It's not a big boat but big enough that the PC will be able to move around in it. Eventually, the PC will maneuver the boat into dock. The PC will then be able to get off the boat and wander around the streets of a town.

Here's the question. Is it better to make the boat a room or a container on top of (inside) an ocean (a room in which the boat is located)?

If the boat is a room (or system of rooms), I run into one problem: when I type "dock the boat" or "dock boat" the interpreter says that the boat is not something I need to refer to in this game (a ridiculous statement). Simply typing "dock" works fine; however I should be able to allow for the player typing "dock the boat."

The definition of dock is

Verb 'dock' * -> Dock;

and DockSub toggles a global variable indicating whether the boat is sailing or in dock.

I suppose that if I made the boat a container (child of ocean) I could type "dock boat" by changing the Verb declaration to

Verb 'dock' * noun -> Dock;


But then I would have to invent some way to tell whether the noun is "boat" or not. If there is a coil of rope on board the boat and the PC types "dock rope" the DockSub is still called.


This is what my present DockSub looks like with boat defined as a room object:

[ DockSub;
if (noun == boat) {
Is_Docked = true;
print "Your boat is now docked.^";
"That's not something that can be docked.";

Verb 'dock' * noun -> Dock;

Here's the sample transcript:

What do you want to dock?

>dock boat
That's not something you need to refer to in the course of this game.

>dock flashlight
That's not something that can be docked.

(And yes, I've been searching through DM4 and Roger Firth's IF pages for answers. Maybe I'm blind. Must go to bed.)
  • Post a new comment


    default userpic