Transport Fever 2

Transport Fever 2

72 ratings
Kaminari Numbers
   
Award
Favorite
Favorited
Unfavorite
Tags: script, tool
File Size
Posted
Updated
8.705 MB
Dec 7, 2020 @ 5:19pm
Mar 18, 2023 @ 9:08pm
13 Change Notes ( view )

Subscribe to download
Kaminari Numbers

Description
Please, refer to the WIKI[github.com]for details.

Overview
On Transport Fever it is not possible to assign to each unit a unique serial number (like UIC identification numbers) because the game engine loads and generates the model once when loading the game, and after that the model remains static on memory. It's possible to randomize somehow the numbering at the beggining, but after that it remains the same across all the models of the same unit. That means that all the locomotives of the same model will show the same number during the game.

KAMINARI NUMBERS is a mod script that allows to print random serial numbers on similar models without the need of duplicating model files.

What KAMINARI NUMBERS can do
  • Place numbers and uppercase letters over any model (trains, planes, trucks, buildings, ...).
  • Show different numbers or letters across all the same models placed on map, creating the sensation that every model has its own identification number.
  • Create lists of consecutive numbers, from a starting number to a final one (i.e. from 30 to 59).
  • Cicle through numbers consecutively or randomly.
  • Create lists of identification numbers that combines letters and numbers, being able to randomize each position from a list of allowed characters.
  • Create your own list of identification numbers manually.
  • The last number assigned on each unit is persisted when saving and quitting the game and loading it after.
  • Paint the letters with any color, either RGB or descriptive (i.e. "white", "darkblue", ...)
  • Letters become dirt over the time.
  • Change the size, position and rotation of the letters.

What KAMINARI NUMBERS can NOT do
  • A number on a unit can not be persisted over the time. It changes after some time.
  • Two or more units can have the same generated number at the same time. The shorter the list of numbers, the higher probabilities two units share the same number.
  • When placing a new unit on map, tt's not possible to shuffle the starting number, so all the units will show the same number for the first time and for some time until it changes.
  • Only numbers, uppercase letters and dot (.), hyphen (-) and slash (/) are available. No lowercase letters or other characters are available.

When or how I should avoid using KAMINARI NUMBERS
  • It is not intended to do all the static labels because of the inefficiency it may introduce. There are other mods available that can do this in a more efficient way.
  • Avoid using hundreds of number variations. Units that may have 2, 4, or even 6 times the number printed. Each digit is a mesh (2 polygons) and each variation introduced is also N times the mesh generated. That means if 100 of variations are defined for a 6 digit plate, and it is on 6 different parts of the unit, that sums 3.600 meshes present that equals 7.200 poligons that are added to each model present and inside the LOD. USE WITH CAUTION AND MODERATION TO AVOID SLOWDOWN TO THE GAME

How it works
KAMINARI NUMBERS is based on these mechanics:

  • Each character, number or letter, is a rectangular mesh which texture defined is the character with transparency.
  • A list of different identification numbers is defined and the script generates the group of all meshes (children) that are included to the model.
  • The group of meshes contains all the identification numbers available. i.e. if 20 numbers are generated, each model contains the 20 numbers superposed on the same coordinates.
  • The group of meshes are linked to a very slow loop forever animation where only one of the generated numbers at a time is on the defined coordinates, and the rest of the numbers are slighty backward (a few centimeters), so they are hidden inside the model.
  • All the animations and materials are dinamically created. First load time may take some seconds but these files are preserved so next time less time is spent loading the savegame.

With this tricks the user have the sensation that only one number is shown at a time, and because of the continuous loop animation after some time the units starts showing different numbers (even if two units are build at the same time).

Quick start
1) Instanciate the script
See wiki to see how to do this.
2) Create a list of numbers with `buildListOfNumbers` or `generateRandomCharacters`
local numberPlates = kaminari_numbers.buildListOfNumbers( 1, 35, true, 3, "1", "" )
3) Create a list of groups of numbers ready to be put on the model LOD subnode with `getChildrenColorNumber` or `getChildrenRGBNumber`
local plates = kaminari_numbers.getChildrenColorNumber( numberPlates, "white", "Helvetica", 24.0, 3.90, 1.00, 2.05, 0, 0, 0 )
4) Append on the last element of the LOD in the model the list groups created on step 3.
plates
5 Comments
Kaminari  [author] Mar 19, 2023 @ 2:41am 
Released v.1.4 - Fixed llast major update generates many error. Removed WARNING: Color not defined for "darkYellow"
UniformAlpha14 Feb 5, 2021 @ 3:57am 
hi, I found a warning in my stdout for this mod:
[kaminari_numbers.colorAlbedoFromColorName( darkYellow )] WARNING: Color not defined. Applying color white...
Maybe there are some resources missing.
JUANILLO Dec 27, 2020 @ 12:01am 
muy buen trabajo
CUADRADITOS Dec 17, 2020 @ 9:01am 
Vaya currada...
Egocrata Dec 13, 2020 @ 11:25am 
This. Is. Awesome.