Post by Jimi on Feb 28, 2019 16:06:46 GMT
Here's how to number D78 and 73TS cars so the info (car number and destination/set number where relevant) match the train's purpose. Changing a car number is done in the scenario editor by dbl-clicking on a car which opens an edit box where you can modify the number. Default random numbers (in legal range) will be set when a car is created. Take care editing the DM numbers as breaking the 12-digit encoding described below can have bad results.
Rules say the front and rear blinds must both show the train's intended final destination, so that's how I coded the LUA that handles destination setting or changes. The player train destination can be changed by the player at any time via a cab control and reference to a cab display. A change to the front display causes a change to part of the car's encoded "train number" and is automatically followed by the "other end" changing to match. This train number is unique to each car and is formatted differently for D78/73TS and for DM/UNDM/T. A scenario creator can therefor uniquely (and realistically) number any car in a set and assign the appropriate destination and set number. Here's how (in brief - more will be documented in the Stocks Op Guides)...
D78 Numbering - cars are numbered from 7000 (DM), 8000 (UNDM) and 17000 (Trailer) with the last 2 digits the same for a 3-car unit, and even numbers if a west-end unit and odd if east end. So we might see (E to W): 7001-17001-8001+8002-17002-7002. Not a real set but a legal example. We do include randomly generated numbers for each car so at least they'll look ok and be in the right number ranges if not deliberately set by the scenario creator.
Each car can have a unique car number (or RVNumber), so for the Trailer or UNDM we can just use the desired 170xx or 80xx car number per example above.
For the DMs we include more information in a 12-digit DM car number to reflect the car front number, side number, destination code and set number. This is encoded as (example) "7002HAACXnnn", where:
7002-car front number
HAAC is car side number (matching front), where A=0, B=1, C-2,...J=9
X is a destination code letter where K=RMD, L=EBY, M=ECT, N=WIM, O=MAN, P=not in use, Q=PAG, R=PBR, S=HSK, T=TOW.
nnn is a 3 letter code for the set number (e.g. hfg = 765 using the same a=0...j=9 substitution).
So a scenario developer can number each car in any set correctly and assign realistic numbers/destinations/set numbers to any AI or player train. Nothing too unique there - a number of TS and 3rd party trains can do that - we just had to figure how to represent all the info a LUL train needs. Further if a player changes the destination, my LUA code assigns a representative set number as part of the car description, taken from the current WTT.
73TS number is similar but a lot more simple. Trailers are 600-699, UNDM is 400-499, DM = 200x to 299x, where x = destination code (A = Acton Town, B = Arnos Grove, C = Cockfosters, D = Heathrow, E = Rayners Lane, F = not in use). There's only a single car number displayed on a 73TS car, and the set number has been included in the display as part of the destination, so the DM car number encoding is much simpler than D78.
Rules say the front and rear blinds must both show the train's intended final destination, so that's how I coded the LUA that handles destination setting or changes. The player train destination can be changed by the player at any time via a cab control and reference to a cab display. A change to the front display causes a change to part of the car's encoded "train number" and is automatically followed by the "other end" changing to match. This train number is unique to each car and is formatted differently for D78/73TS and for DM/UNDM/T. A scenario creator can therefor uniquely (and realistically) number any car in a set and assign the appropriate destination and set number. Here's how (in brief - more will be documented in the Stocks Op Guides)...
D78 Numbering - cars are numbered from 7000 (DM), 8000 (UNDM) and 17000 (Trailer) with the last 2 digits the same for a 3-car unit, and even numbers if a west-end unit and odd if east end. So we might see (E to W): 7001-17001-8001+8002-17002-7002. Not a real set but a legal example. We do include randomly generated numbers for each car so at least they'll look ok and be in the right number ranges if not deliberately set by the scenario creator.
Each car can have a unique car number (or RVNumber), so for the Trailer or UNDM we can just use the desired 170xx or 80xx car number per example above.
For the DMs we include more information in a 12-digit DM car number to reflect the car front number, side number, destination code and set number. This is encoded as (example) "7002HAACXnnn", where:
7002-car front number
HAAC is car side number (matching front), where A=0, B=1, C-2,...J=9
X is a destination code letter where K=RMD, L=EBY, M=ECT, N=WIM, O=MAN, P=not in use, Q=PAG, R=PBR, S=HSK, T=TOW.
nnn is a 3 letter code for the set number (e.g. hfg = 765 using the same a=0...j=9 substitution).
So a scenario developer can number each car in any set correctly and assign realistic numbers/destinations/set numbers to any AI or player train. Nothing too unique there - a number of TS and 3rd party trains can do that - we just had to figure how to represent all the info a LUL train needs. Further if a player changes the destination, my LUA code assigns a representative set number as part of the car description, taken from the current WTT.
73TS number is similar but a lot more simple. Trailers are 600-699, UNDM is 400-499, DM = 200x to 299x, where x = destination code (A = Acton Town, B = Arnos Grove, C = Cockfosters, D = Heathrow, E = Rayners Lane, F = not in use). There's only a single car number displayed on a 73TS car, and the set number has been included in the display as part of the destination, so the DM car number encoding is much simpler than D78.