• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Unique Handles

Status
Not open for further replies.
This is going to be difficult to explain, I will however, try my best.

I would like to note that I want a yes or no answer (Unless asking me to elaborate). If I am correct with my suspicions and it works, then I wish to do it my way, irregardless of other, perhaps even better, ways.

In a system I am making, I needed a fake handle to give to a fake item. (An Item that doesn't actually exist in the map) To do this I created an item, saved its handle and then removed it, in hopes of getting a unique unused Handle/Integer.

What I'm asking is:
If Im removing the item, will that handle eventually be recycled and reused later, therefore eliminating its unique-ness and making an overlap?

Thank you for your time,
~MD~
 
Yes. Otherwise that index will be "freed" and able to be used by some other handle that you create in the future. If you just want a unique integer, then you can always just choose a ridiculously high number or a number less than 1048576 and greater than 99. (as far as I know, no handles will be assigned any number between those two numbers)
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
Lightnings start from 1 counting upwards. Weather effects start from 0 counting upwards. Images start from 0 counting upwards. Basically, nearly any local handle does it (and constants). 1048576 = 2^20. Additionally, object editor ids are usually greater/equal 'A000' = 65*256^3+48*(256^2+256+1) = 1093677104. You can use another table or store in negative area. To gain unique ids, you would make a counter and the released ones get thrown onto a stack that you check first for free elements.
 
Once again, sorry for the late reply. I wasn't expecting more conversation on the topic.

Nestharus' comment I vaguely understood, are you saying that the way I was trying to do it would work?

mckill2009, you left me confused. I'm afraid I do not know or understand jass.
-P.s: you should put a space between Dungeon Assault and For Horror in your sig. lol, That got me very confused.
 
Status
Not open for further replies.
Top