Author Topic: Figured out the SCANG.DAT  (Read 890 times)

Offline Dogstar359

  • Squaddie
  • *
  • Posts: 3
    • View Profile
Figured out the SCANG.DAT
« on: March 03, 2019, 07:00:41 pm »
Hi everybody i last night decided to have a crack at the SCANG.DAT file for ufo. Using MCDEdit the file contains 418 icons to choose. I open up SCANG.DAT with a hex editor, and added a string of zeros at the bottom of the file, thinking nothing would happen. I fired up MCDEdit to now find more than 418, although all black. After a bit of fiddling around, I found that the start offset for the first icon starts at offset 240 hex or search for

F2 F3 F3 81 00 F2 F3 F3 00 00 10 10 00 00 00 10

The cool part is that thanks to MCDEdit i even know what the hex values represent.

You see each map icon is made up of 16 pieces, ergo 16 bytes, and each hex code represents a colour code e.g 20 - 2F would be red D0 - DF would be blue.

Ive made some new icons for a ship im making so when i can i will show that it works in game, but if anyone can contact volutar maybe he can intergrate this feature into his tool.

Im sure you map and tile makers should find this useful.

Offline luke83

  • Commander
  • *****
  • Posts: 1566
    • View Profile
    • openxcommods
Re: Figured out the SCANG.DAT
« Reply #1 on: March 04, 2019, 03:37:51 am »
Mapview2 has just brought in scan data but i have not personally tried i yet but i am going to need to shortly has i keep building new maps and have not fixed these yet.

Online kevL

  • Colonel
  • ****
  • Posts: 323
  • pitchforks and torches
    • View Profile
Re: Figured out the SCANG.DAT
« Reply #2 on: March 04, 2019, 06:51:20 am »

PckViewII can edit SCANG.DAT (as of 2019 feb).

a) you cannot create a SCANG.DAT, only edit an existing SCANG.DAT
b) it must be in the GEODATA folder of the Configurator's basepath.
c) to add an icon, first export one of the existing icons to PNG, then import that PNG at the end of the table (4x4 8-bpp indexed)
d) open the new icon in PckView's editor and open the Palette table.
e) click the "Locked" text at the top of the editor to enable painting ...
f) click on a palette-swatch in the Palette table and click on a pixel of the icon in the editor to color that pixel with the color/index of the swatch.
g) paint your new icon one pixel at a time (there's only 16 pixels in an icon)
h) rinse & repeat
i) save file when done (no warnings are given in Pckview2...)

I suggest editing a copy of SCANG.DAT, keep the original file intact.

the format of the file is very simple: each group of 16 bytes make up a 4x4 image, each byte is a palette-id

ps. I'm presently working on a new app that will package w/ Mapview2: McdView that ought mimic the functionality of Volutar's MCDEdit ...

pps. the first 35 icons are reserved for units and items on the battlefield, so count starts at #36 ( less than #36 = #0 aka no scang )
« Last Edit: April 16, 2019, 12:12:46 am by kevL »