Wc3C.net ASCII and warcraft
 Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar

 01-13-2007, 12:02 AM #1 Brent User   Join Date: Feb 2006 Posts: 14 ASCII and warcraft Hi, is there anyone who knows how Warcraft III converts ASCII to base ten? I'm assuming it converts to base ten, since when doing I2S on the "integer" 'A' it spits out 65, which is the base ten equivilant of that ASCII character. however, when doing I2S on the integer 'A000', i get a very large number (I don't have world editor open at the moment, but for 4-digit ASCII codes warcraft seems to convert them to 9 - 10 digit base 10 numbers) does anyone know how warcraft arrives at these large numbers? i found a script by peppar that converts a single ASCII character to decimal, and I want it to work on rawcodes.
 01-13-2007, 12:15 AM #2 CaptainPicard User     Join Date: May 2006 Posts: 205 Submissions (4) Trying my hand at actually helping people, rather than just asking questions... My thought is that it takes a 4-character string and converts it to an integer by multiplying the ASCII value of each character. An integer is a four-byte block, and a character is one byte. No coincidentally, 2^8 = 256 and 256^4 = 2^32 ~4,000,000,000, which is the maximum value of an unsigned integer. But, to see if I'm correct, you should get ('A' = 65)*256^3 + ('0' = 48)*256^2 + ('0' = 48)*256 + ('0' = 48) = 1093677104 for your string 'A000'. Now, since they're guaranteed to have certain character inputs (perhaps even alphanumeric ones) they may be doing the conversions differently, but since you say the integers are on the order of a billion, I expect they're doing it as I show above. Capt. Picard
 01-13-2007, 12:20 AM Guesst This message has been deleted by Guesst. Reason: 2late
01-13-2007, 12:21 AM   #3
Brent
User

Join Date: Feb 2006
Posts: 14

Quote:
 Originally Posted by CaptainPicard Trying my hand at actually helping people, rather than just asking questions... My thought is that it takes a 4-character string and converts it to an integer by multiplying the ASCII value of each character. An integer is a four-byte block, and a character is one byte. No coincidentally, 2^8 = 256 and 256^4 = 2^32 ~4,000,000,000, which is the maximum value of an unsigned integer. But, to see if I'm correct, you should get ('A' = 65)*256^3 + ('0' = 48)*256^2 + ('0' = 48)*256 + ('0' = 48) = 1093677104 for your string 'A000'. Now, since they're guaranteed to have certain character inputs (perhaps even alphanumeric ones) they may be doing the conversions differently, but since you say the integers are on the order of a billion, I expect they're doing it as I show above. Capt. Picard
it appears that they only use the characters A-Z a-z and 0 - 9, however i've tested what you've suggested and it worked out perfectly. thanks a lot!!

 01-13-2007, 04:09 AM #4 Joker User     Join Date: Sep 2006 Posts: 687 Sry for hijacking this thread, but it seems like you got your question answered. So my question is: Is there any type of program that converts colors into ascii that wacraft can understand?
 01-13-2007, 04:11 AM #5 wyrmlord User     Join Date: Feb 2006 Posts: 399 Submissions (2) Like taking a color and converting it to a color code you mean? There's quite a few tools for that in the resources section. __________________ A member of Clan TDG - Quality mapmaking and playtesting. Tired of boring old GUI? Want to learn JASS? Take a look at these tutorials.
 01-13-2007, 04:29 AM #6 Joker User     Join Date: Sep 2006 Posts: 687 I dont see any besides vex's one with the map, but i dont want to go back and forth between maps..
 01-13-2007, 06:15 AM #7 DioD obey     Join Date: Feb 2006 Posts: 1,532 Submissions (4) CS pools uses this
 01-13-2007, 09:14 AM #8 Daelin Kelani Mage     Join Date: Oct 2003 Posts: 737 Submissions (48) If you actually need a program which takes the rawcodes (base 256) from an input file and writes into an output file the base 10 number (the long one) I made something in C++. Tell me if you want this. It's not very complex but it does the trick. :) ~Daelin __________________ I am Grand Magister Daelin Silverwing not Grand Admiral Daelin Proudmoore!!!
01-13-2007, 12:06 PM   #9
Vexorian
Free Software Terrorist

Technical Director

Join Date: Apr 2003
Posts: 14,898

Submissions (37)

Quote:
 Originally Posted by Joker Sry for hijacking this thread, but it seems like you got your question answered. So my question is: Is there any type of program that converts colors into ascii that wacraft can understand?
Colors aren't converted into ascii.

Then again I swear that programs are impractical for this, it is way better to understand how RGB and hex work then |cAARRGGBBtext|r

AA : alpha value
RR : red value
GG : green value
BB : blue value

All of these values are numbers from 0 to 255 in hexadecimal, 0 is 00 , 16 is 10 , 128 is 80 and 255 is FF.

Most of the times you use FF as alpha.

And as for the rest, the bigger the values the lighter the color and viceversa.

FF000000 is black since it got 0 for red, green and blue
FFFFFFFF is white since it got 255 for the 3 main colors
FFFF0000 is pure red
FF00FF00 is pure green
FF0000FF is pure blue.

Then mixing colors is really easy, in the computer world green+red = yellow , green+blue=teal, and red+blue = pink

So FFFFFF00 is yellow.

Then you can get tones between

FFFFFF80 is a mix between yellow and blue. Also if you increase / decrease all of the values at the same time you get lighter and darker colors. FF000030 is a dark blue and FF8080FF is a lighter blue
__________________
 Wc3 map optimizer 5.0 Someone should fix .wav sound in this thing. JassHelper 0.A.2.A Turns your simple code into something that is complicated enough to work.
 Wc3 map optimizer 5.0 JassHelper 0.A.2.A Xye 0.12.1 | Editor/Levels xe0.9 CS16.0 My spells jEdit modes for vJass&Zinc (v9) WarCiTy 0.2.0
Faster != more useful