Changing scenario completion status

Mike Simpson's invaluable tool with many helper functions to make your life easier with RailWorks. Based on the extremely popular RS Tools and also from the same author as Route Riter for MSTS.

Moderator: Moderators

Post Reply
sbowness
Established Forum Member
Posts: 422
Joined: Wed Jan 14, 2015 5:24 am
Location: Lower Hutt, New Zealand

Changing scenario completion status

Post by sbowness »

HI Mike

Can I suggest a new feature, please? I can't find a request for this before, but please forgive me if there is one. You may have seen the recent discussions elsewhere about how SDBCache is rebuilt. Occasionally, I like to reset the completion status on a scenario where it's been replaced with a new version, as AP and GGS do on occasion. I currently do that by editing the cache file (after expanding it using serz). I was wondering whether that was a feature that could be added to TS Tools, please? I know that the application has a bin file editor, but it would be really nice if the status could be amended somewhere like the Edit Scenario screen, please.

Thanks
Stephen
Stephen
User avatar
mikesimpson
Very Active Forum Member
Posts: 6358
Joined: Mon Dec 03, 2001 12:00 am
Location: Southern Hemisphere Penal Colonies
Contact:

Re: Changing scenario completion status

Post by mikesimpson »

Hi Stephen,

Yes, there have been several discussions about this, I will add such an option adding a .bak suffix to the original files in case anyone needs to revert to where they were. May take me a few days as busy with some of my other programs at the moment.

Mike.
Mike in OZ - Author of TS-Tools & Route-Riter.
http://www.agenetools.com
I'm not arguing (just explaining why I'm right).
User avatar
mikesimpson
Very Active Forum Member
Posts: 6358
Joined: Mon Dec 03, 2001 12:00 am
Location: Southern Hemisphere Penal Colonies
Contact:

Re: Changing scenario completion status

Post by mikesimpson »

See v1.0.81 which is now on my site.

Mike.
Mike in OZ - Author of TS-Tools & Route-Riter.
http://www.agenetools.com
I'm not arguing (just explaining why I'm right).
sbowness
Established Forum Member
Posts: 422
Joined: Wed Jan 14, 2015 5:24 am
Location: Lower Hutt, New Zealand

Re: Changing scenario completion status

Post by sbowness »

Fantastic stuff. Thanks very much indeed, Mike. It's not quite what I envisaged, which was being able to change the completion status of an individual scenario from within the 'Edit Scenario' screen (sorry, I should have been more clear). However, my guess is that editing a single line of a .bin file that way might not be possible. These options will still be very useful.
Stephen
User avatar
mikesimpson
Very Active Forum Member
Posts: 6358
Joined: Mon Dec 03, 2001 12:00 am
Location: Southern Hemisphere Penal Colonies
Contact:

Re: Changing scenario completion status

Post by mikesimpson »

Sorry Stephen,

I thought all you wanted was the ability to delete the SDBCache files etc from within TS-Tools, not to carry out some automatic editing of the file.
I will have a look at this, most things aren't impossible :-)

Mike.
Mike in OZ - Author of TS-Tools & Route-Riter.
http://www.agenetools.com
I'm not arguing (just explaining why I'm right).
User avatar
mikesimpson
Very Active Forum Member
Posts: 6358
Joined: Mon Dec 03, 2001 12:00 am
Location: Southern Hemisphere Penal Colonies
Contact:

Re: Changing scenario completion status

Post by mikesimpson »

Further to my previous message (for some reason I can't edit it). What exactly do you need to edit in the SDBCache.bin file? An example will help me as these files are really long.

Regards - Mike.
Mike in OZ - Author of TS-Tools & Route-Riter.
http://www.agenetools.com
I'm not arguing (just explaining why I'm right).
sbowness
Established Forum Member
Posts: 422
Joined: Wed Jan 14, 2015 5:24 am
Location: Lower Hutt, New Zealand

Re: Changing scenario completion status

Post by sbowness »

Hi Mike

I broke the first rule of change requests - make sure your requirements are clear. Sorry about that.

What I was thinking was to have another field on the Scenario Editor screen (or possibly on a dedicated screen) that showed the completion status from SDBCache.bin. For example, here's the relevant bit in the file for scenario 5cf87c3a-5472-44c2-90ed-b47792c55f32, which is "[01] 2G01 11:25 Norwich - Great Yarmouth" in the Wherry Lines.

