Locomotives and carriages can be automatically numbered by Railworks in the game itself. This means you can have more than one of a particular type of vehicle without the same serial number appearing on all of them.
Railworks is very particular about the setup for getting this to work.
The most important concept to understand is this: in the source model, the digit textures are merely placeholders, not the actual numbers that are visible in the final game.
For each digit of the number, I suggest a TrainDecal.fx Kuju material be used. This allows 8-bit alpha in the texture which gives much more pleasing results than the 1-bit black/white alpha of stencils.
The materials must be named primarynumber_0 up to primarynumber_x where 'x' is the the number of digits in the serial number minus 1. So if there are four digits, the materials must be named from primarynumber_0 to primarynumber_3.
Each of these materials should reference a placeholder texture, and these textures must be named the same as the material name itself, prefixed with decal (a requirement of the TrainDecal.fx shader). ie. decal_primarynumber_0.ace up to decal_primarynumber_x.ace, again where 'x' is the number of digits in the number minus 1.
Pay attention to the case of the filenames - Railworks is very particular when it comes to case. decal_primarynumber_0.ace will work. decal_Primarynumber_0.ace will not.
Once all the individual placeholder materials are created, they must be assembled into a Multi/Sub-Object material with the same number of elements as there are digits in the number. For a four digit number, this material must have four sub-materials. This material must be called primarydigits. The placeholder sub-materials must be applied to the polygons in the number object in reverse. ie. primarynumber_0 is the last digit. primarynumber_1 is the second to last digit etc.
The TrainDecal.fx shader allows for 8-bit alpha channels in the number textures (256 levels of grey instead of just black and white). The Diffuse channel should be the required digit colour for the model - black, white, blue etc. The most appropriate size for these textures is 32x64. The placeholder textures can be any format as they are discarded in game and replaced with the digit textures.
There must be 10 textures corresponding to the 10 digits. Name these textures something logical like number_X_black.ace where 'X' is the digit.
The object containing the digits must be named 1_0128_primarydigits_4 or similar. The '4' at the end of the name denotes the number of digits. The '0128' is the range in metres that the numbers are visible. So for a 7 digit number visible to 256m, the name would be 1_0256_primarydigits_7.
Railworks uses a comma-separated-variable list to pick out the train or wagon numbers. This .CSV file is simply a text file with the .CSV extension. Each line in the file should have two zeros and a required number, separated by commas. So if the engine could have numbers 0234, 0235, 5543 and 6548, the .CSV file would contain the following:
Two areas need to be setup in the blueprint editor. First, a NamedTextureSet blueprint must be setup in the folder containing the .ace textures for the numbers (number_0_black.ace etc). This blueprint should be set up as shown in the image here. Note that each number corresponds to the logically-named texture .ACE files.
Second, the main engine (or wagon) blueprint must associate with the NamedTextureSet blueprint in the Primary named texture set as well as a .CSV file (in the Numbering list) containing a list of numbers to choose from. This should be setup as shown in the image here.