Tips on STAC Programming By Chris Lloyd, author of Wizard's Tower PRESENTATION : It's worth taking some time over this. It counts for a lot even in a simple text-only game. The QSTART file sets up a basic status bar across the top of the screen. This can be customised to suit, perhaps adding coins carried, the time or such-like. You're not limited to one line. Using the font editor you can jazz it up with a fancy border. You've got three colours to play with, although this will limit your palette in the pictures. Text can be printed in any colour and using simple repeat loops can be faded in and out, perhaps when the character is knocked out or killed. Music is not easy to input but, with a little effort, can sound quite passable. Random events are a nice touch. For example, if the character is in room 20, ( Pool ) then in high priority put : if in 20 and random 12 = 12 then message "A large fish suddenly leaps from the water and with a splash disappears again." Special conditions with a selection of random events can be written, then called in any room. "Dungeon dressing" is also important; a background of objects and features to add atmosphere. A short-cut is to create special conditions which deal with object not really vital to the game. For example special condition 40 could hold code on examining, trying to pick up and break a chair. Then call special 40 in any room you want to add a chair. Since you only have to write one set of responses you can go into some detail. The manual suggests using the same noun number as the object number. This saves a lot of bother later. The response "You can't do that!" can get very annoying after a while, so try and program lots of default responses. Remember if a player finds that he can burn an object, he's likely to try and burn everything at some stage. In low priority you could add, (assuming the same noun and object numbers all below 100 and lighter is object 10) : if verb "burn" and ( noun1 > 0 ) and ( noun1 < 100 ) then if avail noun1 and avail 10 then message "Trying to burn that is not going to help!" Perhaps allow the player to burn a few of the other objects, even the vital magic scroll! Adding a few dozen lines in low priority can catch a most of the "You can't do that!" type messages and add a feeling of depth to the game. I like the "talking to yourself again?" message that you get in Guild of Thieves when it doesn't understand an input with "talk" in it! Be careful with the parser. What seems a obvious input to you may not be to everyone. It's frustrating to have to hunt around for the right words to do a simple thing. Add all similar words to any noun and verb you use. If verb 20 is "hit", make "strike", "bash" etc also verb 20. Allow for various inputs. For example, a player may type in "set fire to" instead of "burn". One to watch for is "give sword to ogre" and "give ogre sword" - the different word order can confuse some code. RPG ELEMENTS : With a little work, simple role-play elements can be worked into a game. A player can be asked to input choices between character types at the start, or random numbers generated and stored in counters as character abilities. For example, on starting, a number between 10 and 20 can be generated and stored in counter 5 and used as the character's strength. Later in the game when the player tries to open a locked chest, you could use the following code to generate a chance of success using the player's strength : if verb "open" and noun "chest" and reset? 40 (chest locked) and then special 50 wait Special 50 - random 20 = counter 20 if set? 41 then message "You try your luck again. You still can't force it." if counter 5 > counter 20 and reset? 41 then message "With some effort you prise the lid open." set 40 if counter 5 <= counter 20 and reset? 41 then message "You strain at the chest but it's no good." set 41 Remember that any event that has a random chance of success cannot be too vital to progress in the game, or should have a method of success not dependant on a random chance. You can use similar code to the above to give random chances of success to a whole host of actions. The counters holding the values can be manipulated, perhaps drinking a potion adds 4 to counter 5 (strength). Food and drink are easily handled using counters. For example, in low priority, add responses to eating food : if verb "eat" and noun "orange" and carried 23 (orange) then message "Yummy! That was great." 30 +count 3 (the food counter) In high priority add - dec 3 if counter 3 = 10 then message "You are getting weak from hunger." if counter 3 = 0 then message "You faint from hunger, the ghouls claim you." Time is another thing that can be done relatively easily. Perhaps sections of the game have time limits, eg. getting indoors before dark! A counter is allocated to keeping record of time. Each action can be given a value, for example "inventory" could take no time, while digging a hole could add 20 minutes. The time could be displayed on the status bar and events programmed to happen when it reaches certain values. I hope these hints are of some use to you. STAC is a powerful tool and with effort can produce a very professional adventure. Good luck!