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

Hero/Unit with same raw code letter

Status
Not open for further replies.
Level 15
Joined
Aug 7, 2013
Messages
1,338
Hi,

Not sure if this has been mentioned before, but I noticed something interesting about unit raw codes.

It is known that if a unit's raw code begins with a capital letter, it is automatically made into a hero, even if the object which it was based on wasn't a hero originally.

Likewise, if a unit's raw code begins with any symbol except a capital letter, it is automatically made into a normal unit, even if the object which it was based on wasn't a unit originally.

But, what happens when a unit is assigned a raw code that is exactly the same as an existing hero, except the first letter is lower case?

I believe in the alphabet Blizzard uses for raw codes, capital letters count separately from lower case ones, thus these two raw codes aren't equivalent (otherwise my objects would be clashing).

'Y00A' != 'Y00a'

Thus, with this information, we would expect that nothing would happen if we had two objects with these raw codes, both being units.

'H000', 'h000'

However, (with regards to just the information presented in this post), we get unexpected behavior.

Suppose 'H000' is the raw code of a custom human Paladin. Thus its 'unam' is "Paladin."

Suppose 'h000' is the raw code of a custom human footman. Thus its 'unam' is 'Footman.'

When we play the map and select our custom human footman, we find something odd. It's name is not actually "Footman," but "Paladin!"

But, if we go back to our map and view the object editor, our custom unit 'h000''s 'unam' is still "Footman."

Thus, it appears if a unit's raw code is identical to an existing hero unit's raw code except for the capitalization of the first letter of the raw code, that unit's name field will get replaced by that hero's name field in the map.

Now my question is, why does this happen?
 
Level 12
Joined
Mar 13, 2012
Messages
1,121
Now my question is, why does this happen?

Wc3 seems to create an internal data structure in game for some things like names, icons, generally some of the immutable properties of an object for every game instance. This data structure maps the raw code in string representation ignoring the case. So, one object overrides and gets the place in the data structure.

The most strange thing here is that a string representation of the raw code is used, dont know the reasoning behind this.
 
Status
Not open for further replies.
Top