Looking for some advice on station layout callbacks
Posted: 09 Jul 2007 10:57
I'm currently coding a station which has various different layouts depending on where the platforms are. Outer platforms should have walls, while inner platforms shouldn't. To do this I've got 8 layouts (1 for each direction) - walls on the northern side, no walls, walls on the southern side, and walls on both sides. I'm choosing between them using callback 14, based on variable 49, with the following VarAction 2s:
This seems like a lot of work though and involves calculating variable 49 3 times, and I was wondering if there was an easier (or at least more elegant) way to do it. I was trying to find a way to do it with an Advanced VarAction2, but couldn't see how, so I ended up with this. If anyone has any ideas, they'd be gratefully received. 
Code: Select all
1 * 1 02 04
01 // ID
85 // Use the lowest word
49 // Variable 49
0C 0F 00
01
04 80 00 00 00 00 // Return 04 (callback result) if this is the first platform from the end
02 80 // Otherwise return 02 (callback result)
1 * 1 02 04
02 // ID
85 // Use the lowest word
49 // Use variable 49
08 0F 00
01
00 80 00 00 00 00 // Return 00 (callback result) if this is the first platform
01 00 // Otherwise move on
1 * 1 02 04
03 // ID
89 // Use the whole dword of the variable
49 // Use variable 49
14 0F 00 00 00 // Varadjust (shift right by 20, & with F)
01
06 80 01 00 00 00 01 00 00 00 // Return 06 (callback result) if there is 1 platform
02 00 // Otherwise move onto the next in the chain
