Documentation for spacest2.inf


by David Ledgard


This file lists and describes all the files used by my spacestation interactive fiction game. The game is written in the Inform language and based on a sample transcript from Infocom's Planetfall game. Many bits of it could be used in other games or for similar puzzles. The following bits may be of particular interest:


                     The Computer - which has a power cord, keyboard, on/off switch and monitor. There is also an adapter and static outlet. The computer ONLY works when the adapter is in the outlet AND the cord is the adapter AND the switch is on. There is also a password and you can type numbers in quotes which Inform usually rejects. This is done by a LanguageToInformese routine in declaration.h. The screen when examined displays the last text to have appeared. If the player is holding the computer and leaves the room when it is pluged in, the player will automatically unplug it. Also if the computer is in something the player is carrying. All this is achieved by the use of a daemon. Most computer objects are in spacest2.inf but some routines dealing with the computer are also in procs.h notably Initialise which has a command to start the computer daemon. Also NewRoom which unplugs the computer if the player leaves the room.

                     The AstroCola Dispenser found in dispenser.h. This has six selection buttons, a refund button, a coin slot, and credit display, a tray and lights showing which selections are currently available.

                     The Fussbudget NPC/Sidekick which follows you around uttering random comments now and again and can go for a nap found in actors.h.

                     Altered standard procedures found in replacement_procs.h to allow: the status line to display score, time (in chrons) and location (including when on an object); the Fussbudget to utter sage comments when awake and present for certain commands; events to take a different amount depending on how complicated they are and how long they took in Planetfall; and alter the YES/NO comments to Infocom style.

                     Altered standard responses, from Inform to Infocom Planetfall style are founds in declarations.h and extended_grammer.h.

                     A barrier that can only be passed through when wearing a bracelet. Objects on either side can be examined and seen but not taken. The NPC can also be ordered from the other side of the barrier. Libraries dealing with this are barrier.h and actors.h.

                     extended_grammer.h adds the following verbs to Inform's grammer for this game with a default response procedure: break, connect, crush, diagnose, glue, stick, hello, help, info, credits, hint, hints, kick, krip, make, build, megakrip, play, plug, poke, saw, scream, shake, tear, time, trot, type, unplug, use, xyzzy, follow (with some additional procedures used by it). It also extends these verbs: cut, examine, exit, jump, look, put, read, sit, stand, bother, curses, drat, darn, fix, tie, attach, fasten.

                     procs.h drops objects before leaving a room and triggers events depending on what the time in chrons is.


The code is public domain so any one wishing to borrow any of my code is free to. If you don't understand anything just Email me at The program has been divided into bits for several reasons:


                     My Text editor didn't allow me to have files of more than 32k

                     To divide the program into related bits

                     To make it easier to find a specific bit of code


If anyone wishes to expand this game they are welcome to. has already expressed an interest in working on it. I have had enough of the program for the time being, it was only really a programming exercise and nostalgic diversion anyway, I never claimed to be the world's greatest author. There is plenty of room for expansion and Mr. Laird of Activision has given permission for continued work on this game, I quote: "So long as we're given credit and get final say over the game, everything's OK."


