Writing Adventure Games on the Amstrad - 00 - ContentsWriting Adventure Games on the Amstrad - 07 - Actions in AKS?
 ★ Ce texte vous est présenté dans sa version originale ★ 
 ★ This text is presented to you in its original version ★ 
 ★ Este texto se le presenta en su versión original ★ 
 ★ Dieser Text wird in seiner ursprünglichen Fassung Ihnen präsentiert ★ 

The AKS actions are the parts of the vocabulary which cause an action to take place, there are nineteen separate commands, each of which is represented by a two letter abbreviation. A command line starts with an A, to indicate an action. The actions are only performed:

a) as the result of a trigger
or b) as the result of an event firing.

We'll take a look at each of the Actions in turn, together with an explanation of the effect of using each one. Later chapters will show how these commands are actually incorporated within an AKS database, as well as expressions and triggers.

Assign Flag (AF)

AKS provides a number of flags, which may be set to TRUE or FALSE by the user, and then tested in later operations. The assignflag command will set the specified flag to the specified state, and takes the form of:

AF,< fnum > , < flagstatus >

e.g. AF, 11 ,T

where < fnum > is the specified flag and flagstatus is T or F.

NOTE: If flagstatus has a value other than T, then the flag will be set to FALSE, without an error being reported.

DRop (DR)

This will result in the object mentioned in the player's command line being dropped, providing it is being carried, and that it can be dropped. Otherwise, a suitable error message is produced.

EXamine (EX)

The object in the player's command line is tested, and if it is present and may be examined, the description is then printed.

GEt (GE)

As with the drop command, the object to be taken is checked for suitability, and to see if it is present. If all the conditions are met, the object is added to his inventory.


This command causes the player to move in the direction given, moving him to a new location if a connection exists from the player's current location; otherwise printing "You cannot go that way". The command takes the form:

GO,< direction >
e.g. GO,N

where is usually one of N, S, E, W, U or D — indicating north, south, east, west, up or down respectively. The direction may be any word, providing it has been used in both the action and location definition.

HaltCounter (HC)

The AKS system provides a number of counters, which are decremented each move. The HC command will stop the specified counter from counting. The command's form is:

HC, < cnum > e.g. HC, 11

IncScore (IS)

A scoring facility is provided by AKS and the IS command will add the score increment to the score. The command format is:

IS, < int >
e.g. IS, 25

The increment can be positive or negative.

InitialiseCounter (IC)

This will initialise the counter indicated to < int >, and starts the countdown of moves. When 0 is reached, the event < cnum > will fire. The command format is:

IC, < cnum >, < int >
e.g. IC, 11, 10

INventory (IN)

Displays the objects which the player is currently carrying or wearing.

LOad (LO)

This reloads a SAved game from tape.

MoveObject (MO)

This will move the object specified to the location number specified. It takes the format of:

MO, ,
e.g. MO, 12, 24

PutOn (PO)

This changes the status of the object referred to in the command line to show that it is now being worn by the player.

PRint (PR)

Prints the following string onto the screen. The print command takes the form of:

PR < string >
e.g. PR, you cannot eat that!

QUit (QU)

This will quit the game (note: without requesting a confirmation from the player), and then prompts “Another Game?".

SAve (SA)

This saves all the variables associated with the game to tape, so that the game can be reloaded later on.

SCore (SC)

Prints the player's current score on the screen.

TakeOff (TO)

The opposite of PutOn, fairly naturally, this changes the status of the object referred to in the command line from being worn, to being carried by the player.

ZapIn (ZI)

This takes an object from whatever location it is currently at, and brings it to the player's current location. The command form is:

ZI, < obj >
e.g. ZI, 11

ZapOut (ZO)

This takes an object and changes its location to “nowhere”, effectively destroying it. It takes the form of:

ZO, < obj >
e.g. ZO, 11


The parameters to the above actions have maximum and minimum values, which cannot be exceeded; an Amstrad Basic error "Subscript out of range" will occur if you do exceed the values. These are defined as follows:

< int > = BASIC integer (signed).
< fnum > =0..maxflag.
< string > = BASIC string. NB must be surrounded by quotes if the string contains commas.
< obj > =0..noofobjs (where 0 is the player).
< loc > = -1 ..nooflocs (0 is the player, -1 is nowhere)
< cnum > = 0..maxcount.

The upper limits to some of these ranges are set within the program, by the constants at the start of AKS. The initial (and arbitrary) values are:

maxflag = 30
maxcount = 5
maxobj = 20
maxloc = 30

Their values can easily be changed using the normal BASIC editor.

★ YEAR: 1985
★ AUTHORS: Mike Lewis & Simon Price

Page précédente : Writing Adventure Games on the Amstrad - 06 - What is AKS?

CPCrulez[Content Management System] v8.75-desktop/c
Page créée en 125 millisecondes et consultée 188 fois

L'Amstrad CPC est une machine 8 bits à base d'un Z80 à 4MHz. Le premier de la gamme fut le CPC 464 en 1984, équipé d'un lecteur de cassettes intégré il se plaçait en concurrent  du Commodore C64 beaucoup plus compliqué à utiliser et plus cher. Ce fut un réel succès et sorti cette même années le CPC 664 équipé d'un lecteur de disquettes trois pouces intégré. Sa vie fut de courte durée puisqu'en 1985 il fut remplacé par le CPC 6128 qui était plus compact, plus soigné et surtout qui avait 128Ko de RAM au lieu de 64Ko.