|
Post by theflyingoreo on May 8, 2017 10:27:35 GMT
Hi all
When trying to assign set numbers in the editor, I seem to have problems with the Player Train reverting back to 115.
E.g. When trying to set the player set number to 755, it reflects that in the editor however in game, it immediately reverts to 115.
However when setting the set numbers for AI trains, I don't have this issue, if anyone could assist it would be appreciated.
Thanks
|
|
|
Post by Jimi on May 8, 2017 13:10:39 GMT
Can you describe to me how you are editing the numbers, and what was the destination? I'll re-check my LUA code but IIRC I assign a set number from a list depending on the destination you specify, so I'm likely overriding the set number you are using. I'll need to re-vist the code and see what I can do to improve that behavior.
I suspect you've seen this, but for benefit of others...
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. Check out DD's forum for current D78 formations if curious or pedantic. 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 service. 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 service). 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.
|
|
|
Post by theflyingoreo on May 8, 2017 14:02:15 GMT
Hi Jimi
This is to do with the player train, not AI
As the first screenshot demonstrates, I'm trying to change the number "7020HACAOagf" which is currently showing Train 65 Mansion House
I want to change it to "7020HACAKhff" which shows Train 755 Richmond. When changed in the editor it shows fine as below
However in game it shows a different number to what was configured. However the destination is fine on both ends.
|
|
|
Post by Jimi on May 8, 2017 15:48:27 GMT
Understood! The same LUA code serves both Player and AI trains. I still believe my code is re-setting your set number to a value pulled from a fixed list based on the destination. That code runs when the train is initialized so will overwrite your set number at that time. Same code runs if you use the page-up/-down keys to change your destination. I will check ASAP and work out a fix if so.
|
|