
Here is a tutorial which will help guide you through the structure 
of the color file (cols.fcd) and how to edit it to get more colors 
for your shapes than the Color/Shape Editor will allow.

FIRST AND MOST IMPORTANT: Practice safe hex! Make sure you back up 
any FST file you intend to hand edit! Very little sucks as much as 
losing a 400+ polygon shape because you were lazy. 



You'll notice in the FST Shape Editor there are two rows of 
colors in the palette, 10 in the top row and 8 in the bottom.
The difference between the two rows is -
  1. Only the top row is editable through the color editor, and 
  2. The bottom row consists of colors that are immune to 
     light-source shading. They are mainly used for brightly lit 
     objects, such as tracers, landing lights, rocket trails, etc.

However, the cols.fcd file actually has room for 6 more color 
"cells". 4 more in the top row, and 2 in the bottom. Why FST only 
lets you edit 10 at a time is a question I myself am wondering :)

Since the cols.fcd and all shape files are simply text files, you 
can access these "restricted" color cells and put them in your shapes 
from the good 'ol DOS editor.

EDITING THE COLOR FILE

If you pull up cols.fcd, you will see the number "256" in the first 
line. This you do not ever have to change. After that you'll see 
the current color palette information. Each line begins with a 
number that represents the palette number (0 to 255), followed by 
that palette's color information. This information is composed 
simply of the three red, green, and blue values (in hex) that you see 
when you use the Color Editor to make a change. Most of these you 
will not need to worry about, as they are simply black\white values 
that the shapes do not normally use. 

The line numbers you will be most concerned with are:

16  -- Leftmost color in the bottom row of the Shape Editor palette
17  -- 2nd color from the left in the bottom row
18  -- 3rd ""
19  -- 4th ""
20  -- 5th ""
21  -- 6th ""
22  -- 7th ""
23  -- 8th ""
24  -- Non-shadeable shape color (bottom row) unseen in Shape Editor
25  -- ""             ""            ""          ""             ""


144-151 - Shadable shape color (top row) unseen in the Shape Editor
152-159 - ""                   ""                ""               ""
160-167 - ""                   ""                ""               ""
168-175 - ""                   ""                ""               ""
176-183 - Leftmost color in the top row of the Shape Editor palette
184-191 - 2nd color from the left in top row
192-199 - 3rd ""
200-207 - 4th ""
208-215 - 5th ""
216-223 - 6th ""
224-231 - 7th ""
232-239 - 8th ""
240-247 - 9th ""
248-255 - 10th""
                                   
Lines 31-47 contain the color information for the sky, horizon, and 
sea, while lines 48-112 contain the color information for the terrain.
Since these colors are fully editable in FST's color editor, you 
will probably want to use that instead.

OK, first you'll notice that the top row colors have eight lines of 
information for each color. The other seven values represent the 
different shades of that particular color. When you change one of 
these lines, you have to change the other 7. If you don't and just 
put in random values, your shape will change colors as it turns 
towards/away from the sun. Might make for a neat UFO trick, tho..:)
The last number in the series is the color you edited, and the 7 
lines above it are just darker shades of it.

The colors in the bottom row have only one value each, because they 
do not shade.

The easiest way to insert a new color into one of the "restricted" 
cells is to simply make the change in the Color Editor, where you 
can see it. Save it to a temporary .fcd file, and then open up the 
file in the DOS editor. The Color Editor will have already 
converted all eight lines of information to the appropriate shades. 
Now, cut and paste the information to cols.fcd. Remember to renumber 
the lines so that they are all in order. 

  Example: Let's say you want to add a flat yellow to your palette.
  Since there is no more room in the top row of 10 colors, you will 
  have to put it in one of the four restricted cells. 
  1. Bring up the FST Color Editor and change the leftmost object 
     color to your desired shade of yellow.
  2. Save the file as temp.fcd and jump to DOS
  3. Open up temp.fcd in your favorite text editor.
  4. Since you made your change in the leftmost visible color cell, 
     you go to the appropriate line number (176) and mark lines 176
     thru 183. 
  5. Copy the marked info to clipboard and open up cols.fcd.
  6. Since you are putting the new color into a restricted color 
     cell, you can choose line numbers 144, 152, 160, or 168. You
     decide on line 144.
  7. Paste your clipboard info beginning on line 144.
  8. Renumber the pasted lines 144 thru 151, and delete the old lines
     so there are no duplicates.
  9. Save cols.fcd

  SUGGESTION: For the sake of convenience, you will probably want to 
  put the colors you expect to use the least in the restricted 
  cells. For instance, if you're making a military scenario, 
  colors such as purple, orange, pink, lime green, etc., probably 
  won't be appearing much, so this is a good place to store them.

