Make your own free website on Tripod.com

A.G.S. v2.21
Text Script Commands Manual by Spyros

Main Page
Character

Cursor
Dialogue
Display
File
Game
GUI
Inventory
Music,Sound,Flic

Palette
Object

Room
Screen
String

 

GetLanguageString (int index, string buffer)
Reads the language text string INDEX into BUFFER. The AGS language definition files consist of a collection of numbered strings with various system text in a particular language. Whenever possible, you should use this function rather than putting text directly into your script file, as it gives flexibility and multilingual support.
For example, if you wanted to display a message "Do you want to see the intro?", you should check the message file, and find that message 300 reads "Do you want to watch the introduction?". In this case, you should then use SetLanguageString(300,buffer) rather than using your text directly. You can add your own custom strings to the message files by using message numbers of 500 and above.
Example:
GetLanguageString(550,cutscene)

StrCat (string str1, string str2)
Appends STR2 to the end of STR1. For example, if STR1 contains "Hello" and STR2 contains "world", then after this function has been called, STR1 will contain "Helloworld".
Example:
StrCat (line1,line2);

StrComp (string str1, string str2)
Compares the strings STR1 and STR2. Returns zero if they are identical, and
non-zero if they are not.
Example:
StrComp (string1,string2);

StrCopy (string str1, string str2)
Copies the contents of STR2 into STR1, overwriting STR1's original contents.
Use this instead of the assignment STR1=STR2 .
Example:
StrCopy (string1,string2);

StrFormat (string destination, string fmt, ...)
Processes the string FMT in the same way as the Display function does (ie. replace %d and %s with values of variables), but instead of displaying it on the screen, puts the result into DESTINATION.
Example:
StrFormat (buffer, "You have %d coins.", coins);

StringToInt (string str1)
Converts the string STR1 into an integer, and returns that value. Returns zero if the string does not contain a number.
This function is useful for processing strings input from the user.
Example:
StringToInt("53");  would return 53.
StringToInt("hello");  would return 0.

StrLen (string str1)
Returns the length, in characters, of the string STR1.
Example:
StrLen("time");  would return 4.