Warcraft 3 documentation
vJASS & Zinc Documentation
For the latest documentation about how it works vJASS and Zinc language layers for Warcraft III, please follow these links:
Jasshelper documentation - Zinc documentation - WC3 Optimizer documentation
This topic is the discussión abut the type integer. You can see all the information about this type keyword HERE.

[types] integer No New Posts Jassdoc

Started by
moyack

0 Members and 1 Guest are viewing this topic.

[types] integer
on: August 10, 2020, 12:17:46 AM

JASS integer values take 32 bits.

Representations

Decimal.- Any number, negative , positive or 0 that does not have a fractionary part: ex: 12 , -199930 , 999999

Octal.- If a number starts with 0 it is considered an octal value, ex: 07 == 7 , 08 causes a syntax error, 012 equals to 10.

Hexadecimal.- If a number starts with 0x it is considered a hex value, ex: 0x2==2, 0xA == 10 , 0x10 == 16 , 0xFF == 255 .

Character.- An asc ii character between '' represents its correspondant number from 0 to 255, ex: 'A'==65 , '<'==60 . Note that certains bytes inside the script file will cause major errors.

4 Characters.- A representation in ASCII of the 4 bytes used by the integer, this representation is mostly used for Unit/ability/tile /upgrade/etc/ ids. Example: 'Aloc' , 'B000'


Re: [types] integer
Reply #1 on: February 22, 2022, 09:28:28 AM

Lua is also compiled with 32-bit integers (game's exe is 64-bit)

Octal: Jass2Lua transpiler does not support integers defined in octal representation and crashes. (Reforged, v1.32.10)

Character: 'hfoo' represents a human footman object code in Jass. These are also called "raw codes" or FourCC. In Jass, these are automatically read as integers by the Jass interpreter.
If you use Lua, you must manually convert a string of four characters to integer with FourCC("hfoo"). This is true for ability IDs, unit/destructable types etc. in any place where the game's API needs an integer to refer to the type of an object.
« Last Edit: February 23, 2022, 01:26:45 PM by City17 »



 

Started by moyack

Replies: 3
Views: 4233
Jassdoc

Started by moyack

Replies: 0
Views: 745
Jassdoc

Started by moyack

Replies: 0
Views: 683
Jassdoc

Started by moyack

Replies: 0
Views: 724
Jassdoc
Vivir aprendiendo.co - A place for learning stuff, in Spanish   Chaos Realm - The world of Game modders and wc3 addicts   Diplo, a gaming community   Power of Corruption, an altered melee featuring Naga and Demon. Play it now!!!   WC3JASS.com - The JASS Vault + vJASS and Zinc   Jetcraft - A Starcraft II mod   WormTastic Clan (wTc)   Warcraft RESOURCES Reforged: Modelos, mapas, proyectos y mas...