Difference between revisions of "Variable"

From AGI Wiki
Jump to navigationJump to search
(Created page with "A '''variable''', also known as a '''var''', can contain an integer value from 0 to 255, thus being the AGI equivalent of a byte (or unsigned char in C and C++). Variables are...")
 
 
(4 intermediate revisions by the same user not shown)
Line 5: Line 5:
 
== See also ==
 
== See also ==
  
* [[Special variables|Special variables]]
+
* [[Special Variables]]
* [[Defines|Defines]]
+
* [[Defines]]
* [[Mathematical commands|Mathematical commands]]
+
* [[AGI Command Reference - Arithmetic Commands|Arithmetic Commands]]
* How to use the [[Inventory items|inventory items]] as variables.
+
* How to use the [[Inventory Items]] as variables.
  
 
== Sources ==
 
== Sources ==
Line 16: Line 16:
 
== Data types ==
 
== Data types ==
  
{{Data types}}
+
{{Data Types}}
 +
 
 +
 
 +
 
 +
[[Category:Variables]]

Latest revision as of 23:31, 25 December 2013

A variable, also known as a var, can contain an integer value from 0 to 255, thus being the AGI equivalent of a byte (or unsigned char in C and C++). Variables are named by combining the prefix v with the number of the variable. There are 256 variables available in AGI, v0 to v255. The variables v0 to v26 have special meaning to the interpreter. You should not attempt to use these 27 variables for your own game data.

It is both possible and recommended to give your variables more meaningful names than a simple letter-number combination. This is possible using defines. The defines.txt file from the AGI Studio Template Game gives define names for the 27 special variables.

See also

Sources

Data types