Saturday, 9 June 2018

Heidi in ZIL (The Setting)

This map shows the rooms and objects in the game.


Defining the Rooms


The following ZIL source defines the rooms, joined up as shown in the map.

<ROOM BEFORE-COTTAGE(IN ROOMS)(DESC "In front of a cottage")
    (FLAGS LIGHTBIT)
    (LDESC "You stand outside a cottage. The forest stretches east.")
    (EAST TO FOREST)
>

<ROOM FOREST(IN ROOMS)(DESC "Deep in the forest")
    (FLAGS LIGHTBIT)
    (LDESC "Through the dense foliage, you glimpse a building to the west.
A track heads to the northeast.")
    (WEST TO BEFORE-COTTAGE)
    (NE TO CLEARING)
>

<ROOM CLEARING(IN ROOMS)(DESC "A forest clearing")
    (FLAGS LIGHTBIT)
    (LDESC "A tall sycamore stands in the middle of this clearing.
The path winds southwest through the trees.")
    (SW TO FOREST)
    (UP TO TOP-OF-TREE)
>

<ROOM TOP-OF-TREE(IN ROOMS)(DESC "At the top of the tree")
    (FLAGS LIGHTBIT)
    (LDESC "You cling precariously to the trunk.")
    (DOWN TO CLEARING)
>


Adding the bird and the nest


The following ZIL source defines the bird and the nest, placed as shown in the map.

<OBJECT BIRD(LOC FOREST)(DESC "baby bird")
    (FLAGS TAKEBIT)
    (TEXT "Too young to fly, the nestling tweets helplessly.")
    (SYNONYM BIRD NESTLING)(ADJECTIVE BABY)
>

<OBJECT NEST(LOC CLEARING)(DESC "bird's nest")
    (FLAGS CONTBIT OPENBIT TAKEBIT)
    (TEXT "The nest is carefully woven of twigs and moss.")
    (SYNONYM NEST TWIGS MOSS)(ADJECTIVE BIRD\'S)
>


Adding the tree and the branch


The following ZIL source defines the tree and the branch, placed as shown in the map.

<OBJECT TREE(LOC CLEARING)(DESC "tall sycamore tree")
    (FLAGS NDESCBIT)
    (TEXT "Standing proud in the middle of the clearing,
the stout tree looks easy to climb.")
    (SYNONYM TREE SYCAMORE)(ADJECTIVE TALL STOUT PROUD SYCAMORE)
>

<OBJECT BRANCH(LOC TOP-OF-TREE)(DESC "wide firm bough")
    (FLAGS CONTBIT OPENBIT SURFACEBIT)
    (TEXT "It's flat enough to support a small object.")
    (SYNONYM BOUGH BRANCH)(ADJECTIVE WIDE FIRM FLAT)
>


Adding the Cottage


The following ZIL source defines the cottage, placed as shown in the map.

<OBJECT COTTAGE(LOC BEFORE-COTTAGE)(DESC "tiny cottage")
    (FLAGS NDESCBIT)
    (TEXT "It's small and simple, but you're very happy here.")
    (SYNONYM COTTAGE HOME HOUSE HUT SHED HOVEL)(ADJECTIVE TINY)
>


Finishing Touches


The following modifications make it clear that the player should go east.

<SYNTAX ENTER = V-GO-IN>
<ROUTINE V-GO-IN () <DO-WALK ,P?IN>>


<ROOM BEFORE-COTTAGE(IN ROOMS)(DESC "In front of a cottage")
    (FLAGS LIGHTBIT)
    (LDESC "You stand outside a cottage. The forest stretches east.")
    (EAST TO FOREST)
    (IN SORRY "It's such a lovely day -- much too nice to go inside.")
    (ACTION BEFORE-COTTAGE-F)
>

<ROUTINE BEFORE-COTTAGE-F (RARG)
    <COND (<=? .RARG ,M-BEG>
        <COND (<AND <VERB? WALK> <0? <GETPT ,HERE ,PRSO>>>
            <TELL "The only path lies to the east." CR>)>)>
>

<OBJECT COTTAGE(LOC BEFORE-COTTAGE)(DESC "tiny cottage")
    (FLAGS NDESCBIT)
    (TEXT "It's small and simple, but you're very happy here.")
    (SYNONYM COTTAGE HOME HOUSE HUT SHED HOVEL)(ADJECTIVE TINY)
    (ACTION COTTAGE-F)
>

<ROUTINE COTTAGE-F ()
    <COND (<VERB? ENTER>
        <V-GO-IN>)>
>

No comments:

Post a Comment