APPLICATIONS ★ GRAPHICS ADVENTURE CREATOR: PROGRAMMING TUTORIAL 3 ★

Gac - Programming Tutorial Part 3 (Amstrad Action)
★ Ce texte vous est présenté dans sa version originale ★ 
 ★ This text is presented to you in its original version ★ 
 ★ Este texto se presenta en su versión original ★ 
 ★ Dieser Text wird in seiner Originalfassung präsentiert ★ 

This month we look at the 'guts'of the adventure - the conditions. Conditions are used for puzzles and programming the adventure how to react to different situations and player input...

There are three types of conditions:

local, high priority and low priority. GAC processes in the following order:

  1. Print start room description
  2. Do HIGH PRIORITY conditions
  3. Get the adventurer s command
  4. Check for connections and if so, move
  5. o LOCAL conditions (Specific for a room)
  6. Do LOW PRIORITY conditions (General commands)
For example, if you want the computer to describe a room when you type the command 'LOOK' then you would put the following code in the LOW PRIORITY conditions section: IF ( VERB 7 ) LOOK MAIT END So, the general form of a condition is:
  • IF ( some conditions) some actions END
If the conditions are true, then the actions are performed. For more explanation look at the bank adventure example in AA76 and AA77.

All the GAC conditions are:

VERB n Has VERB n been typed? (n is a number in the verb list) VERB 7 will give a TRUE answer if verb number 7 was typed, otherwise it will give FALSE.

NOUN n Has NOUN n been typed? (similar to VERB) ADVE n Has ADVErb n been typed? (similar to VERB)

HERE n Is object n HERE in the same room/location as the player? For example, if you are in room 3 and object 1 is there then HERE 1 will respond TRUE.

CARR n Is object n being CARRied?

AVAI n Is object n AVAIIable for use? (i.e. HERE or being CARRied)

x IN n Is object n IN room x? If object 1 is in room 3, then 1 IN 3 will be TRUE.

WEIG n Give the WEIGht of object n.

