• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Rawcodes with capital letters for units

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

So it appears that all hero units' rawcodes begins with a capital letter.

And it is also true that all non-hero units' rawcodes always begin with a lower case letter.

Furthermore, if an object is created and given an arbitrary rawcode where the first letter is capitalized, it automatically gets cast into a hero.

I am suspecting this is a hardcoded property in the units objects (capital letters don't seem to matter for any other object AFAIK). Is there anyway to disable it?

Edit: So apparently if you create an object based on a hero, but make the first letter of the new rawcode lower case, it gets cast to a non-hero >_<

Is there anyway around this, i.e. using a lower case letter starting a rawcode for both heroes and non-heroes?
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
So, if I create a unit with an object id of'Abob'and base it off of'hfoo'then it'll become a hero unit that has attributes, experience, levels, etc? Likewise; if I have a unit with object id of'abob'based off of'Hpal'then it won't be a hero and won't have attributes, experience, levels, etc?

I can confirm first one, but not second one.Probably it is correct too.
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
the first one is for sure true, it actually makes it easier to create footman-like looking hero if you change his rawcode to capital letter, because you have all the values defaulted and you get the additional fields.

Its hardcoded, hence not changable.
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
please, read again, and do some testing before posting.

What you said is only relevant to topic because it is rawcode. This is whats the matter:

Furthermore, if an object is created and given an arbitrary rawcode where the first letter is capitalized, it automatically gets cast into a hero.

your rawcode is fully irrelevant to this thread
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
Raw codes are actually 32 bit integers where each of the 4 characters is a 8 bit ASCII character. They can be almost any character although there will likely be difficulties with control characters (not sure if you can represent them in a parser friendly way for JASS scripts).
 
Level 15
Joined
Aug 7, 2013
Messages
1,337
So, if I create a unit with an object id of'Abob'and base it off of'hfoo'then it'll become a hero unit that has attributes, experience, levels, etc? Likewise; if I have a unit with object id of'abob'based off of'Hpal'then it won't be a hero and won't have attributes, experience, levels, etc?

Yes on both accounts (unfortunately). I tested the second case myself, as written in the OP

I made a custom object from Human Paladin ('Hpal') and made its rawcode 'h000.' It became a normal unit, and not a hero.

if you create an object based on a hero, but make the first letter of the new rawcode lower case, it gets cast to a non-hero >_<

I am curious though, what about non-alphabetic characters beginning a rawcode? I expect it wouldn't do any "casting," from non-hero to hero or hero to non-hero.
 
Status
Not open for further replies.
Top