- Joined
- Jun 16, 2008
- Messages
- 333
unit gg_unit_Edem_0001= null
...
set gg_unit_Edem_0001=BlzCreateUnitWithSkin(p, 'Edem', 11500, 12500, 45.000, 'Edem')
and get gg_unit_Edem_0001 so i can split and put in an array. If I print GetEnumUnit(), I get a long number.GetUnitsOfPlayerAll(Player(15))
--First let's create our Region Table
Regions = {}
--Next let's get our units Unit-Type Id
local id = GetUnitTypeId(YourUnit) --Now we're getting your unit's ID. This will be some integer like 13845062
--Now we use that Unit-Type ID as the Index in our Table
Regions[id] = Put Your Region Here For That Unit-Type
thats a cool tool, its great for JASS maps that want to centralize simple content's definition all in one spot, or just be lazy about making this stuff. i like this option best if youre already locked into dealing with JASS but still are looking into automating this stuff. you dont want the textmacro hell thats your only in-map JASS alternative to it (that i can think of)I use W3X Tools (Beta) to make units automatically cast/patrol to regions in levels, based on their in-editor information.
i was hoping youd come in to say exactly this! if you can use Lua for your map then youve got some really good in map automation options to this topic, i think much more like what iown_azz was originally hoping for, and these options wouldnt require an external toolWith Lua one can enumerate the global/root node for all named elements. Such as all variables for such units.
The only thing about this is that I can't see that number in world editorI think that's sort of what you wanted? From that point on all you have to do is something like:
I tried but I got an error and left it on the thread of the tool... Im using LUA BTWI use W3X Tools (Beta) to make units automatically cast/patrol to regions in levels, based on their in-editor information.
Atleast someone knows what Dr Super Good is talking about because I have no clue...i was hoping youd come in to say exactly this! if you can use Lua for your map then youve got some really good in map automation options to this topic, i think much more like what iown_azz was originally hoping for, and these options wouldnt require an external tool
You got all that from what he said! lol amazing! do you have to know what the units global parent variable is by any chance? I assume it would be in the map file data but Im like warcraft 3, reforged to this game since 2010 when i was a baby... so i dont know any of the tools that can helpif you imagine globals in JASS you might think of each as being its own isolated thing, but in reality theyre all more like siblings, children of some global namespace model. many languages represent that namespace as a dictionary object, if youre familiar with those. in JASS, you dont have programmatic access to that global object, just direct access to its individual children (the global variables you/blizz has defined and exposed). dsg is saying that in Lua you do have access to that global object, and you can reference the collection of its children, meaning all globals in your map. this means you can iterate the global object's children and apply your desired auto patrol logic elegantly using Lua's tools
another thing that works for your benefit in Lua is that you can reference the properties of an object either by literal or by string name (object.property Vs. object["property"]). this is useful when it comes to using a convention to map from: auto-patrol unit global name -> rect global name, because you're dealing with strings at that point