Home | AGI Documentation | AGI Tutorials | AGI Tools | AGI Wiki | Community

AGI Command Reference

This is a tutorial for AGI Programming if you have any questions post them at sciprogramming.com/

Thanks to the Sarien team and to Nick Sonneveld for some info on the unknown commands.

Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 [ 14 ] 15 16

XIV TEST COMMANDS

The result of test command can be either TRUE or FALSE.

equaln(n,m);

True if Var(n) = m.

equalv(n, m);

true if Var(n) = Var(m).

lessn(n,m);

True if Var(n) < m.

lessv(n, m);

True if Var(n) < Var(m).

greatern(n, m);

True if Var(n) > m.

greaterv(n, m);

True if Var(n) > Var(m).

isset(n);

True if Flag(n) = 1 (set).

isset.v(n);

True if Flag(Var(n)) = 1 (set).

has(n);

True if the room field of item n is 255, i.e. the item belongs to the player.

obj.in.room(n, m);

True if room field of the object n is Var(m).

posn(n, x1, y1, x2, y2);

True if the coordinates of the base point of the cel which is the current image of object n satisfies the equation x1 < = x < = x2, y1 < = y < = y2.

obj.in.box(n, x1, y1, x2, y2);

True if the base of the object n is completely within the rectangle specified using its top left (x1,y1) and bottom right (x2,y2) corners.
(x1, y1)
   ------------------
   |                |
   |                |
   |                |
   ------------------
                  (x2, y2)

center.position(n, x1, y1, x2, y2);

True of the center of the base line of the object n is inside the rectangle specified as its top left and bottom right corners.

right.position(n, x1, y1, x2, y2);

True of the right side of the base line of the object n is inside the rectangle specified as its top left and bottom right corners.

have.key();

True if the user has pressed any key on the keyboard. Used to create cycles to wait until any key is pressed.

compare.strings(s1, s2);

True if string(s1) = string(s2).

said(n, W(i));

where i = 1, ..., n True if the player has entered a phrase that completely matches W(1),...W(n), where n is the number of W(i) which are codes of the vocabulary words.
Here is how the input is matched. After the player types a message and presses Enter, the input line is processed by the interpreter.
Interpreter removes all punctuation marks.
All characters are converted to lowercase.
All sequences of more than one space are replaced with a single space.
Starting with the first word of the input, the interpreter looks up the vocabulary, trying to find the longest character sequence matching the entered.
If the search is unsuccessful, Var(9) is assigned the number of the word in the message that failed to match and the processing ends.
If all the words have been assigned some codes:

controller(n)

True if the event with code n has occurred:

menu item with code n was selected in command menu_input.

Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 [ 14 ] 15 16
 


by helping to defray some of the costs of hosting this site. If it has been of help to you, please consider contributing to help keep it online.
Thank you.
pixe
Top

© 2013 to present The Sierra Help Pages. All rights reserved. All Sierra games, artwork and music © Sierra.