Author Topic: Color code help  (Read 467 times)

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Color code help
« on: November 01, 2011, 04:51:38 am »


               image

Does anyone know the proper color tag for the enemy names? thanks
               
               

               
            

Legacy_The Amethyst Dragon

  • Hero Member
  • *****
  • Posts: 2981
  • Karma: +0/-0
Color code help
« Reply #1 on: November 01, 2011, 06:36:12 am »


               Not right off hand.

However, if you take your .tga screenshot directly from your screenshots folder and open it in GIMP or Photoshop (or whatever good image editing program you use), you should be able to zoom in and get a sample of the text color, which can then be turned into the RGB values you'd need for scripting...assuming you use a script that converts RGB values for text into the proper code readable by NWN (I do because I don't really work well with things like color tokens).
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Color code help
« Reply #2 on: November 01, 2011, 07:07:46 am »


               Well I take this as a last shot, Ill rather wait for full color code as I dont have a good image program and I dont use RGB color function. So if someone knows dont keep it for yourself '<img'>
               
               

               
            

Legacy_Xardex

  • Sr. Member
  • ****
  • Posts: 414
  • Karma: +0/-0
Color code help
« Reply #3 on: November 01, 2011, 11:35:36 am »


               You can do it in paint, at least on windows 7.

Colors from the picture: (RGB)
Orangeish : 158 - 104 - 78
Cyanish : 204 - 219 - 212
Circled : 202 - 175 - 194
Purpleish : 184 - 156 - 171
Blueish : 157 - 176 - 193

But then again... Paint sucks and your screenshot resolution is a tad small aswell, so these values might not be accurate.
               
               

               


                     Modifié par Xardex, 01 novembre 2011 - 11:43 .
                     
                  


            

Legacy_Alex Warren

  • Sr. Member
  • ****
  • Posts: 326
  • Karma: +0/-0
Color code help
« Reply #4 on: November 01, 2011, 06:40:08 pm »


               This is what we have in PRC. I think it might be this light purple color, but I'm not 100% sure
const string PRC_TEXT_BLUE         = "<cfĚţ>";    // used by saving throws.
const string PRC_TEXT_DARK_BLUE    = "<c fÅ£>";    // used for electric damage.
const string PRC_TEXT_GRAY         = "<c™™™>";    // used for negative damage.
const string PRC_TEXT_GREEN        = "<c Å£ >";    // used for acid damage.
const string PRC_TEXT_LIGHT_BLUE   = "<c™ţţ>";    // used for the player's name, and cold damage.
const string PRC_TEXT_LIGHT_GRAY   = "<c°°°>";    // used for system messages.
const string PRC_TEXT_LIGHT_ORANGE = "<cţ™ >";    // used for sonic damage.
const string PRC_TEXT_LIGHT_PURPLE = "<cĚ™Ě>";    // used for a target's name.
const string PRC_TEXT_ORANGE       = "<cÅ£f >";    // used for attack rolls and physical damage.
const string PRC_TEXT_PURPLE       = "<cÄšwÅ£>";    // used for spell casts, as well as magic damage.
const string PRC_TEXT_RED          = "<cÅ£  >";    // used for fire damage.
const string PRC_TEXT_WHITE        = "<cţţţ>";    // used for positive damage.
const string PRC_TEXT_YELLOW       = "<cţţ >";    // used for healing, and sent messages.

               
               

               


                     Modifié par Alex Warren, 01 novembre 2011 - 06:43 .
                     
                  


            

Legacy_Calvinthesneak

  • Hero Member
  • *****
  • Posts: 1159
  • Karma: +0/-0
Color code help
« Reply #5 on: November 01, 2011, 07:34:21 pm »


               Pretty sure the colour codes use something like octal.  I cannot recall exactly anymore I know there is something about it on the vault.

http://nwvault.ign.c...r.Detail&id=931

Anyhow I also belive there is a way built in to apply some colour tokens without defining them, something like setRGB colour, you would have to see the lexicon. http://palmergames.c...oRGBString.html
               
               

               
            

Legacy__six

  • Hero Member
  • *****
  • Posts: 1436
  • Karma: +0/-0
Color code help
« Reply #6 on: November 01, 2011, 09:07:39 pm »


               Edit: oops. Teach me not to read the full thread, I thought you wanted to know how to colour it. Dayum. Well it might help somebody, so not just gonna delete it. Screenshotting and using the colour window in Paint or Photoshop should work well.

OK... this is going to be complicated to explain...

Each letter is a character corresponding to a character code from 0000-0255 (not unlike what you get if you cast a char into an integer in a programming language like C, though the actual values are different). These are given as values <cRGB>.

In a way it's a bit like the 3 digit hexadecimal #RGB colour codes (eg #fff) you can use in web design, but using 8 bits rather than 4 bits worth of characters... Unfortunately not all characters are valid for use in NWScript. Some, like character 0, are just invisible. However you can use a space to represent zero. Others are specifically unusable because of issues with the compiler. Also, the toolset won't let you type in many of the codes. Copy pasting from notepad will work however.