I've got a few ideas you might wish to include:

                    Maybe activision would let us resurrect Floyd? I had an idea about that, in Stationfall we meet him in the Robot Pool, well it could be standard patrol procedure to back up a robots memories before it goes on a mission, then you could simply find another robot shell and download his memory into it (note the robot in the picture in the conference room). And he wouldn't have any memory of his rather nasty behaviour, so you could tell him about it and shock him. This can probably be done in the Engineering arc in a Robot Shop location or something. I could implement this myself as I studied Robotics at University so have a few in-jokes I could put in.

                    Add some response or death routine for put fingers in elctrical outlet.

                    Implement the Habitation Arc. With the Station Hallway going from Sector A to Z and divided into 4 arcs this would mean the Habitation Arc goes from Sector D to I, terminated by another bulkhead in Sector D. It can have rooms fore and aft, but not necessarily on every Hallway, also it could have a lower level. Rooms you could expect to find would be Sanfacs, Canteen (maybe with a working version of the food dispenser in stationfall), Kitchen, Hydroponics Bay? (on the lower level), Rec Area (with Double Fannucci and Galactic Overlord games), seperate Crew Quarters for the Station Director, Senior Staff and Crew.

                    As Activision have given permission to extend the game I think it would be best using descriptions lifted from Planetfall/Stationfall to maintain a Planetfall feel to the game, perhaps not exact copies but of a similar style. The crew quarters in Stationfall would probably be a better model than Planetfall as they are Patrol descriptions as opposed to an ancient planet's descriptions. Use the disinform program to decompile the original game files to get some text descriptions or get them straight from the games.

                    Also note that I have mentioned 'simps' in the game these were invented by Arthur C. Clarke, simp standing for smart chimp. Basically they are small monkeys that have had their intelligence genetically enhanced to work in space, they aren't very smart but can perform simple tasks. They communicate using sign language. Their advantage is that they are smaller so use less food, air and water and can get in small spaces. You can have a 'Simp House' room where they live, they haven't been feed for a while so may be quite hostile.

                    Try to keep the science as realistic as possible.

                     There also needs to be a Radiation Suit somewhere in the habitation arc perhaps in a cupboard, store room or the Directors/Chief Engineers Quarters.

                     The Scooter access form will have to be put somewhere too.

                    A library called habitation.h for example can simply be bolted on to the game. You can test it with a simple dummy program starting the player in a Habitation location.


Hierarchy of library calling:



-> declarations.h

->-> parser.h

->-> verblib.h

->-> asktellorder.h

->-> replacement_procs.h

->-> procs.h

->-> classes.h

->-> player.h

-> actors.h

-> dispenser.h

-> scooter.h

-> toolbox.h

-> barrier.h

-> map.h

-> extended_grammer.h

->-> grammar.h

-> footnote.h

-> briefing_room.h

-> control.h

-> locktest.h

-> spacewait.h


The following are Inform standard libraries:





The following are standard libraries by other authors:





Detailed description of Files


Main Files:



This library deals with most of the Fussbudgets actions and reactions.



                     Fussbudget "Fussbudget", this is a very big object. It works out whether: the Fussbudget is awake or asleep and wakes it on command; says if it is carrying anything; makes it follow the player when awake and do random actions occasionly. It recognises the following orders: open, close, wear, use, push, take, play, go, enter, getoff, exit, hello, and give. You can also ask, tell and show it things and ask it to take or wear things.

                     -> Legs "appendages"

                     Procedure push_teleport_button, routine for when the user asks the Fussbudget to push the teleport button.

                     Procedure play_maze, routine for when the user asks the Fussbudget to play the maze

                     Procedure free_fussbudget, routine for when the user frees the Fussbudget from the cage. Used for both awake and asleep possibilities hence the need to be seperated. Asks for tube of nutrient paste if held by user.

                     OXO "pencil and some paper", used to initiate a game of noughts and crosses.

                     Procedure play_OXO, routine for play noughts and crosses. Keeps track of how many wins, draws and loses there have been. Called play typing PLAY NOUGHTS AND CROSSES or as a random event when the Fussbudget asks if you want a game.

                     Procedure enter_dentist, routine used by Fussbudget when you ask it to go into the dentist. Deals with locked door, and already visited possibilities.



Both rooms Hall_l and Store are held here as they are linked by a barrier, which can only be passed through when wearing the bracelet defined in toolbox.h. Objects on either side of the barrier can be examined and seen but not taken. The barrier can be looked through it's description changing with events. The Fussbudget can pass through it independently, this is dealt with in actors.h.


Object List (all Rooms are of class Room which has the light attribute):


                     Hall_l "Main Hallway, Sector L"

                     Barrier "invisible security barrier"

                     Store "Store Room"

                     Procedure leave_store, held seperately for a consistant response.