If you want to change one of the colors on the bottom row (the 
non-shadable colors), use the same procedure, except you will only 
copy the last line of color info, since the bottom row color cells 
cannot have more than one shade.
 
EDITING THE SHAPE FILE

In order to apply a restricted color to a shape, you will have to 
do that in DOS as well. Each polygon has it's color information 
stored in two areas of the shape file. The first area is toward the 
top of the file, and is always the hexadecimal value of the last 
line number of the color cell (eg. 183 = b7). The second area is 
beneath a "Group" header and is represented simply as the line 
number itself (183). Fortunately, the color data is always the 
first piece of information in a line, so you have an easy 
rule-of-thumb to go by. You will have to change both values for 
each polygon, which is why you only want to have the less common 
colors in the restricted cells.  

Here are the all the object color line numbers and thier hex values:
You can print this part of the text out and write in the colors  
for a quick reference sheet.

 line
number  hex   color
 16      10  _______  Leftmost color cell on bottom row of Shape Editor  
 17      11  _______  2nd color from left on bottom row of Shape Editor
 18      12  _______  3rd ""
 19      13  _______  4th ""
 20      14  _______  5th ""
 21      15  _______  6th ""
 22      16  _______  7th ""
 23      17  _______  8th ""
 24      18  _______  1st Restricted Non-shadable color (bottom row)
 25      19  _______  2nd Restricted Non-shadable color (bottom row)

151      97  _______  1st Restricted Shadable color (top row)
159      9f  _______  2nd Restricted Shadable color (top row)
167      a7  _______  3rd Restricted Shadable color (top row)
175      af  _______  4th Restricted Shadable color (top row)
183      b7  _______  Leftmost color cell on top row of Shape Editor
191      bf  _______  2nd color from left on top row of Shape Editor
199      c7  _______  3rd ""
207      cf  _______  4th ""
215      d7  _______  5th ""
223      df  _______  6th ""
231      e7  _______  7th ""
239      ef  _______  8th ""
247      f7  _______  9th ""
255      ff  _______  10th ""


*** VERY IMPORTANT ***
Make sure your text editor does not wrap lines! Some of the 
coordinate lines in a shape file are very long and many text 
editors will carry it over to the next line. Fortunately, the DOS 
editor is not one of them. If you are unsure whether or not your 
text editor can handle it, just use the DOS editor. If you save the 
shape file with wrapped lines, it's history.

EXAMPLE OF ASSIGNING A RESTRICTED COLOR TO THE SHAPE FILE

  1. Let's say you want to change the color of the spinner on your 
     aircraft shape to yellow. First, open up the shape file in the 
     Shape Editor. 
  2. Now you want to change to color of the spinner to a color that 
     does not exist anywhere else on the shape, so that you may find 
     it in the text editor and not confuse it with anything else.
  3. You decide on coloring it bright green, which happens to be the
     2nd color cell from the left on the bottom row. Click on each
     poly and color it bright green.
  4. Save the shape file, jump to DOS, and open the file in the 
     text editor.
  5. Now you want to change any polygon that has been "marked" as 
     bright green to yellow. You know that bright green is line 
     number 17, hex value 11, and (from the previous example) that
     yellow is line number 151, hex value 97. You decide to do the 
     hex values first, since they appear first in the file. It will 
     be much easier if your text editor has a search and replace 
     feature, HOWEVER, make sure it confirms each and every change,
     as there are coordinate markers and polygon numbers that share
     the same value as a line number or hex value. REMEMBER, if the 
     number you are about to change is not the first piece of 
     information in a line, SKIP IT!.
  6. Once the hex values have been converted, go down the file until
     you see the word "Group". Now do another search and replace of 
     the line numbers (change 17 to 151). Again, the line number will
     only appear as the first number in a line. Do this until you 
     reach the end of the file.
  7. Save the file and exit. 
  8. Load it up in Shape Viewer, or preferably, the HVIEW program, 
     and verify that the changes were made OK. If you see something 
     unusual, that probably means a polygon number or coordinate was 
     accidentally changed, and you'll have to do it over.

  TIP: When doing a search-and-replace, it helps to put a space 
  before and after each number/hex value you search for. That way, 
  when you search for an occurance of "17", you won't land on things 
  like "1704" or "-34172" which is automatically invalid data.

It looks like a lot of work to just change colors on a shape file, 
but the steps are really quite simple, and I have found that with a 
little practice, I could change 10-12 polys in a shapefile in about 
30-45 seconds. 

                                              Jon

  

