• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[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 64
Joined
Aug 10, 2018
Messages
6,590
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