For you to use this tutorial you will need a copy of the STOS adventure Creator (SAC) which you can download on my Atari ST Page. You can also download the STOS Code to the game.
In this tutorial, I am going to show you how to write a full adventure game called Witches Castle using SAC. The story goes like this: The wicked witch has kidnapped the princess and is holding her captive in the castle. A warrior has been charged with the task of defeating the witch, rescuing the princess then escaping the castle. So we have the plot and the main character, so we shall define an adventure game world which is the castle. Let’s make a note of the locations we would find in a castle, the list would look like this:
Castle entrance
Main hall
Dungeon
Throne room
Musty room
Of course, a castle would have more locations than this but I’m just keeping it short and simple. Now let’s add two outside locations.
Lake
Enchanted Forest
In this game, the player would start at the castle entrance and these two locations can be on either side of him while the castle is in front of him.
Now we need some objects which are as followed:
A Steel Key….. used to unlock the dungeon door
An Axe……. To kill the rat
Guards Uniform… Has to be worn to get past the guards
A Goblet… Contains holy water which kills the witch
Now we’ve worked this out, we can enter the information into Sac. Load the creator, go to the location menu and insert the following seven locations.
Location 1
You stand before the mighty castle which is north. On the top of it is an ugly stone gargoyle whose stare sends a shiver up your spine. You can also go west and east.
Location 2
You are beside a beautiful lake that glimmers under the morning sun. It is surrounded by clusters of trees and bushes which glow brightly. You can only go east.
Location 3
You find yourself in the Enchanted Forest which is dark and creepy. The trees and bushes have no beauty and make further movement impossible except west.
Location 4
The main hall of the castle. It has a certain mist of evil about it and full of old junk. To the east stands an arched doorway and west a dungeon. You can also go north and south.
Location 5
You find yourself outside the castle dungeon and all you see is a large steel door. The hall is east.
Location 6
Emerging into the Throne Room you see nothing but murky cobwebs and a small steel throne. You can see a large cauldron and an arched doorway leading west.
Location 7
You are in a bare musty room. A doorway is south.
Now go to the connection definer and insert these connections.
Location 1
West to location 2, East to location 3
Location 2
East to location 1
Location 3
West to location 1
Location 4
South to location 1, West to location 5, East to location 6, North to location 7
Location 5
East to location 4
Location 6
West to location 4
Location 7
South to location 4
Now enter the objects in the object definer along with their locations and object words.
Object 1…a steel key., location (not created), key
Object 2…an axe., location 3, axe
Object 3…a guards uniform., location 2, uniform
Object 4…a goblet., location (not created),goblet
Go straight to the Message definer (m) and enter these messages.
Message 1
The water melts the witch into nothing and drops the key.
Message 2
As you are wearing the uniform, the guards lower the drawbridge to let you in.
Message 3
You kill the rat and a goblet of holy water appears.
Message 4
The witch is here, she is holding a steel key.
Message 5
You unlock the door and the princess runs out and gives you a big hug then says C’mon let’s leave this castle.
Message 6
There is a vicious rat here.
Message 7
The princess is here.
Message 8
Well done, you have rescued the princess and completed your task.
Message 9
The guards refuse to let you in the castle.
If you wish, you can add some examine messages to the game, this involves four messages in the Examine Object option and as many as you want in the Examine Location option.
Now we have all the data we need for now. if you wish to add more later you can always load it back in.
Now save your data file, load Stos, and load the Editor program.
As you may have guessed we have a rat and a witch in the game as well as a princess so let’s define them as variables.
WITCH=1 : PRINCESS=0 : RAT=1
So at this moment the witch and rat are alive and the princess is not yet rescued. Add these lines as H_P events
if LOC=1 and OB_LOC(3)<>W0RN then print MESSAGE$(9)
if LOC=1 and OB_LOC(3)=W0RN then print MESSAGE$(2) : MAP(1,1)=4
if LOC=6 and WITCH=1 then print MESSAGE$(4)
if LOC=7 and RAT=1 then print MESSAGE$(6)
if MEET=1 then PRINCESS=LOC : print MESSAGE$(7)
if LOC=1 and PRINCESS=LOC then print MESSAGE$(8) : goto 2610
The first event tells Stos that if the player is not wearing the uniform the guards won’t let him in and the second event tells Stos that the guards will let him in because he’s wearing the uniform. The variable W0RN holds the location of worn objects which is 1000. Now add these L_P events.
If WRD$(1)=”throw” and WRD$(2)=”goblet” and OB_LOC(4)=CARRIED then OB_LOC(4)=NC : OB_LOC(1)=LOC : print MESSAGE$(1) : NO=1 : WRD$(1)=”” : WRD$(2)=”” : WITCH=0 : DONE=1
So when the goblet is thrown, it vanishes to the Not Created location, and the key is created at put at the player’s location.
If WRD$(1)=”kill” and WRD$(2)=”rat” and OB_LOC(2)=CARRIED then RAT=0 : OB_LOC(4)=LOC : print MESSAGE$(3) : NO=1 : WRD$(1)=”” : WRD$(2)=”” : DONE=1
This line kills the rat and creates the goblet.
If WRD$(1)=”unlock” and WRD$(2)=”door” and OB_LOC(1)=CARRIED then print MESSAGE$(5) : MEET=1 : NO=1 : WRD$(1)=”” : WRD$(2)=”” : DONE=1
This line rescues the princess.
Well, that’s it, the game is finished, all you have to do is change the loading name from ‘game.adv’ to the one you choose when you saved the data from the creator. Give it a test run and correct any mistakes you find. When you’re sure it works okay then why not add a few extras like samples, music, and graphics.
As you can see, you have just written a full adventure game in just one day, with more practice you could write large more complex games with Sac and give them away if you wish.
Before I go, I will give you one last example of how the player can fight monsters that can take more than one hit. Let’s say the player can take 10 hits and the monster can take 5, all you have to do is set and name two variables.
MONSTER=5 : PLAYER=10
Then using the method described in chapter 5, use a L_P event to take a point from each variable every time then use an H_P in the L_P section to check if any of the variables equal 0 and if so, use a message to tell the player that either he or the monster is dead and either end the game or give him some points.
That’s the end of the tutorial. If you write any adventures using Sac then please let me know. I would love to see them.