Now, records are pretty static, and you must declare every variable/property that will be in that record/struct/whatever it is.
On the other hand, you can simply create a unit for every object you want, and then just create variables/properties on the fly.
Simple just naming any kind of propertyName in any of the functions I made above will create that variable/property. This is very powerful, especially if you don't want to keep going back and forth to your structs/records to do some minute thing.
I use GAx3 specifically for this purpose. Well, that and I can create properties on a unit object on the fly. I just made a post on the battle.net forums, and I saw this just now as well, so thought I'd post.
Use Renee's GAx3 mod, it also has a UnitGetHandleID function or whatever, something like that. It basically assigns a unique ID value to a unit whenever it's called. Using this, you can construct more javascript-like objects, wheres properties can be made dynamically without being declared.
So, take for example you wanted to store a string in a unit (Keep in mind you can create a unit just to act as an object that contains everything, and hide it away). You would make an action like this (Parameters: Unit, String, PropertyName)
This is what it looks like in GUI, when I use this function. "Store string <string> as property <propertyName> on unit <Unit>". And of course, to make it have a variable array amount, you do "Store string <string> as property <propertyName+integer> on unit <Unit>". The array number is simply attached to the end of the propertyname.
Let's say I want to store the text "Burning Exile" on my MasterVariableHolder (a unit that is invisible/hidden/invuln that I placed in a corner of the map). I want this string to be a variable/property called Land0 (Or gv_land[0] equivalent, if we did not use this trick). I would simply do:
Store string "Burning Exile" as property ("Land" + GetLandCount()) on unit MasterVariableHolder.
As the player gets more lands, I can simply just let the function increase the array size (it is not doing anything, but logically it is increasing it as GetLandCount() returns a higher number)
To get the value, it's pretty simple to figure out. But here's what I would do to get the name of a land array 0 (this is what mine looks like in GUI)
Get the string property ("Land" + "0" on unit MasterVariableHolder.
Creating 2d arrays is no problem, or even associative arrays. ("Land" + ("Player" + GetPlayerNumber()) + ("World" + GetWorldNumber()) ) would be an instance of 2d array.
An instance of an associative array is pretty simple... ("Land" + "thirdLand") is one example...
0
@FunBotan: Go
Welcome.
0
@MrGliath: Go
"Set Unit Custom Value" is what you're looking for perhaps? If not, go download GAx3 mod as it has a function to get a unit's unique handle.
0
@ElBushido: Go
Go to data editor, go to abilities tab, type in "Refund" in the search
0
@TCatastrophicT: Go
You have to go into the data editor and find the unit flag for "Cannot be Selected" and uncheck it.
0
@JakeCake26: Go
Why not just work on corruption rpg?
0
@Imperfect1987: Go
I'm pretty sure he's using SC2 models on purpose, as he states it's a SC2/D2 crossover.
0
@soulzek: Go
Efficiency
0
Find the actor/whatever it is for the regular selection model.
Have a trigger to check when the behavior is applied, then have an action change the catalog value of the selection model to what you want.
0
Blizz DotA is fake!!!1
0
@hobbidude: Go
Player handle returns the actual ID of the player as a string, so you could use that. Or ask for user input to put their name in it.
0
@egodbout: Go
HE LIVES!!
0
@soulzek: Go
Nope :)
0
@soulzek: Go
There's no way around that, you'll have to create a unique unit just for that... It sucks, I know :(
0
Breaking this into two posts for aesthetics.
Now, records are pretty static, and you must declare every variable/property that will be in that record/struct/whatever it is.
On the other hand, you can simply create a unit for every object you want, and then just create variables/properties on the fly.
Simple just naming any kind of propertyName in any of the functions I made above will create that variable/property. This is very powerful, especially if you don't want to keep going back and forth to your structs/records to do some minute thing.
0
@DieHappy1234: Go
I use GAx3 specifically for this purpose. Well, that and I can create properties on a unit object on the fly. I just made a post on the battle.net forums, and I saw this just now as well, so thought I'd post.
Use Renee's GAx3 mod, it also has a UnitGetHandleID function or whatever, something like that. It basically assigns a unique ID value to a unit whenever it's called. Using this, you can construct more javascript-like objects, wheres properties can be made dynamically without being declared.
So, take for example you wanted to store a string in a unit (Keep in mind you can create a unit just to act as an object that contains everything, and hide it away). You would make an action like this (Parameters: Unit, String, PropertyName)
and to get the data, you would do (Parameters: Unit, PropertyName)
This is what it looks like in GUI, when I use this function. "Store string <string> as property <propertyName> on unit <Unit>". And of course, to make it have a variable array amount, you do "Store string <string> as property <propertyName+integer> on unit <Unit>". The array number is simply attached to the end of the propertyname.
Let's say I want to store the text "Burning Exile" on my MasterVariableHolder (a unit that is invisible/hidden/invuln that I placed in a corner of the map). I want this string to be a variable/property called Land0 (Or gv_land[0] equivalent, if we did not use this trick). I would simply do:
As the player gets more lands, I can simply just let the function increase the array size (it is not doing anything, but logically it is increasing it as GetLandCount() returns a higher number)
To get the value, it's pretty simple to figure out. But here's what I would do to get the name of a land array 0 (this is what mine looks like in GUI)
Creating 2d arrays is no problem, or even associative arrays. ("Land" + ("Player" + GetPlayerNumber()) + ("World" + GetWorldNumber()) ) would be an instance of 2d array.
An instance of an associative array is pretty simple... ("Land" + "thirdLand") is one example...