Quote
Originally posted by Azdara:
**The thing that confused me is the way nova tools has the explanation in the outfit editor, because it says, like arturo, that it uses five bits for each colour, RRRRRGGGGGBBBBB, but the field where you type the number is a 0-32767 range, and I can't understand what the hell it means... all the different numbers.
**
Yes that five bits per primary color thing is partly to blame for the confusion. The other thing that creates more confusion is that even though the game-engine internal representation, and Nova bible documentation, is a 16-bit hexadecimal number, the Novatools outfit ModVal needs a decimal integer to be entered.
The individual algorithm for determining each of the primary color values is:
color_percentage * 31 * bit_position_factor
Where:
color_percentage is from 0 to 100
31 is the highest possible decimal integer value for each individual primary color (2^5 = 32 which yields a range of 0 to 31)
bit_position_factor value is 1 for blue, 32 for green, and 1024 for red
(note: the product of "color_percentage * 31" must be reduced to an integer value)
This general calculation is performed for each of the RGB primary colors and then the three values are added together to get the ModVal entry.
So the whole ModVal decimal integer can be calculated as follows:
ModVal = (red% * 31 * 1024) + (green% * 31 * 32) + (blue% * 31 * 1)
(edit: added integer qualifications)
------------------
"No man is an island ... he's a peninsula." - Jorma Kaukonen
(This message has been edited by Arturo (edited 07-30-2003).)