;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- ; ; Gamefile: examples.gns ; ; Copyright 1995, Jeff Standish. (jestandi@cs.indiana.edu) ; All rights reserved. ; ; Original version for GINAS 0.3, February 1995. ; Revised to Version 0.4 formatting, August 1995. ; ; ; This file serves to show a number of examples of doing things in GINAS. ; ; To start it, just start up GINAS with the command line: ; c:> ginas examples.gns ; ; assuming, of course, that your version of GINAS is called "ginas". ; ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- ; include the default class and action definitions ; (load "defaults.gns") ; tell the description functions to pay attention to whether locations ; are illuminated, allowing for an example of a working lamp ; (set *ignore-lighting* nil) ; first off, define the initial location where the play starts out ; (object start-room nil (location) ((north . airy-chamber) (ldesc . "This is a cramped, dark little antechamber. Light \ streams into this dusty place from the north, where you \ can just glimpse a much larger and better lit room. ") (light)) nil) ; define a lantern so that can see in the darkened private-room ; (object brass-lantern start-room (light-source getable-object) ((name . "brass lantern") (nouns "lamp" "lantern" "light") (adjectives "shiny" "brass") (duration . 20)) ()) ; spawn a light daemon on the lantern, which will burn down the fuel in ; the lantern, printing warning messages as it grows darker, until it ; finally flickers out ; (spawn (findobject 'brass-lantern) light-daemon) ; create another location to move to ; (object airy-chamber nil (location) ((south . start-room) (ldesc . "This is a large, airy chamber. It is well-lit, if \ somewhat dusty. An opening to the south seems to lead \ to a much smaller room. ") (light)) nil) ; define a portal object that reaches into the private-room ; (object oakdoor1 airy-chamber (portal) ((othername . oakdoor2) (name . "oaken door") (nouns "door") (adjectives "oak" "oaken") (isclosed) (islocked)) ()) ; a key that can unlock the door ; (object key1 airy-chamber (key-object getable-object) ((name . "key") (nouns "key")) ()) ; a darkened, private room ; (object private-room nil (location) ((ldesc . "A private little sanctum. ")) ()) ; this is the second part of the door, since a copy of a portal must be ; in both locations, thus allowing proper referencing of the door from ; both locations ; (object oakdoor2 private-room (portal-other) ((othername . oakdoor1) (name . "oaken door") (nouns "door") (adjectives "oak" "oaken")) ()) ; define the player actor ; (object player-actor start-room (actor) ((name . "player")) nil) ; define a global variable to hold a pointer to the player, allowing easy ; reference to the player by routines defined in "defaults.gns" ; (set *player* (findobject 'player-actor)) ; start up the player-daemon, which tends to updating player-actor and ; prompting the player for commands ; (spawn *player* player-daemon) ; define the initialization function for describing the game and ; printing out the description of the starting location ; (function Initialize () ; print out an intro message (print "Example GINAS Game File\n\ February, 1995. Jeff Standish\n\ Revised August, 1995.\n\b\b") ; must explicitly describe the location the player start out in (method (location-of *player*) descfull) )