Symptoms:
Randomisation is applied to every single part of the articulated vehicle, not to the vehicle as a whole (see screenshot below).
As I can't seem to figure out what I'm doing wrong (I tried two different varAction2 chains, see below), I'm asking: What do I have to do to get this working correctly*?
*) I might need to explain 'correctly' a bit more. What I want to accomplish is the following:
Starting from 2007 the vehicle should be available in two different liveries (RED and WHITE). The game should pick one of both liveries at random as soon as a new vehicle is bought. The vehicle needs to have a complete RED or a complete WHITE livery (and not something in between as shown in screenshot below).
All help is appreciated. This should become the most interesting feature of the set. Only thing left is getting it to work

Below, my two attempts.
Code: Select all
//1st attempt
-1 * 0 02 01 20 81 40 00 FF 02 31 00 00 00 32 00 01 01 33 00 //what spritesets to use (set 3) red/white
-1 * 0 02 01 19 81 40 00 FF 02 15 00 00 00 16 00 01 01 17 00 //what spritesets to use (set 2) red/beige
-1 * 0 02 01 11 81 40 00 FF 02 12 00 00 00 13 00 01 01 14 00 //what spritesets to use (set 1) blue/grey
-1 * 0 02 01 30 80 00 00 08 19 00 20 00 19 00 19 00 19 00 19 00 19 00 19 00 //random livery for years 2007+
-1 * 0 02 01 18 81 C4 00 FF 03 19 00 \b0 \b71 11 00 \b72 \b80 19 00 \b81 \b86 30 00
//find out the year built (value since 1920, range) and use the appropriate liveries [19] if year [1925-2175]
//otherwise [11] default
-1 * 0 02 01 10 81 10 00 FF 01 46 80 01 02 FF 80 //build articulated vehicle add 01 to 02 wagons
-1 * 0 02 01 09 81 10 00 FF 01 49 80 01 01 18 00 //use sound 01 //otherwise[18]
-1 * 0 02 01 08 81 0C 00 FF 02 09 00 33 33 10 00 16 16 18 00
//sound effect callback [09] //articulated vehicle callback [10] //otherwise [18]
//and now for buy menu
-1 * 0 02 01 FD 81 01 00 FF 01 FB 00 \b72 \b80 FC 00
//find out the year and use the appropriate buy menu gfx [FC] if year [1925-2175] //otherwise [FB] default
-1 * 0 03 01 01 46 01 FF FD 00 08 00
Code: Select all
//2nd attempt
-1 * 0 02 01 33 81 0C 00 FF 01 02 80 11 11 CC 00
-1 * 0 02 01 32 81 0C 00 FF 01 05 80 11 11 CB 00
-1 * 0 02 01 31 81 0C 00 FF 01 02 80 11 11 CA 00
-1 * 0 02 01 23 81 0C 00 FF 01 02 80 11 11 BC 00
-1 * 0 02 01 22 81 0C 00 FF 01 05 80 11 11 BB 00
-1 * 0 02 01 21 81 0C 00 FF 01 02 80 11 11 BA 00
-1 * 0 02 01 13 81 0C 00 FF 01 02 80 11 11 AC 00
-1 * 0 02 01 12 81 0C 00 FF 01 05 80 11 11 AB 00
-1 * 0 02 01 11 81 0C 00 FF 01 02 80 11 11 AA 00
-1 * 0 02 01 73 81 40 00 FF 02 31 00 00 00 32 00 01 01 33 00 //what spritesets to use (set 3) red/white
-1 * 0 02 01 72 81 40 00 FF 02 21 00 00 00 22 00 01 01 23 00 //what spritesets to use (set 2) red/beige
-1 * 0 02 01 71 81 40 00 FF 02 11 00 00 00 12 00 01 01 13 00 //what spritesets to use (set 1) blue/grey
-1 * 0 02 01 63 81 10 00 FF 01 46 80 01 02 FF 80 //build articulated vehicle add 01 to 02 wagons
-1 * 0 02 01 53 81 10 00 FF 01 49 80 01 01 73 00 //use sound 01 //otherwise[18]
-1 * 0 02 01 43 81 0C 00 FF 02 53 00 33 33 63 00 16 16 73 00
//sound effect callback [09] //articulated vehicle callback [10] //otherwise [18]
-1 * 0 02 01 62 81 10 00 FF 01 46 80 01 02 FF 80 //build articulated vehicle add 01 to 02 wagons
-1 * 0 02 01 52 81 10 00 FF 01 49 80 01 01 72 00 //use sound 01 //otherwise[18]
-1 * 0 02 01 42 81 0C 00 FF 02 52 00 33 33 62 00 16 16 72 00
//sound effect callback [09] //articulated vehicle callback [10] //otherwise [18]
-1 * 0 02 01 61 81 10 00 FF 01 46 80 01 02 FF 80 //build articulated vehicle add 01 to 02 wagons
-1 * 0 02 01 51 81 10 00 FF 01 49 80 01 01 71 00 //use sound 01 //otherwise[18]
-1 * 0 02 01 41 81 0C 00 FF 02 51 00 33 33 61 00 16 16 71 00
//sound effect callback [09] //articulated vehicle callback [10] //otherwise [18]
-1 * 0 02 01 44 80 00 00 08 42 00 43 00 42 00 42 00 42 00 42 00 42 00 42 00 //random livery for years 2007+
-1 * 0 02 01 40 81 C4 00 FF 03 42 00 \b0 \b71 41 00 \b72 \b80 42 00 \b81 \b86 44 00
//find out the year built (value since 1920, range) and use the appropriate liveries [19] if year [1925-2175]
//otherwise [11] default
//and now for buy menu
-1 * 0 02 01 FD 81 01 00 FF 01 FB 00 \b72 \b80 FC 00
//find out the year and use the appropriate buy menu gfx [FC] if year [1925-2175] //otherwise [FB] default
-1 * 0 03 01 01 46 01 FF FD 00 40 00
The results of both attempts are equal.