• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] What's the difference? (variables)

Status
Not open for further replies.
Level 16
Joined
May 1, 2008
Messages
1,605
Moin moin -_-;

I just want understand it. In GUI I created a variable named "Hero". It's and unittype variable with array.
Now I set "set Hero[1] = Furbolg Shaman ('H000')" <- works!

In jass I create a "local unittype array hero" variable. Now the next line:
"set hero[1] = 'H000'" <- works not (Cannot convert integer to unittype)

Well if I convert the GUI once to jass, then it's 100% the same expect the gui variable is udg_Hero.

So what is the difference here? =O
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
The unit types you know from object editor are represented as integer in jass, by their raw id. Press Ctrl+D in object editor to see it. Normal peasant would be 'hpea' for example. The apostrophes mark that the chars between are in 256 system notation and will be casted to decimal system/it's an integer.

The type unittype in jass is unit classifications like UNIT_TYPE_STRUCTURE.
 
Level 16
Joined
May 1, 2008
Messages
1,605
The unit types you know from object editor are represented as integer in jass, by their raw id. Press Ctrl+D in object editor to see it. Normal peasant would be 'hpea' for example. The apostrophes mark that the chars between are in 256 system notation and will be casted to decimal system/it's an integer.

The type unittype in jass is unit classifications like UNIT_TYPE_STRUCTURE.

HOLY ....! Well omg yes you right and that's why I type in my vJass spell [private constant integer unit = 'H000'] right? XD

Something is in the air, that block my mind this day =( ~ anyway thanks for your help^^ [should I give a rep point for this stupid dumb mistake? ... XD]

Greetings and Peace
Dr. Boom
 
Status
Not open for further replies.
Top