SET? n Is marker n SET? (If you're not sure what markers are then look in AA77.)

RES? n Is marker n RESet? (Markers 0-2 have special values defined below:

Mkr 0, if set, means that a room has been described since it was last reset.

Mkr 1, if set, means you are in a light room. Otherwise you are in a dark room.

Mkr 2, if set, means you have a lamp or some other source of light.

If markers 1 and 2 are both reset, then the program will refuse to describe rooms, coming up with the "It's dark" message instead, since you are in a dark room without any light.

Mkr 3, if set, disables the scoring mechanism when you exit from the game.

CTR n Gives you the value of CounTeR n. (For more details on counters see AA77.)

x EQU? n Is x EQUal to the value of counter n? TURN Gives the number of TURNs since the start of the game.

ROOM Gives you the room number of the ROOM you are currently in.

AT n Gives a TRUE answer if you are AT room number n.

condition AND condition Will give a TRUE answer if both of the conditions give TRUE answers, e.g. VERB 1 AND NOUN 2 will be TRUE only if verb 1 and noun 2 are both typed,

condition OR condition Will give TRUE if either conditions are TRUE, or both,

condition XOR condition Will give TRUE if one of the conditions is TRUE and the other is FALSE.

NOT condition Will give a TRUE answer if the condition was FALSE, and vice versa. So NOT VERB 1 will be TRUE if VERB lis FALSE, x < y Gives TRUE if number x is less than number y. x > y Gives TRUE if number x is more than number y.

x = y Gives TRUE if x is equal to y.

RAND x Gives a RANDom number between 0 and (x-1). So RAND 10 might give any number at random in the range 0 to 9.

VBNO Gets the number of the verb in this command.

NO1 Gets the number of the first noun in this command.

NO2 Gets the number of the second noun in this command.

NO1 and NO2 are used to check word order, and to GET and DROP objects without having to have a condition for each one.

All the GAC Actions are:

LOOK Describe the room you are in at the moment.

DESC n DESCribe room number n.

PICT Turns the PICTure display on.

TEXT Turns the picture display off, giving a TEXT only adventure.

GET n GET object number n. If it isn't here, or you've already got it, or ifs too heavy, then the appropriate message is printed.

DROP n DROP object number n. If you haven't got it, then the appropriate message is printed out.

x SWAP y Exchange objects x and y.

OBJ n Describe OBJect number n.

LIST n LIST all objects in room number n.

LIST WITH LISTS all the objects carried WITH you.

x TO n Move object number x TO y. To destroy an object move it to room 0.

SET n SET marker n.

RESE n RESEt marker n.

x CSET n Set x to be value of counter number n.

INCR n INCRease counter n by one. The maximum is 255.

DECR n DECRease counter n by one. The minimum is 0. Trying to increase past 255 or decrease past 0 is ignored.

GOTO n GO TO room n and describe the new room.

CONN n This checks through the CONNection table for a connection from the current room using verb n. If one is found, this gives the room number of the room you would move to if you took the connection, If not, then it gives zero. As an example, if you were in room 3 in the bank adventure, CONN 4 would give 4 because in the connections from room 3, verb 4 (W) would take you to room 4.

STRE n Set the maximum weight you can carry to n. STRE is short for strength.

BRIN n BRINgs object n here (if it exists).

FIND n FIND object n and move to it (if it exists). This does not acknowledge any restrictions (such as connections), so it could be useful in a magic spell or summoning.

SAVE SAVEs the current game position to tape or disk.

LOAD LOADs the current game position from tape or disk.

WAIT WAITs for a new command.

OKAY Prints "Okay' and awaits a new command.

EXIT Stops the game. The player is NOT asked, so j this is for use when the player gets killed or wins.

QUIT The player is asked if s/he wants to continue, and if they type "N*, for "No" when asked if they are ! sure, the game continues, else the game is abandoned.

MESS n Prints MESSage number n.

PRIN n PRINt number n.

LF Prints a Linefeed. Everything from here is printed on a new line.

WITH Is equal to the room number of where things are put when you are carrying them.

HOLD n HOLDs up the game for n fiftieths of a second. For example to freeze the game for 10 seconds use HOLD 500.

x + y Returns the value of x added to y.

x - y Returns the value of x minus y.

In all the above, n, x and y need not be simple numbers. They can be complex expressions (like 2+2 instead of 4 or other words such as CTR 1 or NOD, but expressions should be enclosed in brackets, e.g.

IF ( VERB 3 ) GET 1 OKAY END

will become:

IF ( VERB ( 3 ) ) GET (1) OKAY END

GAC Programming Clinic

If you have any questions on the use of GAC or specific GAC-related problems and queries then jot them down and send them to the Balg's GAC Programming Clinic at the usual AA address.

AA#79

Page précédente : Gac - Programming Tutorial Part 2
★ AMSTRAD CPC ★ DOWNLOAD ★

Files:
» Der  Graphic  Adventure  Creator    GERMANDATE: 2012-12-22
DL: 1425
TYPE: ZIP
SiZE: 25Ko
NOTE: 40 Cyls
.HFE: Χ

» Graphic  Adventure  Creator    (Cracked  version)DATE: 2011-02-09
DL: 1224
TYPE: ZIP
SiZE: 38Ko
NOTE: Extended DSK/40 Cyls
.HFE: Χ

» Graphic  Adventure  Creator    ENGLISHDATE: 2011-04-03
DL: 1220
TYPE: ZIP
SiZE: 127Ko
NOTE: Extended DSK/42 Cyls
.HFE: Χ

» The  Graphic  Adventure  Creator    CNGSOFTDATE: 2013-10-25
DL: 1114
TYPE: ZIP
SiZE: 13Ko
NOTE: 3 Cyls
.HFE: Χ
 
» The  Graphic  Adventure  Creator    ENGLISHDATE: 2011-02-10
DL: 1200
TYPE: ZIP
SiZE: 127Ko
NOTE: Extended DSK/42 Cyls
.HFE: Χ

Adverts/Publicités:
» Der  Graphic  Adventure  Creator    GERMANDATE: 2015-01-08
DL: 411
TYPE: image
SiZE: 354Ko
NOTE: w963*h1367

» The  Graphic  Adventure  CreatorDATE: 2015-01-08
DL: 345
TYPE: image
SiZE: 132Ko
NOTE: w1324*h898

» The  Graphic  Adventure  Creator    (Create  your  own  Graphics  Adventures)    ENGLISHDATE: 2015-01-08
DL: 416
TYPE: image
SiZE: 338Ko
NOTE: w939*h1367

» The  Graphic  Adventure  Creator    (Reason  Enough  to  buy  an  Amstrad)DATE: 2015-01-08
DL: 373
TYPE: image
SiZE: 210Ko
NOTE: w970*h1401

» The  Graphic  Adventure  Creator    (The  Most  Sophiscated.)DATE: 2015-01-08
DL: 352
TYPE: image
SiZE: 80Ko
NOTE: w900*h317

» The  Graphic  Adventure  Creator    (Utility  of  the  Year)DATE: 2015-01-08
DL: 308
TYPE: image
SiZE: 67Ko
NOTE: w397*h591

» The  Graphic  Adventure  Creator    ADVERT    ENGLISHDATE: 2014-05-05
DL: 504
TYPE: image
SiZE: 136Ko
NOTE: w872*h329

» The  Graphic  Adventure  Creator    ADVERT    GERMANDATE: 2014-05-05
DL: 337
TYPE: image
SiZE: 274Ko
NOTE: w758*h1104

» The  Graphic  Adventure  Creator    ENGLISHDATE: 2015-01-08
DL: 409
TYPE: image
SiZE: 125Ko
NOTE: w589*h837

Cover/Package:
» The  Graphic  Adventure  Creator    (Release  DISK)    ENGLISHDATE: 2019-12-06
DL: 623
TYPE: image
SiZE: 888Ko
NOTE: Scan by Loic DANEELS ; w3021*h1884
 

Medias/Supports:
» The  Graphic  Adventure  Creator    (Release  DISC)    ENGLISHDATE: 2016-09-06
DL: 176
TYPE: image
SiZE: 74Ko
NOTE: Scan by Loic Daneels ; w929*h583

» The  Graphic  Adventure  Creator    (Release  DISK)    ENGLISHDATE: 2019-11-21
DL: 159
TYPE: image
SiZE: 212Ko
NOTE: Scan by Loic DANEELS ; w1876*h1173

» The  Graphic  Adventure  Creator    (Release  with  Lenslok-TAPE)    ENGLISHDATE: 2019-05-25
DL: 324
TYPE: image
SiZE: 358Ko
NOTE: Scan by hERMOL ; w2430*h1328

Manuels d'utilisation & docs:
» Graphic  Adventure  Creator    (Writers  Handbook)    ENGLISHDATE: 2014-05-05
DL: 1455
TYPE: PDF
SiZE: 296Ko
NOTE:

» Graphic  Adventure  Creator    ENGLISH    MANUALDATE: 2014-05-05
DL: 3743
TYPE: PDF
SiZE: 1925Ko
NOTE:

Dump cassette:
» The  Graphic  Adventure  Creator    ENGLISHDATE: 2024-03-10
DL: 179
TYPE: ZIP
SiZE: 34Ko
NOTE: Uploaded by CPCLOV ; LENSLOK Protection ;
.DSK: Χ
.CDT: 2

★ AMSTRAD CPC ★ A voir aussi sur CPCrulez , les sujets suivants pourront vous intéresser...

Lien(s):
» Applications » Sprite Generator
» Applications » Labgen (CPC Amstrad International)
» Applications » Address Book (VisioGame/VisioData)
» Applications » Lifegame
» Applications » Jade: Créez vos propres jeux d'aventure!
» Applications » Saga
Je participe au site:
» Vous avez des infos personnel, des fichiers que nous ne possédons pas concernent ce programme ?
» Vous avez remarqué une erreur dans ce texte ?
» Aidez-nous à améliorer cette page : en nous contactant via le forum ou par email.

CPCrulez[Content Management System] v8.7-desktop/c
Page créée en 406 millisecondes et consultée 1469 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.