From ZCWiki
Jump to navigationJump to search

The keyword int is used to define variables as integer types and to indicate that functions return integer values.

NOTE: "int" does not actually use an integer type, but rather a fixed-point type.


The first example demonstrates how to declare integer variables.

int Hitpoints = 32;

The second example demonstrates how to declare a function that returns an integer.

int GetHitpoints(){
  return Link->HP;


As far as ZScript is concerned, the int data type is for the most part the same as the float data type. Variables defined as int can store positive or negative values, and can be used in math operations with floats without having to convert data types (see typecasting).

See Also