• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

Specific Unit Integrer

Status
Not open for further replies.
What do you mean with "specific unit integer"? A specific amount of units in the map? A value that the unit holds for the entire game? (like Unit[1])
 
Just to go on a bit further with the topic.

I was thinkin about some kind of method to transform the Unit ID into a value between 0 and 8190 with some math formula. Could there be a way to do it efficiently and to retrieve the data by applying a reverse-math?
 
Just to go on a bit further with the topic.

I was thinkin about some kind of method to transform the Unit ID into a value between 0 and 8190 with some math formula. Could there be a way to do it efficiently and to retrieve the data by applying a reverse-math?

You could, but a unit indexer does this way more efficiently. It simply changes the custom value of every unit to something between 1-8190. No numbers are repeated. All indexed units are stored in an array, table or linked list.
 
The thing is Wc3 already indexes unit, and I'm pretty sure that transforming that ID keeping it's unrepeatable-ness with a simple formula is better than a whole indexing system.
 
edo494... EVERYTHING in computing are 1's and 0's, so, yes, they're numbers, so are colors, videos, sounds, codes, text, etc. Any kind of computing data are numbers too.

If a unit is "9034850923" you can kill "9034850923" and the unit will die. Let's say that they're not numbers, but they all have a numeric reference, just like a codebar.
 
Status
Not open for further replies.
Back
Top