AGS Pointers for Dummies: Difference between revisions
Jump to navigation
Jump to search
*>Monkey 05 06 m (→testing) |
*>Monkey 05 06 m (→testing) |
||
Line 14: | Line 14: | ||
==Variables== | ==Variables== | ||
A variable, in the context of scripting, is a way to represent a value. In AGS, there are five different [http://www.bigbluecup.com/manual/Datatypes.htm data types] which can be used to represent a variable. These types include '''char''', '''short''', '''int''', '''String'''<span id = "ref_1"><sup>{{link||end_1}}</sup></span>, and '''float'''. A '''char'''-type variable is one that can hold only a single character (i.e., 'A', 'B', etc.) or a number within the range 0 to 255. A '''short'''-type variable can store integers within the range -32768 to 32767. An '''int'''-type variable can store integer values within the range -2147483648 to 2147483647. A '''String'''-type variable can hold a string of characters (i.e., "this is some text!") of ''virtually''<sup>2</sup> infinite length. A '''float'''-type variable can store floating-point decimals within the range -2147483648.0 to 2147483647.0, and has precision<sup>3</sup> up to approximately 6 decimal places, though this will vary based on the actual number. | A variable, in the context of scripting, is a way to represent a value. In AGS, there are five different [http://www.bigbluecup.com/manual/Datatypes.htm data types] which can be used to represent a variable. These types include '''char''', '''short''', '''int''', '''String'''<span id = "ref_1"><sup>{{link||end_1|[1]}}</sup></span>, and '''float'''. A '''char'''-type variable is one that can hold only a single character (i.e., 'A', 'B', etc.) or a number within the range 0 to 255. A '''short'''-type variable can store integers within the range -32768 to 32767. An '''int'''-type variable can store integer values within the range -2147483648 to 2147483647. A '''String'''-type variable can hold a string of characters (i.e., "this is some text!") of ''virtually''<span id = "ref_2"><sup>{{link||end_2|[2]}}</sup></span> infinite length. A '''float'''-type variable can store floating-point decimals within the range -2147483648.0 to 2147483647.0, and has precision<span id = "ref_3"><sup>{{link||end_3|[3]}}</sup></span> up to approximately 6 decimal places, though this will vary based on the actual number. | ||
For information on defining and assigning values to variables read the entry in the manual [http://www.bigbluecup.com/manual/Datatypes.htm here]. | For information on defining and assigning values to variables read the entry in the manual [http://www.bigbluecup.com/manual/Datatypes.htm here]. | ||
==Pointers== | ==Pointers== | ||
Line 274: | Line 268: | ||
=Notes= | =Notes= | ||
<span id = "end_1">{{link||ref_1|< | <span id = "end_1">1. {{link||ref_1|^}} The String type is only defined as of AGS v2.71 and higher. Older versions use the now deprecated string type.</span> | ||
<span id = "end_2">2. {{link||ref_2|^}} The length for Strings is limited by your computer's physical memory. A String will take up 4 bytes of memory, plus 1 byte for each character it contains.</span> | |||
< | <span id = "end_3">3. {{link||ref_3|^}} Floating-point decimals won't always evaluate as you might expect when doing certain mathematical operations (this is due to their precision levels). See the manual entry on {{link|Script language keywords|Data types|data types}} for more information.</span> | ||
[[Category:Intermediate Tutorials]] | [[Category:Intermediate Tutorials]] |