Number formats

Want to discuss changes to the UOX3 source code? Got a code-snippet you'd like to post? Anything related to coding/programming goes here!
Post Reply
Saint
UOX3 Apprentice
Posts: 162
Joined: Sun Feb 11, 2007 6:05 pm
Has thanked: 0
Been thanked: 0

Number formats

Post by Saint »

I don't understand how to manipulate the numbers in the code that are in a format like 0x0000


Example: I was trying to find some hues in insideUO, but insideUO uses hexidecimal based numbers.

In the code they are listed as
Blue = 0x0058
Gray = 0x03B2
Red = 0x0026
Orange = 0x0030


But goign through the list of hues in InsideUO shows tehre are no such numbers. In fact, it doesn't seem like any number uses a 0 to start past the x.
Grimson
Developer
Posts: 802
Joined: Sat Jun 04, 2005 1:52 am
Location: Germany
Has thanked: 0
Been thanked: 0

Post by Grimson »

Saint wrote:I don't understand how to manipulate the numbers in the code that are in a format like 0x0000
Those are hexadecimal numbers, as indicated by the leading "0x".
Saint wrote:In fact, it doesn't seem like any number uses a 0 to start past the x.
Leading 0 are just there to keep the visual lenght the same, makes it easier to read and compare the numbers. They have no revelance to the actual value, so you can eighter write 0x58 or 0x0058, even 0x00000000000000000000000000000058, it's all the same value (58 hex in this case).
Saint
UOX3 Apprentice
Posts: 162
Joined: Sun Feb 11, 2007 6:05 pm
Has thanked: 0
Been thanked: 0

Post by Saint »

interesting, my insideuo was off by a factor of 2
Post Reply