This library holds all the objects found in the briefing room as I ran out of space in the main program file. It also deals with singualr and pural chairs which are found in three seperate locations. There is a probably a better way of coding plurals but this way does work after a fashion.



                     Photo "framed photograph"

                     Robot "robot in the photograph"

                     Conference_Table "conference table"

                     Tag "name tags", can be read

                     Lounge_Chair "chair"

                     Briefing_Room_Chair "chair"

                     Waiting_Room_Chair "chair"

                     Lounge_Chairs "chairs"



Classes are used where you have more more than one object with some or all of the same characteristics. They reduce coding, and increase reliablity and consistency. Some classes are defined else where in the libraries where they are used if not used by more than one library.



                     followclass, used when the user tries to follow to Fussbudget into the store.

                     Bulkhead, their are two identical bulkhead which share many characteristics these are inherited from this class.

                     OpenBulkMsg procedure used by the Bulkhead class and objects. Text held once only to maintain consistency.

                     Map, holds general map names for the three maps in the Map Room.

                     Room, makes sure all rooms have light.

                     Book, makes sure all readable objects can be read.

                     Class_Table, generic Patrol table can support objects.

                     Class_Chair, generic Patrol chair can be sat on and support objects.

                     Steel, what the cut bars become. As there are two of them the games will say bar or bars as appropriate.

                     Objects Lock1..4, locks that can be examined, used and refered to for all locked objects. Couldn't make them a class a they unlock seperate objects.



Descriptions for all monitors in the Station Control room are held here. Probably could be combined with another library as it is so small. Only place were colour is used in the game.


Object List:

                     Monitors "station monitors"

                     -> Communication_Monitor "communication monitor"

                     -> Computer_Monitor "computer monitor"

                     -> Food_Production_Monitor "food production monitor"

                     -> Life_Support_Monitor "life support monitor"

                     -> Power_Monitor "power monitor"

                     -> Reactor_Monitor "reactor monitor"



Nearly all variables are declared here including Constant, Global, Attribute, and Serial Number Types. Standard procedures and responses are also replaced here. Also several libraries are called from this point.



This library deals with all objects in the Observation Lounge except the Window, Planet, Table, Chair and 50 centimid coin. This is principly: the dispenser; its buttons, slot and tray; a coin in it; can in it; and the carpet which can get staining if you shake and open the drink to quickly. The machine has six buttons for the selection of your drink although some options are sold out. There is also a refund button that moves any coins from the virtual coin store object to the tray. Coin put in the slot are moved to the coin store. Lights next to the buttons indicate which choices are available. There is also a credit display and monitor which goes to the computer room beyond the bulkhead. Classes are used for the buttons and cans for consistency and to reduce duplication of code.


Object List:

                     Carpet "plush carpet", can be stained

                     Dispenser "AstroCola dispenser"

                     ColaMonitor "monitoring device"

                     Cable "snaking cable"

                     Lights "lights next to buttons"

                     Display "credit display", display calculated from contents of coinstore. After a sale the galakmid is removed from the game thus keeping the display correct.

                     Slot "slot", will only accept coins. This is done by the coins themself though with a before insert clause.


                     -> Zorkmid "1 zorkmid coin"

                     Class Button, can be pushed

                     Refund "refund button" of class Button

                     Classic "classic AstroCola button" of class Button

                     CF "caffeine free AstroCola button" of class Button

                     QOC "quad-o-caff AstroCola button" of class Button

                     DCF "diet-caffeine-free AstroCola button" of class Button

                     Diet "diet AstroCola button" of class Button

                     Standard "standard AstroCola button" of class Button

                     Tray "dispenser tray", where the cans and refunded coins appear

                     Class Can, can be drunk

                     StandardCola "can of standard AstroCola" of class Can, this comes out of the dispenser

                     DietCola "can of diet AstroCola" of class Can

                     OpenShakenCan Procedure, used by two objects

                     Class EmptyCan

                     EmptyStandard "empty can of standard AstroCola" of class EmptyCan, this is created after you drink a can

                     EmptyDiet "empty can of diet AstroCola" of class EmptyCan

                     CrushedCan "crushed can", this is created after you crush an empty can