Code: Select all

<sSDScenario d:id="201844352">
				<RouteID>
					<cGUID>
						<UUID>
							<e d:type="sUInt64">5169582282383110682</e>
							<e d:type="sUInt64">5019623515653057980</e>
						</UUID>
						<DevString d:type="cDeltaString">3a99321a-0bb2-47be-bcad-b20cfe48a945</DevString>
					</cGUID>
				</RouteID>
				<RouteName d:type="cDeltaString">Wherry Lines - Norwich to Great Yarmouth &amp; Lowestoft</RouteName>
				<ScenarioID>
					<cGUID>
						<UUID>
							<e d:type="sUInt64">4954615390223760442</e>
							<e d:type="sUInt64">3629837057548152208</e>
						</UUID>
						<DevString d:type="cDeltaString">5cf87c3a-5472-44c2-90ed-b47792c55f32</DevString>
					</cGUID>
				</ScenarioID>
				<ScenarioName d:type="cDeltaString">[01] 2G01 11:25 Norwich - Great Yarmouth</ScenarioName>
				<ScenarioDesc d:type="cDeltaString">Part 1 of 3. It&apos;s 16th June 2015 and a new era is dawning on the Wherry Lines. After many years of providing loco-hauled cover for DMU shortages, class 47s have finally had their day and are being replaced with top and tailed class 37/4s. Before being pressed into passenger service though, a test run has been organised to assess the performance characteristics of these locomotives, or rather, to give the staff a day out to the seaside on a warm summer’s day! In this first part, you will drive from Norwich to Great Yarmouth via Acle, stopping at each station to replicate a passenger service.</ScenarioDesc>
				<StartLocn d:type="cDeltaString">Norwich</StartLocn>
				<ScenarioClass d:type="cDeltaString">eTimetableScenarioClass</ScenarioClass>
				<Author d:type="cDeltaString">AP</Author>
				<Difficulty d:type="sUInt32">2</Difficulty>
				<Duration>
					<sTimeOfDay>
						<_iHour d:type="sInt32">0</_iHour>
						<_iMinute d:type="sInt32">40</_iMinute>
						<_iSeconds d:type="sInt32">0</_iSeconds>
					</sTimeOfDay>
				</Duration>
				<Score d:type="sUInt32">0</Score>
				<Completion d:type="cDeltaString">CompletedSuccessfully</Completion>
				<WorkshopId d:type="sUInt64">0</WorkshopId>
				<WorkshopBy d:type="sUInt64">0</WorkshopBy>
				<IsClonedDLC d:type="bool">0</IsClonedDLC>
				<CareerRulesVersion d:type="sInt32">0</CareerRulesVersion>
				<MedalsAwarded d:type="sUInt8">0</MedalsAwarded>
				<StartTime d:type="sFloat32" d:alt_encoding="0000000000BFE340" d:precision="string">40440</StartTime>
				<Season d:type="sUInt32">1</Season>
				<Weather d:type="sUInt32">0</Weather>
				<QuickDriveInfo>
					<sSDQuickDriveInfo>
						<PlayerConsistName d:type="cDeltaString"></PlayerConsistName>
						<StartLocation d:type="cDeltaString"></StartLocation>
						<EndLocation d:type="cDeltaString"></EndLocation>
					</sSDQuickDriveInfo>
				</QuickDriveInfo>
				<Flags d:type="cDeltaString">eSFIsUntampered</Flags>
				<DLCID d:type="sInt32">0</DLCID>
				<ScenarioPropertiesModifiedTime d:type="sUInt64">132865734083290000</ScenarioPropertiesModifiedTime>
				<Loco>
					<sSDLoco d:id="201942914">
						<LocoName d:type="cDeltaString">Class 37 Direct Rail Services</LocoName>
						<ServiceName d:type="cDeltaString">2G01 11:25 Norwich - Great Yarmouth</ServiceName>
						<Author d:type="cDeltaString">AP</Author>
						<DescFilepath d:type="cDeltaString">AP\Class37Pack01\RailVehicles\Diesel\Class37\DRS2_W1</DescFilepath>
						<StartLocn d:type="cDeltaString">Norwich Royal Dock</StartLocn>
						<LocoClass d:type="cDeltaString">LOCO_CLASS_DIESEL</LocoClass>
						<Longitude d:type="sFloat64" d:alt_encoding="0B410E4A98E9F43F" d:precision="string">1.30703</Longitude>
						<Latitude d:type="sFloat64" d:alt_encoding="AA60545227504A40" d:precision="string">52.6262</Latitude>
						<Height d:type="sFloat32" d:alt_encoding="000000A099791340" d:precision="string">4.86875</Height>
						<HoursLogged d:type="sFloat32" d:alt_encoding="0000000000000000" d:precision="string">0</HoursLogged>
						<LocoBlueprintID>
							<iBlueprintLibrary-cAbsoluteBlueprintID>
								<BlueprintSetID>
									<iBlueprintLibrary-cBlueprintSetID>
										<Provider d:type="cDeltaString">AP</Provider>
										<Product d:type="cDeltaString">Class37Pack01</Product>
									</iBlueprintLibrary-cBlueprintSetID>
								</BlueprintSetID>
								<BlueprintID d:type="cDeltaString">RailVehicles\Diesel\Class37\DRS2_W1\37_GSMR.xml</BlueprintID>
							</iBlueprintLibrary-cAbsoluteBlueprintID>
						</LocoBlueprintID>
					</sSDLoco>
				</Loco>
				<LockedBy/>
				<Locks/>
				<RequiredDLC/>
			</sSDScenario>
