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

Integers of form 'A000'

Status
Not open for further replies.
Level 7
Joined
Jan 30, 2011
Messages
267
i have some questions about this form of integers: 'a000' (its not hexadecimal)
so far i know that each of the 4 positions has 2^8 = 256 different characters
but what are these characters? does anyone have a list of the 0-255 value of each character?
(e.g. '0' = (2^0)*48, => '0000' = (2^0)*48 + (2^8)*48 + (2^16)*48 + 2^24*48)
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
It's the default ASCII character table, here it is:
asciifull.gif

You have to look at the decimal value that represents your character.
Though your formula is correct, I would rather prefer this:
(256³ * N1) + (256² * N2) + (256 * N3) + (N4)​
N1-4 are the decimal ASCII codes for that character as seen in the table above.
The reason is simple: it's pretty much the inverse of what you do. You start with 2^0, which is the last character in the 4-digit code. That's counter-intuitive.
In my formula, N1 is the first digit, N2 the second and so on.
Making it 256 to the power of the digit also simplifies it a great deal.
 
Last edited:
Level 14
Joined
Apr 20, 2009
Messages
1,543
I just like using my
JASS:
'~01~' '[01]' '(01)' '{01}'
RAW codes for Lua ;)
Creating own RAW patterns through ASCII is very useful for whenever you are working with several coders that have their own map for one project to work on simultaniously.

For example, I document my RAW codes with my Initials 'HH01', 'HH02' etc. While the other coders of my project do the same thing with their initials,
we can create systems (if they ever do need custom objects) that make use of Lua object generation.

This way no one will interfer with their code and everything can in the end be imported into 1 map. Where the Lua scripts and the systems get put together with the terrain.
If everything went well, you don't have the problem anymore of having to send each other the "right version" of the project's map.
And this will increase the speed of your project by an immense amount since no one has to wait for others.
Everyone can just work on their own thing whenever they please.

Just my 2 cents for today for anyone planning to start a new project...
Documentation is key to a fast workflow, keep that in mind :)

Documenting naming conventions and coding standards are also really nice when working in a group.
They give more structure and readability as a whole in your project.
 
Status
Not open for further replies.
Top