Frank
I think you may have the wrong slant on this. The problem at hand is that CM has a base count starter of 10,000 which it uses for all maps etc. Previous versions had this but the seed number was set in Trainzoptions so could be set well away from a creators content number system. What has been missing is the ability to alter this number, which has now been revealed by Shane and subsequently by Chris.
The initial need is a batch file accessed by a shortcut to re-set this number. Nothing more.
I don't think so Peter, Justin was clearly desiring to bundle asset kuid in some particular groups, which means he'd set aside 10,000s for one asset group, 11,000s for the next, and so on.
But on your point of 'What is needed' the shell I roughed in yesterday started with the option to take a given value ('
index number' and 'SET THAT' specifically (Direct set Mode) using Andi's snippet from the batch, or enter the MENU, in which the user has predefine such groups and their respective index numbers. If you're happy using your memory to keep things straight, fine, but that's not totally safe in a system which increments to the next empty number. The system won't index wrongly, but your brain may, and the brain and fingers are poking a new value into the machine's reality... a horse of a different color.
Rather than risk overwriting said counter (index number), the MENU reset branching would increment the counter/index so 'poor little Justin' (feelthy money grubbing capitalistic icon) and others (perhaps less mercenary) doing this wouldn't inadvertently reuse an allocated index number.
When TS12 first appeared the seed number was set at 1000, can you imagine the havoc that caused.
Peter
I have no idea how TrainzUtil and CM would behave if one gave it a lower (same as one already created) index number than I actually wanted, but from your havoc comment, it overwrote assets, N'est pas? Same as I saw importing my seven years of TRS2006 routes into a newer Trainz--but one where I'd played a bit first--so those modified cloned routes and sessions got overwritten when I brought in the older stuff, right?
Predictably GIGO--Computers do exactly what we humans tell them, which is
why I'd planned on incrementing the index number of each group where asset creators can get to it and reset it as needed. The only way to introduce some (less fallible) non-human-memory reliant firebrakes into the scheme, is to increment a counter --that can also be reset as needed. (Hmmm, I'll have SP1 add the batch ability to reset those index for each to a specific value too! Imagination/experience tells me that will be needed by someone!)
That's bullet proof programming in intent & experience, but where I'm lacking a full toolset for checking whether the new number is reusing the old--a feedback loop to prevent overwriting. (Really need that Do you really mean this CM question, don't we!) Does CM/TrainzUtil give a way to do that automatically? Perhaps the exit code is a particular "ERRORLEVEL" in batch sensing ability. If it returned a value saying that kuid has been used, then a loop can re-query and keep doing so until there was the code saying "THIS ONE IS UNUSED"--which after all is what everyone wants as a MININUM--but Justin and some others also want Groups by type asset, if I truly understand.
(Thought -- Perhaps TANE CM can start a cloud track of used kuids by content creators, and then one could (with patches to other older TrainzUtil or CM's dll's [should be easy and cheap patch to make--they could fix a few other bona-fide bugs at the same time!]) avoid using kuids already allocated.)
To be safest, if it were my batch facility and I were using this method, I'd increment by say +5, +11 or +15, so CM and I could create a few assets along with the next one before and without the batch being used. (Since I'm still some months away from 3D modeling learning curve climbs, I have only theory and imagination/conjecture to guide me now. However, changing the index count increment in a batch is something you guys can do! You change config.txt files forsooth!) One guy likely has this practice and work habits, and one guy that. Trying to cover all the bases unlike..., but like the '
new improved "HTH" Windwalkr' to be HTH us all, if I can!
Refinements would be batch files that allow a creator to set this number according to the way he working. No need for incrementing (CM does that) and no need to search.
Now I may misunderstand how TrainzUtil is using the input... but I'd assumed the index number was the base count 'yyy' in <kuid2:xxx:yyy:0> dumbly indicating the last number used by 'xxx'. CM/CCP then
increments that to 'yyy+1' and allocates the new folder, config.txt and so forth
'setting up the next item created', is it not so? Worst case. double incrementing, so kuids jump by 'yyy+2' -- who cares?
Poking a value then requires a incremented 'offline index counter' to stay in step... and avoid those nasty overwrites. [One reason in fixing assets I keep a plain file (..\editing\foldername) copy when repairing--I can then modify the trainz-build and the kuid to suit myself (and import the fixed one into TS09, 10, or 12). in those copies I prefix the TB ('2-9') and suffix the kuids "
2-5 bridge stone 1t (kuid_-1_110000)" as an old paranoid programmer would! But the same safety net I'd certainly use if creating new. Easier to steal the guts for some other new asset, that way for starter, and backup source code is a comfort to us old paranoid programmers! N3V's programmers may learn that someday and spawn a fixed config.txt keeping the original as a backup. I still don't believe they deleted commenting in files!!!! Boggles the mind! // Frank