Adds the following verbs to Inform's grammer for this game with a default response procedure:

break, connect, crush, diagnose, glue, stick, hello, help, info, credits, hint, hints, kick, krip, make, build, megakrip, play, plug, poke, saw, scream, shake, tear, time, trot, type, unplug, use, xyzzy, follow (with some additional procedures used by it).


It also extends these verbs:

cut, examine, exit, jump, look, put, read, sit, stand, bother, curses, drat, darn, fix, tie, attach, fasten.



This library is really an overflow on spacest2.inf for when that ran out of space. This library holds all the additional locations that wouldn't fit there and that weren't used by application specific libraries.


Object List (all Rooms are of class Room which has the light attribute):


                     Hab_Bulkhead "habitation bulkhead" of class bulkhead, found in Hall_j. Can only be opened and not closed using ram object.

                     Hall_j "Main Hallway, Sector J", has description for 'ghost' computer room here as default west direction, player can only go there when bulkhead is open. Description differs depending on whether the player is holding the ram and zorkmid and if the fussbudget is there.

                     TeleportRoom "Teleporter Room"

                     -> Teleport "teleport"

                     -> TransporterPad "transporter pad"

                     -> ControlPanel "teleport control panel"

                     -> TeleportButton "red button"

                     MapRoom "Map Room"

                     -> Spacestation "Space Station Map" of class map.

                     -> Colony "Colony Map" of class map.

                     -> Elevator "Space Elevator Map" of class map.

                     Hall_o "Main Hallway, Sector O"

                     Lab "Xeno Biology Lab"

                     -> Device "complicated devices"

                     -> DeviceMonitor "monitor" of class book.

                     -> maze "virtual maze" of class book.

                     -> headset "headset"

                     Hall_p "Main Hallway, Sector P"

                     -> Eng_Bulkhead "engineering bulkhead" of class bulkhead. When opened with ram player dies on raditation poisoning, text describes this. Differs depending on whether fussbudget is there.

                     -> Sign "sign" of class book.

                     CM_SanFac "Command/Medical Arc SanFac"

                     -> Stall "toilet stall"

                     -> Sink "sink"

                     -> TrashCan "trash can"

                     ->-> Rubbish "rubbish"

                     Toilet_Roll "empty toilet roll", found in rubbish after a search.

                     Dentist_Door "dentist's door", can be opened with key.

                     player_enter_dentist - procedure for when the player attempts to go through the dentist's door. Deals with closed door and already visited by fussbudget.

                     Waiting_Room "Dentist's Waiting Room"

                     -> Magazine_Table "table" of class Class_Table.

                     ->-> Annual "Children's Annual" of class book.

                     ->-> Popular_Mechanics "Popular Mechanics Magazine" of class book. Has a property called state which must equal read before the ram can be made.

                     ->-> Galactic_Enquirer "Galactic Enquirer" of class book.

                     ->-> SF_Book "Encyclopaedia of Science Fiction" of class book.

                     hosing "hosing", obtained by asking fussbudget to get it.

                     bits "drills and implements", can't be got but are added to scope.

                     fore_obj "north wall" - new compass directions to deal with fore, aft, port, starboard and deck, still recognises north, south, west, east, up and down.

                     port_obj "west wall"

                     aft_obj "south wall"

                     starboard_obj "east wall"

                     floor "deck"

                     ceiling "ceiling"



This library describes the players bodily parts, clothes and starting possessions and actions associated with them. The objects are moved to the player in the Initialise procedure in procs.h.


Object List:

                     new_player "yourself", let's the player refer to himself as yourself.

                     Mouth "big mouth"

                     Head "big head"

                     Hands "hands"

                     Fingers "fingers"

                     SpaceForm "Class Eight Spacecraft Activation Form HB-68-U"

                     Uniform "Patrol uniform"

                     -> Badge "shoulder badge"

                     Translator "mechanical translator"

                     Pocket "uniform's pocket"

                     -> ID_Card "ID card"

                     -> Credit_Card "Uridium Class Credit Card"

                     -> Coin "1 galakmid coin"

                     Watch "chronometer", when removed the status line stops displaying the time.

                     Isotopes "box of radioactive isotopes"



