• 🏆 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!

[General] Can someone help me for unit hashtable?

Status
Not open for further replies.
Can Someone show me how to store a unit in a hashtable and then call it back on some location, with its abilities(the abilities are not on him by default), because I don't know? And please don't Give me tutorials, I've read one, can't figuire it out :/

Is it like, load hashtable of (converted unit type to string) as 1 of 1 of hashtable? are his abilities stored in other hashtable? how to store 7 abilities in one hashtable and then give it to the loaded hero? I'd by pleased if someone makes example map for me :)
 
Level 4
Joined
Jan 5, 2014
Messages
79
I will start from the end. I also tried to work with hashtables and saving abilities via hashatbles is buggy and it always shuts my Editor down (I use GUI).

You write
load hashtable of (converted unit type to string) as 1 of 1 of hashtable

I don't know, what you want to achieve there, could you describe more closely what exactly you want?
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
I will start from the end. I also tried to work with hashtables and saving abilities via hashatbles is buggy and it always shuts my Editor down (I use GUI).

You write

I don't know, what you want to achieve there, could you describe more closely what exactly you want?

The actual GUI action causes an error because it is bugged. Take a look at my tutorial Things you should know when using triggers / GUI. It has a list of actions that will simply cause the map editor to freeze and fail.

To store hero abilities in hashtable you first need to know what abilities to check for.
Abilities need to be stored as integers. So this custom script will work.
  • Set tempAbility = Your Ability
  • Custom script: set udg_tempInteger = udg_tempAbility
  • Save tempInteger as 0 of 0 in hashtable
 
Level 4
Joined
Jan 5, 2014
Messages
79
Well so you need something like

  • Actions
    • Hashtable - Save Handle OfYourHeroUnit as 0 of (Player number of (Owner of YourHeroUnit)) in Hashtable
    • Unit - Pause YourHeroUnit
    • Unit - Hide YourHeroUnit
the pause prevent the unit from moving and hide will make it seem to disappear, but it will keep the current abilities

Is this what you were looking for? If not, describe the restart function or spell more closely.
 
Last edited:
Status
Not open for further replies.
Top