• 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.

Specific Unit Integrer

Status
Not open for further replies.
Level 20
Joined
Jul 14, 2011
Messages
3,213
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])
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
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?
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
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.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
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.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
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.
Top