Skeleton Code for OASYS Programming Erin Anderson Dec 14, 1992 Version 1.0 Please note that this is not in any way meant to be documentation for the OASYS program. Nor does this come with the OASYS executables. It is only meant to help understand the BASE.S code used with OASYS. After reading through the code of Escape from Planet Delta by Russell Wallace and programming a bit of my own game using the OASYS system, I decided that it might be much easier for beginners (and for pros who want to save a bit of time) to use a skeleton structure to help start programming a new game. I've taken sections of code directly from Mr. Wallace's ESCAPE.S (Escape from Planet Delta) since it was a sound game, deleted unnecessary code (for the base structure) and added a few pieces of my own code to perhaps enhance the basics a bit. The finished product is a simple code which only needs: - Rooms made, described, and connected - Doors located (room-wise) and placed (direction-wise) - and Items made, described, and placed. The only 'items' I used to start out the code for use are: - A single room (named: intro_room) - A lamp (located in intro_room) - A player I chose to leave the room and player items so the code would at least run correctly. The lamp I decided to keep, for it would be an object which could be manipulated to test the code. The following commands are allowed by the skeleton code: - All 10 directions including Up and Down. (Keyword 'GO' + direction allowed. Also, shorthand for direction allowed with or without 'GO' Ex: 'N' for 'NORTH', 'SE' for 'SOUTHEAST'.) - I(NV(ENTORY)) for list of carried/worn objects. - L(OOK) for room description. - BRIEF, VERBOSE, and NORMAL selections for room description type. - GET/TAKE and DROP for item manipulation. - EXAMINE, LOOK AT and READ for description of item. - REMOVE for clothing items [NOTE: WEAR does not exist in main flow of code.] - LIGHT and EXTINGUISH for lamp items. - OPEN and CLOSE/SHUT for door items. - USE for tips on item usage. - QUIT to exit game - SAVE and RESTORE to save or restore played game. Included but remarked for optional use: - WEAR for clothing items. - EAT and DRINK for food items. REMOVE exists in the code (under method for GET). I left it there because I thought the possibility existed for someone to want to GET something off of themselves. Please note that since WEAR does not exist in the flow of code, REMOVE is fairly useless here. This could be converted to a different method if desired. Notice that LOOK UNDER does not exist. It used to be under the section of EXAMINE, but theoretically I find that you might want to put LOOK UNDER in a different method in case you wish to make a different reply for EXAMINE than you would for LOOK UNDER. Coding on doors has changed only slightly. Doors are not unlocked/locked in the code. They are simply open/closed. Also, doors (in this coding) can only exist in n/s/e/w directions. Assumed maximum weight has been coded as 9998. The lamp in the game is at weight 150. I left it there in the code just to show how it can be used, and so it can be implemented if desired. ESCAPE.S came with many good methods, such as the creating of a door where the door for both rooms were created with one command. For example: if room_1 is north of room_2, then a created door on the south wall of room_1 would automatically set a door on the northern wall of room_2. It was a great code, and one I thought was detrimental to the creation of doors. Another great method was the problem of items and weight that were in a sack, in a sack, in a sack... ESCAPE.S had an excellent recursion program to deal with this problem, so I left it in the code. To these, I added a bit of my own. It is a simple one and one I had seen in many games, yet it was not included in ESCAPE.S code. When an inventory is done on your player, it gives you what you are holding. To this I added a tag for whether it was 'worn' or 'on'. For example: I have a cloak and a hat in my inventory. The cloak is worn, the hat is not. The output will appear as: "You are carrying a hat and a cloak (wearing)." I thought it a simple addition, and it would make it clearer to the player how the item was being used. This is what I have come up with for a simple code for an OASYS program. I did not make changes to any of the OASYS executables, therefore any problems with those should be brought to the attention of the author (Russell Wallace). I must admit I have not playtested this code to it's fullest extent, so if there are any coding errors, please notify me as soon as possible. If you believe that there should be something changed in the code, please feel free to discuss it with me. I am just trying to arrive at something which can be easily used to begin a game with. The intricacies of the game should be left up to the final programmer. This BASE.S is only meant for easing the initial steps. If I should come out with a following version, I believe I will add the following points to it: - In addition to the (wearing) tag on inventory, I plan to make a (wielded) tag. - I am thinking of making REMOVE it's own method. - Adding LOOK UNDER as a method of its own. I hope this has helped someone out there start out on a good foot with programming an excellent game of OASYS. Good luck with it, and I ask that if you have an adventure created which you wouldn't mind sharing, send it along to me. I would enjoy seeing other ideas that people have for games. Erin -