• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Unit code how to get it

Status
Not open for further replies.
Level 7
Joined
May 18, 2010
Messages
264
gg_unit_h00O_0052
or ani other
local unit dude = gg_unit_hpea_0001
how to set (hpea_0001)
whyc numbers letters should be there how do i check my units values etc>?
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
I don't quite get your question, perhaps reformulate or or something?

Either way:
- "gg_unit_" just means that it is a preset unit (just like you have gg_cam_ for camera's, gg_rct_ for regions, ...).
- the "hpea" is the raw ID of the unit (you can see this by going to the object editor and pressing CTRL + D, the name "peasant" will change into "hpea").
- "0001" is the Xth unit you placed on the map (starting from 0000).

so gg_unit_hpea_0001 means it is the second unit you placed and it is a peasant.
gg_unit_h00O_0052 is the 53th unit you placed and has as raw ID h00O (meaning it is a custom unit).
 
Level 20
Joined
Jul 6, 2009
Messages
1,885
What he wants to know is how to refer to units placed on map, from what i understood.
As Ap0c said, 3rd and 4th part aren't constant for units. 3rd is the rawcode of unit and you can find the 4th by clicking on a unit and looking at lower part of editor - you'll see: Selection: [unit type] [number for 4th part]
 
Last edited:
Level 13
Joined
May 11, 2008
Messages
1,198
you can do as i do and export map script and place the units yourself. then you can assign them to variables as you create them.

as for unit values i'm not sure what you mean. could you explain that? do you mean like level of unit, hp of unit, and stuff like that?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
Variables like
gg_unit_h00O_0052
which are used to refer to preplaced units/destructables on the map are only generated when you select them in GUI. They are not automatically generated when using JASS so trying to make them up will just throw undeclared namespace syntax errors (and prevent the script from compiling ingame).

You have 3 options to select preplaced objects.
1. Use GUI to allocate the variables and then switch to JASS where they remain allocated.
2. Use an enumerator to go through all preplaced objects and run some code.
3. Delete all preplaced objects and create them via trigger scripts. This can be the best solution as you can streamline loading (not generating un-needed objects).
 
Level 13
Joined
May 11, 2008
Messages
1,198
Variables like
gg_unit_h00O_0052
which are used to refer to preplaced units/destructables on the map are only generated when you select them in GUI. They are not automatically generated when using JASS so trying to make them up will just throw undeclared namespace syntax errors (and prevent the script from compiling ingame).

You have 3 options to select preplaced objects.
1. Use GUI to allocate the variables and then switch to JASS where they remain allocated.
2. Use an enumerator to go through all preplaced objects and run some code.
3. Delete all preplaced objects and create them via trigger scripts. This can be the best solution as you can streamline loading (not generating un-needed objects).

option 1 is convenient if you're still new to jass...
but option 3 is thirty thousand times better.
never done option 2.
 
Status
Not open for further replies.
Top