As I have my own sticky topic i guess this is the appropiate place to post

Its been a while since i've had a problem, but parameters and stuff isnt my best field, yet
Im currently working on the NuTracks set, and trying to get it to a 0.9.0 state (1.0 will come when I dont need the track enabler engines, and i can sort the list, see flyspray #4393 and #4394)
But to the problem. The set will featureseveral subsets, selectable by parameter0:
Code: Select all
Value | Meaning
0 | Autoslect if suitable trainsets is loaded
1 | Default
2 | With metrotracks
3 | With 3rd rails
Anyone have any ideas or solutions?
The auto-thingy is ment to autoselct the metrotracks or the 3rd rails (or even more in the future). I've tried a few approaches, but nothing seems to work yet.
Here is the code i've tried with:
Code: Select all
// Set parameter20 to something if parameter0 is 0 :D (i.e. the autoselect)
-1 * 6 09 PARAM0 01 \7! 00 F0 // Skip to F0 if parameter0 isnt 0. I.e. execute if it is
// METRO TRACKS
// Check 2cc trainset
-1 * 6 07 88 04 0A // Jump to, 4 byes range, grfID is not nor will be active - i.e. execute if 2cc set is loaded
GRFID_2CCSET // GRF-ID
01 // skip 1 sprite
-1 * 0 0D PARAM20 80 FF FF \d2 // Sets Parameter 0 to 2 (select metro trackset)
-1 * 6 09 PARAM20 01 \7= 02 F0 // Skip to F0 if one of the above sets' set parameter0 to 02
// 3rd RAIL TRACKS
// Check UKRS2
-1 * 6 07 88 04 0A // Jump to, 4 byes range, grfID is not nor will be active - i.e. execute if UKRS2 set is loaded
GRFID_UKRS2 // GRF-ID
01 // skip 1 sprite
-1 * 0 0D PARAM20 80 FF FF \d3 // Sets Parameter 0 to 3 (select 3rd rail trackset)
// Check BROS
-1 * 6 07 88 04 0A // Jump to, 4 byes range, grfID is not nor will be active - i.e. execute if BROS set is loaded
GRFID_BROS // GRF-ID
01 // skip 1 sprite
-1 * 0 0D PARAM20 80 FF FF \d3 // Sets Parameter 0 to 3 (select 3rd rail trackset)
-1 * 6 09 PARAM20 01 \7= 03 F0 // Skip to F0 if one of the above sets' sets parameter0 to 03 (might not be neccesary, but in case there is more subsets in the future)
-1 * 0 0D PARAM20 80 FF FF \d1 // Sets Parameter 0 to 1 (select default trackset)
-1 * 2 10 F0 // Target of skip
What happens is, the metro trackset is loaded no matter what. No trainsets get metro trackset, bros and ukrs2 gets metro tracks.
When PARAM20 is set to this or that it selects different sets of Action0s (and when I get so far, different action1-2-3's)
Code: Select all
-1 * 6 09 PARAM20 01 \7! 01 11
<default trackset Action0s>
-1 * 2 10 11 // Target of skip
-1 * 6 09 PARAM20 01 \7! 02 11
<metro trackset Action0s>
-1 * 2 10 11 // Target of skip
-1 * 6 09 PARAM20 01 \7! 03 11
<3rd rail trackset Action0s>
-1 * 2 10 11 // Target of skip