Tuesday, March 19, 2019

Simplifying our story

Simplifying our story.

Now that we have the new rule in that applies to every room we move in, let's go ahead and get rid of the direction section. While it's nice to see the direction section for our own purposes for understanding the map, we can just use Inform's Index function to build our map if we need an overview.

So to get rid of this, we will provide directions at room declaration like so.

The Employee Closet is west of the Employee Break Area. "You enter the c...

The Employee Closet automatically becomes a room when it is a direction from an already established room. Which does mean that the very first room you define still needs to use the:

The Employee Break Area is a room

The next thing is the second line after each room that explicitly sets the concealment, we can make that nicer looking by just referring to the last object we create using it, like so:

The Employee Closet is west of the Employee Break Area. "You enter the closet.  It's small and dusty, but you feel that you might be able to hide in here.  You notice the floor is somewhat uneven as you back up slowly into the closet and close the door."  It has concealment fairly.

Notice how we've used It has concealment fairly. right after the room description. It becomes a short hand for whatever object we just defined, so we can use that instead of typing out the entire room name.

However, our initial room we can do even one better.

The Employee Break Area is a room with concealment none. "A break room that is clearly for employees of some company.  The walls are littered with information about minimum wage, HR regulations, and so on.[if unvisited]  You aren't exactly sure how you have come to get here, but you hear voices...  Not good voices, coming from the distance and growing closer.[otherwise]  Those voices continue to get closer.[end if]  To the east and west you see a door."

When we define a room we get to make one relationship on the same line, for every other room we've used that one relationship to be the direction, hence the reason why we need the second line after the description. However, our initial room doesn't need a relationship to anything else since nothing else exists in our world at the moment.

So with all of that said and done, our final story is now.

[CONCEALMENT]

Concealment is a kind of value.
Concealment are none, fairly, mostly, and completely.
Concealment is usually none.
A person has a concealment.
A room has a concealment.

After going to a room (called P):
    Now concealment of the player is concealment of P;
    Continue the action.

When play begins:
    Cover is blown in eight turns from now;
    Now concealment of the player is none.

[ROOMS]

The Employee Break Area is a room with concealment none. "A break room that is clearly for employees of some company.  The walls are littered with information about minimum wage, HR regulations, and so on.[if unvisited]  You aren't exactly sure how you have come to get here, but you hear voices...  Not good voices, coming from the distance and growing closer.[otherwise]  Those voices continue to get closer.[end if]  To the east and west you see a door."

The Employee Closet is west of the Employee Break Area. "You enter the closet.  It's small and dusty, but you feel that you might be able to hide in here.  You notice the floor is somewhat uneven as you back up slowly into the closet and close the door."  It has concealment fairly.

The Employee Bathroom is east of the Employee Break Area. "You enter the bathroom.  It's quite roomy and you can see a lock on the door.  Clearly you could hide out in here, but for how long?  You feel a breeze coming from a half a foot high vent that is at floor level."  It has concealment mostly.

The Hiding Area is below the Employee Closet. "You creep down into the floor and into the open area underneath the closet.[if unvisited]  You feel around and feel small bars of metal, but are unable to properly identify what the metal is.  You attempt to pick up one of the small bars and notice that it has immense weight.[end if]  You slide the boarding back over the hole."  It has concealment mostly.

The Vent Shaft is east of the Employee Bathroom.  "You crawl into the venting area.  The pipe narrows too much to go any further than maybe eight feet.  However, you turn around crawl backwards into the venting and pull the grate back over the vent."  It has concealment completely.

[EVENTS]
At the time when cover is blown:
    If concealment of the player is none:
        End the story saying "No effort was made to hide from the voices.  Instead you thought you might be able to fight them off.  Turns out you were wrong.";
    If concealment of the player is fairly:
        End the story saying "You at least tried...  However, now you realize you could have done way better.";
    If concealment of the player is mostly:
        If the player is in The Hiding Area:
            End the story saying "Foolish, you hid yourself in the same place they we're hiding their gold.";
        Otherwise:
            End the story saying "A good effort to hide from the voices, but in the end it was not enough.";
    If concealment of the player is completely:
        End the story finally saying "Great job you hid form them!!".


Test me with "e/e/z/z/z/z/z/z/z".

I've move the rule around so it is at top now, since it does not require any other room to be defined before defining it, since it is generically calling any room "P".

As you can see this story uses fewer lines and is less error prone since everything that describes the room is right there with the room being created.

No comments:

Post a Comment

Implementing Help in a Story