This library contains the following procedures:

                     Amusing - this displays a list of Amusing things to do in the game after the player has won so as not to give any puzzles away, once AMUSING has been typed at the command line.

                     Initialise - this procedure is run at the start of the game and sets up the following things: new compass to allow fore, aft, port and starboard to work as well as the usual directions; starts the computer daemon which only allows the computer to be on when plugged in; create a new player object so the player can be referred to as 'yourself'; move player to start location with inventory; put uniform in scope so pocket can be examined; open scooter hatch; set scooter landing time; draw status line; and print introductory text.

                     DeathMessage - adds special death message for eating glue special death type 3.

                     InScope - adds stuff in dentists to players scope as well as both sides of the barrier.

                     NewRoom - used by follow class; puts headset back before you leave xeno lab; unplugs computer before you leave office; prints 'screen blank' message if computer has just been unplugged; puts magazine back before you leave dentist's waiting room; and increases time taken to enter/leave scooter to Stationfall standard. This procedure is accessed at the just before leaving an old room/entering a new room so is the place to deal with leaving objects behind or checking if their status has just changed.

                     PrintNote - used by the footnote library to hold the text for each note.

                     PrintRank - prints a different rank depending on your currect score. Called when SCORE typed at the command line or at the end of a game. Also print standard Planetfall 'Treaty of Gishen IV' blurb.

                     PrintTaskName - details the tasks you had to achieve to get different bits of your score.

                     TimePasses - adds 7 chrons per turn standard, deals with problems caused by WAIT command; prints a message when it is time for the scooter to land; prints a message when it is time for the reactor to explode; prints messages a certain amount of trime after you have eaten giving your level of hunger or sets deadflag if you starve; prints message for fussbudget eating crate of fruit when you enter the store; prints message for dieing in scooter because not in couch, hatch open, in docking port, removes achieved scooter take off task; mentions why fussbudget survives takeoff when not in couch; penalises you for leaving the fussbudget; mentions spacestation explosion during your return trip; says if you got max score or cheated and exceded it; and increments variable spaceday at midnight for future versions where you fix the reactor and the game lasts more than one day.



Some Inform standard procedure has to be altered to give the responses I required. Instead of altering them directly I thought it better practice to replace them with new versions so if they went wrong I could revert to the old ones and also to prevent unforseen results occuring in other programs I might work on.



                     DrawStatusLine, display location, score and time. If it a couch, chair or transporter pad it says so. Time displays '????' when you remove your chronometer.

                     InvSub, normally a standard 7 chrons pass per a turn this adds a further 11.

                     QuitSub, for the following procedures when these commands are typed and if the Fussbudget is present and awake it will utter a sage comment.







                     YesOrNo, changes YES/NO comment to Infocom style



As many things as possible that deal with the scooter are held here to allow changes to be made more easily and reliably and the code to be ignored when working on another section of the program. Both the Scooter and Docking_port Rooms are held here as they are linked by the scooter hatch and viewport.


Object List (all Rooms are of class Room which has the light attribute):


Docking_port "Docking Port"

Hatch "hatch" found_in Scooter Docking_port, can't be opened until scooter has landed

Scooter "Scooter"

                     ScooterSlot "slot", accepts form and sets launchtime variable - take off dealt with by timepasses procedure in procs.h.

                     Couch "pilot's couch", statusline tells you when you are sitting on this using the DrawStatusLine procedure in replacement_procs.h.

Viewport "viewport" found_in Scooter Docking_Port, description varies with location



This is the core of the program having most of the locations and quite a few objects. All .h library files are called up from this module either directly or indirectly. This module deals with the Computer, Cage, Observation Lounge (with the exception of the Dispenser), Store Room contents plus several other locations.


Object List (all Rooms are of class Room which has the light attribute):


