Hello,
I m trying to use hashtables as 2D arrays so that I don't need masses of arrays for all players. In my map every player has several barracks that produce units and I want to associate every barracks with an index. (So that i can do stuff like "make a hashtable with unitgroups for every barracks, insert all units produced by that rax in the group ...")
My first idea was to create a hashtable on init and put all barracks in there, but when I upgrade one I cant find it any more.
Second idea was to make a region around the position of every barracks and save those, so I only have to check if the producing building is in region 1, 2 ... etc. But I cant do that as well due to the worldeditor crashing.
Is there a workaround for this ? e.g. some Jass code for saving regions/rectangles or sth in my table ?
Thanks in advance,
Leartes
EDIT: I solved my inital problem of recognising the barracks, still I d like to know if there is some custom script code to save/load regions in hashtables
I m trying to use hashtables as 2D arrays so that I don't need masses of arrays for all players. In my map every player has several barracks that produce units and I want to associate every barracks with an index. (So that i can do stuff like "make a hashtable with unitgroups for every barracks, insert all units produced by that rax in the group ...")
My first idea was to create a hashtable on init and put all barracks in there, but when I upgrade one I cant find it any more.
Second idea was to make a region around the position of every barracks and save those, so I only have to check if the producing building is in region 1, 2 ... etc. But I cant do that as well due to the worldeditor crashing.
Is there a workaround for this ? e.g. some Jass code for saving regions/rectangles or sth in my table ?
Thanks in advance,
Leartes
EDIT: I solved my inital problem of recognising the barracks, still I d like to know if there is some custom script code to save/load regions in hashtables
Last edited: