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

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.
 
Level 29
Joined
Mar 10, 2009
Messages
5,016
I dont think you need to make so many fake items or even make one just to
recall a 'thing', coz getting a handleId in hash afterall are integers...
JASS:
//these are already unique instances...
call SaveItemHandle(HT,456789,0,it)
call SaveReal(HT,456789,1,3.0)
call SaveReal(HT,456789,2,1.5)
call SaveUnitHandle(HT,456789,3,1.5)
 
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