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

Save Handle Of.. Question

Status
Not open for further replies.
Level 13
Joined
Mar 24, 2013
Messages
1,105
I'm sure this is a dumb question but I truly cannot find (Key of (Picked unit)). I see people have it in numerous spells, but when I click on Hashtable-Get Handle ID, the only options I get is to use a variable.

  • Hashtable - Save Handle Of(Last created unit) as someInt[someIndex] of (Key (Picked unit)) in Hashtable
What am I missing?
 
@Jake = uhm, that is a custom script call (unless he just named the variable as udg_something), so he can use it in JNGP... even in GUI he can do that since he is saving the UNIT itself...

BUT, I don't think hashes allow usage of direct objects as keys... which is why we get the HandleId which is done via purge's post...
 
Level 11
Joined
Mar 27, 2011
Messages
293
Well, you should and can use a custom script to resolve this situation my friend. See the command lines that show:

  • Set Caster = (Picked unit)
  • Custom script: set udg_Handle = udg_Caster
The first line determines the picked unit (which is generally picked of a group of units)
The second states that the "key" / handle that will be used is the proprio "Caster" is an efficient way of working with Hashtables.
The programming language GUI supports custom scripts (provided they are written correctly).

I sincerely hope that has helped, anything let me know. It is an honor to help.
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
Well, you should and can use a custom script to resolve this situation my friend. See the command lines that show:

  • Set Caster = (Picked unit)
  • Custom script: set udg_Handle = udg_Caster
The first line determines the picked unit (which is generally picked of a group of units)
The second states that the "key" / handle that will be used is the proprio "Caster" is an efficient way of working with Hashtables.
The programming language GUI supports custom scripts (provided they are written correctly).

I sincerely hope that has helped, anything let me know. It is an honor to help.

When saving with hashtables you use integers not handles.
You need to convert the unit to a unique integer. ( That units handle id)
Thats why you use this
  • Set tempUnit = casting unit
  • Custom script: set udg_tempKey = GetHandleId( udg_tempUnit)
 
Status
Not open for further replies.
Top