Sickbay "Sick Bay"

                     Cage - none standard examine description, depends on whether the Fussbudget is awake, asleep or has been rescued from the cage, also small object can be put in between the bars and are described.

                     Bars - The Steel cage Bars when part of the Cage.

                     Steel1, Steel2 - The Steel Cage Bars after they have been cut, of class Steel.

Control "Station Control"

Briefing_Room "Briefing Room"

Hall_k "Main Hallway, Sector K"

Hall_m "Main Hallway, Sector M"

                     Transport - Transport Tube found in Docking_port Hall_m Hall_n Lounge, if you get in it it says "Going down..." or "Going up..." as appropriate.

Hall_n "Main Hallway, Sector N"

Lounge "Observation Lounge"

                     Window "large observation window"

                     Planet "huge gaia class planet"

                     Tables "tables", for plural hack probably a better way of doing it

                     Table "table" of class Class_Table.

                     -> LittleCoin "50 centimid coin"

Office "Director's Office"

                     Outlet "electrical outlet"

                     Cabinet "file cabinet"

                     -> Key - for unlocking Toolbox, Cabinet, Dentist Door

                     -> Manual "computer technical manual" of class Book.

                     Desk "desk" of class Book to allow slip of paper to be read when on desk.

                     -> Computer "portable computer", has daemon so it only works when pluged in.

                     ->-> Screen "big screen"

                     ->-> Kb "keyboard", memo text held here

                     ->-> Cord "power cord", description varies depending on what it is pluged into, plug command processed here.

                     -> Slip "slip of paper"

Adapter "adapter plug" found in Store, description varies depending on what it is pluged into, plug command processed here.

Fruit "wooden crate of mondoweed fruits" found in Store.

Crate "wooden crate", what the Fruit becomes after it has been eaten.

Wood "number of wooden boards", what the Crate becomes after it has been cut up.



This is a hack of the timewait library. Normal time uses hours and minutes but Third Galactic Union time only has one unit - chrons, and there are 10,000 of these in a day. This isn't as far fetched as it sounds, Swatch a watch manufacturer are trying to get a standard internet time based on 1000 units so what ever your local time you will always know when a 'net event is going to occur. When WAIT <num> is typed at the command line the number of chrons typed passes, thus allowing the user to wait for events like getting hungry, scooter take off/landing, the fussbudget going off for a nap and the reactor 'meltdown'. Note WAIT 0 actually waits 1chron as I couldn't get it to not wait at all, not a major problem. Also note this library uses the external object tw_waiting "tw" declared in declarations.h.



This module defines the toolbox and all the objects in it, the syringe found in the sickbay and new objects that can be created from the original objects. Note when the Paste is eaten the hungry and mt variables are set which are used by the TimePasses procedure in procs.h.


Object List:


Toolbox "toolbox"

                     Glue "bottle of super glue"

                     -> Top "top"

                     Bracelet "identity bracelet"

                     Hacksaw "hacksaw"

                     Paste "tube of nutrient paste"

                     Tube "empty tube of nutrient paste"

                     Syringe "empty hypodermic syringe"

                     -> Needle "needle"

                     -> Plunger "plunger"

                     Ram "hydraulic ram"





Inform recognises commands like NPC, DO SOMETHING. This library allows the user to rephrase this to the more natural form ASK/TELL NPC TO DO SOMTHING. Thus preventing the user failing to solve a puzzle involving an NPC because of a 'guess the verb' type problem.



This allows the easy generation of footnotes. Notes are numbered as they appear and if they haven't yet been mentioned can't be referenced. It is very simple to setup, you just include the library, define a constant saying how many there are, put the text for each note in a procedure and the have a short line to call each where you want them to appear. I used to think footnotes were a superfluous add-on but they are useful for mentioning things not directly related to the game plot like internet addresses and previous games.



This library automatically selects key and locked objects first in ambiguous commands. So for example when you have the toolbox and key and type:


(the Toolbox)

(with the Key)

it works out what you want to unlock and with what. To use just give a key object attribute is_key.