The relevant line is:

Code: Select all

<Completion d:type="cDeltaString">CompletedSuccessfully</Completion>
The options seem to be NotCompleted, CompletedSuccessfully or CompletedFailed. It would be really nice if that could be edited there, rather than having to edit the line in the xml. I've come close to a typo more than once. You also have to dig out the guid first.

Thanks
Stephen
Stephen
gptech
Very Active Forum Member
Posts: 19483
Joined: Fri Oct 10, 2008 5:48 pm
Location: Wakefield, West Yorkshire

Re: Changing scenario completion status

Post by gptech »

sbowness wrote: Sat May 14, 2022 3:38 am It would be really nice if that could be edited there, rather than having to edit the line in the xml
So edit the .bin...there's no need to convert it to .xml!!
sbowness wrote: Sat May 14, 2022 3:38 am You also have to dig out the guid first.
No, all you need to do is a quick search through the .bin for a relevant part of the scenario name--in your example you'd use 2G01 to quickly find it. That'd highlight the TRN in the line:

Code: Select all

				<ScenarioName d:type="cDeltaString">[01] 2G01 11:25 Norwich - Great Yarmouth</ScenarioName>
so you'd scroll down a dozen lines or so to find:

Code: Select all

				<Completion d:type="cDeltaString">CompletedSuccessfully</Completion>
sbowness
Established Forum Member
Posts: 422
Joined: Wed Jan 14, 2015 5:24 am
Location: Lower Hutt, New Zealand

Re: Changing scenario completion status

Post by sbowness »

My PC doesn't play nicely with the bin editor in TS Tools and I get an out of memory error if I try to use the highlight option. I much prefer Notepad++ as it provides some helpful tools when editing xml. Searching for the headcode can be a bit risky too as they are often reused. In any case, there is still the risk of making a mistake when replacing the attribute and not everyone is comfortable with editing xml. Something with a GUI option is much more user-friendly and potentially less risky.
Stephen
gptech
Very Active Forum Member
Posts: 19483
Joined: Fri Oct 10, 2008 5:48 pm
Location: Wakefield, West Yorkshire

Re: Changing scenario completion status

Post by gptech »

sbowness wrote: Sat May 14, 2022 6:14 am Searching for the headcode can be a bit risky too as they are often reused
If it finds the *wrong* one, use the "Find next" option.
User avatar
mikesimpson
Very Active Forum Member
Posts: 6358
Joined: Mon Dec 03, 2001 12:00 am
Location: Southern Hemisphere Penal Colonies
Contact:

Re: Changing scenario completion status

Post by mikesimpson »

OK thanks - I will have a look at it for you. I was not sure what you needed changed, as I have never completed anything (too boring), so was not sure what was expected.

Mike.
Mike in OZ - Author of TS-Tools & Route-Riter.
http://www.agenetools.com
I'm not arguing (just explaining why I'm right).
Post Reply

Return to “[TS] RW Tools”