• 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.

[Inquiry] Syntax Error?

Status
Not open for further replies.
Level 20
Joined
Jul 12, 2010
Messages
1,735
Could somebody help me with this code? Idk what I'm doing wrong=/
vJass Class Practice Lesson 14 P2
JASS:
/*
*   Declare a unit array called riflez
*
*       Set position 1424 to a rifleman created for Player 3 at position 1.234, -1.234 with facing 182.2
*
*   Run the map
*/

//! runtextmacro Variables()
unit array riflez
//! runtextmacro Actions()
set riflez[1424] = CreateUnit(Player(2), '000', 1.234, -1.234, 182.2)
//! runtextmacro End_Code()

EDIT:
This problem is solved, thnx everyone!
 
Last edited:
Level 19
Joined
Aug 8, 2007
Messages
2,765
so the final outcome is:
JASS:
set u[1424] = CreateUnit(Player(2), '000', 1.234, -1.234, 182.2)
right?

thnx for the help aswell!

well no, you forgot the first letter in the ASCII

CreateUnit(#,'000',#,#,#)

unit ASCII indentifiers (rawcodes) are always 4 characters
 
Level 20
Joined
Jul 12, 2010
Messages
1,735
well no, you forgot the first letter in the ASCII

CreateUnit(#,'000',#,#,#)

unit ASCII indentifiers (rawcodes) are always 4 characters
yeah well the actually code was
JASS:
set u[1424] = CreateUnit(Player(2), 'hfoo', 1.234, -1.234, 182.2)
idk why i putted 000 in there while pasting it :D

you can even use 'a', it will just convert to ASCII(a), it will not throw errors, just not spawn anything
well yeah but the problem wasn't the unit id lol, anyway thnx to everyone for helping, this is already solved!
 
Level 20
Joined
Jul 12, 2010
Messages
1,735
what is 'hfoo'? : P
hfoo is the UnitID, in this case h stands for "human" and foo stands for "footman" so it gives HumanFootman
another example is "hpal" which gives HumanPaladin.

If you go in Object Editor -> Units and press Ctrl + D you can see the ID of every unit.

also, what's the dif between position and index for arrays? What would the position of 1424 be as an index?
position and index are the same thing i think although not 100% sure.
I'm still a beginner jasser so it's better if you ask a more experienced jasser for that :p
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
everyone working with Jass knows what 'hfoo' is, Nestharus knows it too, he "proved it" in one of his tutorial videos
and noone knows all rawcodes even through they are intuitive, you wont know rawcode of lets say Furbolg Ursa Warrior if you dont check it
 
Level 20
Joined
Jul 12, 2010
Messages
1,735
I was pointing those things out for a reason =)
what was the reason? lol
everyone working with Jass knows what 'hfoo' is, Nestharus knows it too, he "proved it" in one of his tutorial videos
and noone knows all rawcodes even through they are intuitive, you wont know rawcode of lets say Furbolg Ursa Warrior if you dont check it
yeah, memorizing them all is hard and IMO pointless since you can easily find them.
 
Status
Not open for further replies.
Top