[Solved] Region in a hashtable

Status
Not open for further replies.
Level 2
Joined
Jan 26, 2020
Messages
9
Hello,
Im a pretty noob in map creation, and not a developer.
I try to save a region in a hashtable.

  • fight
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set VariableSet pos_hash = (Last created hashtable)
      • Hashtable - Save (Center X of 1x1 <gen>) as 1 of 1 in pos_hash.
      • Set VariableSet pos_x[1] = 1
      • Set VariableSet pos_y[1] = 1
      • Unit - Create 1 Fantassin for Player 1 (Red) at (Center of (Load pos_x[1] of pos_y[1] in pos_hash.)) facing Default building facing degrees

But when i try "save region handle", i have to save 2 integer from another hashtable as a region. Same for location.
The closest i found is "save rect handle", but it doesnt work and i saw another post wich explain that there is multiple rect in a region and thats why its not possible.
Could someone help me? :)
 
Last edited:

Uncle

Warcraft Moderator
Level 69
Joined
Aug 10, 2018
Messages
7,261
Rect seems to work fine, at least you can use it like this:
  • Untitled Trigger 001
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set Variable MyHashtable = (Last created hashtable)
      • Set Variable MyRegion = MyTestRegion <gen>
      • Hashtable - Save Handle of MyRegion as 0 of 0 in MyHashtable.
      • Unit - Create 1 Footman for Player 1 (Red) at (Center of (Load 0 of 0 in MyHashtable)) facing Default building facing degrees
Also, don't forget to actually create your Hashtable.

Variable Types:
MyHashtable = Hashtable
MyRegion = Region
 
Last edited:
Status
Not open for further replies.
Top