The short answer is that it exports .bmp pairs, which means a texture and a paired alpha channel, which simply dictates the transparency of the main texture. When converted to FSH, those will be combined together.
And the way 3DSMax works is that the scripts placed in a certain location are loaded automatically upon startup of 3DS Max. But for each scene, you need to initialise it's lighting and camera rig, handled by extra buttons which the script adds to the UI.
SC4BAT is launched separately from gMax, but is basically a plugin/script too. So assuming we had such a script, when ran, it should ideally handle this somehow.
I'm going to make the assumption you weren't looking for the short answer... Warning, wall of text incoming.
First up, if you need a model you can render for testing purposes with gMax,
see here. Similar models exist for 3DS Max too, I picked the canal because it's a reasonably simple model.
SC4BAT is a plugin for gMax, so it's that which contains the scripts and settings for exporting SC4 Models. gMax can render stuff, but natively that's fully 3D models.
Exporting is a two-step process, the first just creates something called LODs. A LOD is basically a box that covers the entire area of the model. SC4 Models need three of them, one for Z5, Z4 and Z3, hence they are named LOD3, LOD4 and LOD5 in your scene. The LODs are created, 4 for each zoom level, covering the rotations/viewpoints of the game (z1 and z2 LODs are a very simple box which is auto-generated, but does not exist in the scene). This is the part that 3DS Max users will still do using SC4BAT. Part of the BAT4MAX scripts help to create suitable LODs automatically, but they are imported as .3DS models into SC4BAT. This step also denotes the ID, picked based on a timestamp, which has been great at avoiding conflicts. All of this can be done by making three suitable LODs in Blender and Exporting them as a 3DS file into SC4BAT. Then you end up with an .SC4Model file, which is full of blank textures, but has the LODs, IDs and UV Mapping settings needed for the next step...
Now the part that we are trying to achieve in Blender, let's assume we've got the 20 camera angles/lighting rig all setup correctly. It just needs to render 20 .bmp files. Here's how BAT4MAX's scripts handle that... so it reads the TGI of the model (the IDs for the textures) from the filename of the SC4Model file. I'll walk you through an example:
So if you look through your plugins folder, note how many files will be named such that the TGI or ID is included in the filename. Sometimes they are removed to tidy things up, but in their unmodified state, a typical example would be:
MGB_RetailBanner_Centra-7ab50e44_
e4f71a8f_
30000.SC4Model.
All models should have the same Type ID (the First one, Black) and use the same Instance IDs (Third one, Blue). Also note that 30000 is short for 00030000, where preceding 0's exist, it will cut them, but each ID is always 8-digits in length. Now, that means for every new model, only the Group ID (Middle, Red) will be altered, this basically makes the model unique.
<
I have to mention it, but sometimes a model will actually use the Instance ID as the unique identifier, not the Group ID. This is pretty rare to see in practise, but I think relates to failing to install a patch for SC4BAT. Rather than muddy the waters, for now, let's assume we just have to deal with the Group ID as the identifier.>
So the Instance IDs all work very logically from here on out. 3XXXX is the ID range for each zoom/rotation, which breaks down as follows:
0x0003
TZRUT = TimeofDay | Z = Zoom | R = Rotation | U = Unique ID |
0 - Day Render | 4 - Zoom 5 | 0 - South | 0-F* |
8 - Night Render | 3 - Zoom 4 | 1 - West | |
| 2 - Zoom 3 | 2 - North | |
| 1 - Zoom 2 | 3 - East | |
| 0 - Zoom 1 | | |
* = The unique ID is used when a texture needs to be larger than 256x256px as part of the model. In such cases the texture is broken up into smaller segments, each will have it's own unique identifier from 1 to F (1-16). That's also why no model can be so large that it needs more than 16 textures at zoom 5. Because that's a hard limit of the ID system used for them.
Because these are all fixed, the scripts can work out from the ID of the SC4Model file, the exact IDs needed for each texture that's rendered. Although in practise, those are named simply 0000.bmp / 0000-a.bmp (Alpha or Transparency Channel). The scripts create twenty or more folders, which have the actual IDs. Two batch (.BAT) scripts are generated as part of the process to facilitate this. So the scripts just need to know which folder to place each set of .BMP pairs inside. To help you see what's going on here, I've attached a sample output from the 3DSMax scripts (note: this is only the night render, which overwrites the day render). The scripts can handle switching the
T ID from 0-8 as necessary. So it only creates one set of folders for both day/night images.
All of this is based off the BAT4MAX process. But the tools used with the scripts are things we can re-use easily. One a render's images are all output, it converts them to FSH based on the folder names (IDs) and replaces the previously blank images with the newly-render model's ones.