To type out a character for the colour code, hold the Alt key, and type in the number from 0000-0255 you wish to use for the current channel, R G or B. For instance, to get a mid grey you could hold alt, type 0127, release, hold alt, type 0127, release, hold alt, type 0127, release. The 0 is important as the codes must all be 4 digits.

               
               

               


                     Modifié par _six, 01 novembre 2011 - 09:11 .
                     
                  


            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Color code help
« Reply #7 on: November 01, 2011, 11:20:32 pm »


               

_six wrote...
To type out a character for the colour code, hold the Alt key, and type in the number from 0000-0255 you wish to use for the current channel, R G or B. For instance, to get a mid grey you could hold alt, type 0127, release, hold alt, type 0127, release, hold alt, type 0127, release. The 0 is important as the codes must all be 4 digits.[/i]


Interesting trick that I never knew about.  On my system it only seems to work using the 10 key.   I also have not  figured out if it is the OS, Key board driver? or just the hardware of the Key board that allows it.

Thank for the trick Six.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Color code help
« Reply #8 on: November 01, 2011, 11:40:47 pm »


               I found Six's post so interesting I had to google it. Even more interesting is that on some keyboards only the left alt key will work for his method. Also most laptops will not be able to use it due to the lack of a ten key. Still a highly interesting and informitive post.

My current guess is that it is a function of the keyboard that refferances the currently used code page.

Here is the link from my google search that some of you will find usefull.

http://tlt.its.psu.e...ealt.html#using

I would be interested in hearing if this works on lunix or not.
               
               

               


                     Modifié par Lightfoot8, 01 novembre 2011 - 11:41 .
                     
                  


            

Legacy_Bannor Bloodfist

  • Hero Member
  • *****
  • Posts: 1578
  • Karma: +0/-0
Color code help
« Reply #9 on: November 01, 2011, 11:59:25 pm »


               This code method has been around since long before DOS operating system on computers, long before Bill Gates "created" windows.  It should work in Linux as well, as Linus is based on Unix, and Unix was where this originated.

it is not generally taught in schools anymore, unless you have an older (much older) teacher that grew up with early Unix.


As to how it is accomplished, it DOES depend on the hardware of the keyboard, and how that hardware was implemented.  Every single key sends a different code to the computer, the computer associates that code to whatever language files have been assigned.  Each combination of keys also sends a different code.  Ctrl Alt Del for example has one code, Ctrl-Alt-A has a different code, Ctrl-A a different code etc... Typically the key coding is a combination of a maximum of 3 keys combined, Ctrl-Shift + key, Ctrl-Alt + key, etc, but you can't get a code for Ctrl-Alt-Shift-A for example except in rare keyboards.

The "1" above the "Q" key is a different code than the "1" on the ten-key pad.  Depending on the language file and program using those codes, you end up with the same result on your screen, but it is actually a different code number that is sent.

So, it is a combination of hardware, driver, and actual program that interprets the resulting codes.

Edit:  Forgot to give you the Alt-Code listing.
               
               

               


                     Modifié par Bannor Bloodfist, 02 novembre 2011 - 12:08 .
                     
                  


            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Color code help
« Reply #10 on: November 02, 2011, 12:40:15 am »


               Thanks, For the explaination Bannor,

So my last guess of Keyboard Hardware/Code Page was correct.
               
               

               


                     Modifié par Lightfoot8, 02 novembre 2011 - 12:40 .
                     
                  


            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Color code help
« Reply #11 on: November 02, 2011, 01:00:28 am »


               

Lightfoot8 wrote...
Also most laptops will not be able to use it due to the lack of a ten key. Still a highly interesting and informitive post.
 


Most laptops can use numpad functions, however the NUM LOCK is often disguised.  For me it is just a symbol on my F11 key toggled by the key combination FN + F11 (two keys used).  Once there, the 10 pad numbers are from 0 to 9 listed as: m,j,k,l,u,i,o,7,8,9.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Color code help
« Reply #12 on: November 03, 2011, 09:39:00 pm »


               Back to the original Topic.   As far as the color goes, Can you tell me when that color appears?  I went into combat with just me and a few hostils and did not see the color.   Was it assigned to a second ally or hostile group?    

Or did yu already have your question answered to your satisfaction?
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Color code help
« Reply #13 on: November 03, 2011, 09:47:02 pm »


               it appears when a monster uses any speciali ability like aura of fear

but im OK i will try to get color code from xardex's numbers, will see if I mix the right one, btw its none of the Alex Warren's colors as I already tried those, I got these codes as well
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Color code help
« Reply #14 on: November 04, 2011, 01:53:15 am »


               Ok, the text being sent to the chat window below is ARG.1 of the function being called at 0x0045FD28 in nwnmain.exe. Here is ARG.1

< cÌw.>< cÌ.Ì>Gnoll Shaman< /c> casts Magic Missile< /c>.

Gnoll Shaman casts Magic Missile.



Without the spaces after the <  of cource.  

The Hex for the colors there are on the first one   CC 77 FF   the second one is  CC 99 CC
in decimal woild be 204 119 255  and 204 153 204.                 


I am not sure if spell as special ability is the same or not.  If not just give me some more information on who was doing what to recreat it.   Or try following that function call or one of the other ones to the same procedure.   all the the text in the game seems to be proccesed through the same call to 0x00493BD0
               
               

               


                     Modifié par Lightfoot8, 04 novembre 2011 - 04:15 .