Easiest way to mark scenarios complete?

Forum for discussing Train Simulator 2016

Easiest way to mark scenarios complete?

Unread postby ChrisNH » Sat Jan 16, 2016 12:01 pm

Hi,

I know this is a recurring topic. I have gone through old threads and tried the various methods. Unfortunately ALL my back up copies of TS have lost the appropriate entries. I am really not sure how this happened. I would like to get it fixed up while I am between semesters. In any case..

I can open up the XML of the cache in RW_Tools but right now it is a pretty painful process to modify the entries to get check boxes one by one.

Is there any existing utility out there yet to directly modify the XML to mark scenarios completed? Is there an easier way to do it in RW tools besides just editing the xml directly?

If not I will whip something up to help me out. It is a pretty straight forward parsing problem but the whole point of being between semesters is to step away from programming for a bit!

Thanks,

Chris
ChrisNH
 
Posts: 47
Joined: Sun Aug 05, 2012 10:14 am

Re: Easiest way to mark scenarios complete?

Unread postby Chacal » Sat Jan 16, 2016 2:02 pm

Good news: I have a lot of vbscript code for modifying this particular bit of XML.
There's some here in the RWA learning center, it is heavily commented and should be easy to follow and modify. There's a lot of code but it's mostly validation and GUI, which takes a lot of code in vbscript. Function "ProcessScenario" does the real job.
Also there's a lot of verbose logging.

I also have a similar script that marks all scenarios for one route as not completed. I'll attach it here.

I've always wanted to do what you are describing. I wanted to export the list in a spreadsheet, modify it and import it back into the database. But it was never high-priority.

What do you need to do exactly? Only change some scenarios for some routes, or all scenarios for some routes, etc?
How do you remember which ones you have done?
You do not have the required permissions to view the files attached to this post.
Over the hill and gathering speed
Chacal
Site Admin
 
Posts: 6479
Joined: Tue Jul 05, 2011 1:11 pm
Location: Quebec, Canada

Re: Easiest way to mark scenarios complete?

Unread postby ChrisNH » Sat Jan 16, 2016 2:12 pm

Thanks, I will look through that material. I have not done much with vb, if left to my own devices I would write something in Python or Java to parse. The more I think about it the more I might just go down that path. If I come up with something I will share it.

I want to mark some scenarios on some routes. I have not done so many that it is hard for me to remember. If I get a few wrong that is not the end of the world. Chances are in a few minutes of playing I will go "oh I remember that" and go back to mark it.

Once I have set things up I will work harder to save my cache and this won't be an issue.
ChrisNH
 
Posts: 47
Joined: Sun Aug 05, 2012 10:14 am

Re: Easiest way to mark scenarios complete?

Unread postby Chacal » Sat Jan 16, 2016 6:35 pm

Cobble something together for exporting to csv and importing back.
Then it's just a matter of editing the csv with Excel or something.

Don't hesitate to ask if I can help.

Also, here's my DOS batch file for backing up the scenario database:
Code: Select all
@ECHO OFF
REM Chacal 2013
REM Backup of Railworks scenario database
REM This will copy files from the source folder to a new destination folder
REM The name of the destination folder is the current date and time

REM Change variables Source and Destination in the two lines below to suit your project
SET Source=I:\Steam\steamapps\common\railworks\Content
SET Destination=I:\Steam\steamapps\common\railworks\Content

REM Change variable Files for your file filter
SET Files=SDBCache.*

REM We use current date and time for versioning
REM Note that the output of date and time is locale-dependent
REM You will have to adjust the parsing to fit the output of your DATE and TIME commands.
REM To do this, open a command window (Start / Run / cmd)
REM Type DATE. Whatever comes after "The current date is: " is your localized date format.
REM Type TIME. Whatever comes after "The current time is: " is your localized time format.
REM Then adjust the following SET lines to set variables correctly for year, month, etc.


rem Parse the date (e.g., 2013-01-01)
rem Example: the line below takes the first 4 characters of "2013-01-01" and puts them in "cur_year".
set cur_year=%date:~0,4%
set cur_mo=%date:~5,2%
set cur_da=%date:~8,2%

rem Parse the time (e.g., 16:20:08,69)
set cur_hh=%time:~0,2%
if %cur_hh% lss 10 (set cur_hh=0%time:~1,1%)
set cur_mm=%time:~3,2%
set cur_ss=%time:~6,2%
set cur_ms=%time:~9,2%

rem Set the timestamp format
set timestamp=backup%cur_year%%cur_mo%%cur_da%%cur_hh%h%cur_mm%
rem Example: backup2013010116h37

ECHO %timestamp%
CD %Destination%
MD %timestamp%
CD %timestamp%
XCOPY %Source%\%Files%
PAUSE
rem Clear environment variables
set cur_year=
set cur_mo=
set cur_da=
set cur_hh=
set cur_mm=
set cur_ss=
set cur_ms=
set timestamp=
Set Source=
Set Destination=
Set Files=
Over the hill and gathering speed
Chacal
Site Admin
 
Posts: 6479
Joined: Tue Jul 05, 2011 1:11 pm
Location: Quebec, Canada

Re: Easiest way to mark scenarios complete?

Unread postby ChrisNH » Sat Aug 06, 2016 6:48 pm

Between work and school I did not have time to revisit this until recently. I looked through your VB code and didn't see an easy way to subvert it to my needs. I am not a VB guy.

It ended up being pretty easy to fix up just editing the entries by hand using RW_Tools during the infinite series of commercials during the Olympic opening ceremony.

Now I have all my entries "checked" and that warm fuzzy feeling of ducks lining up properly.

I would encourage someone else stumbling on this thread to get RW_Tools (now freeware) and opening the file with that. You can then directly edit the XML in the tool.
ChrisNH
 
Posts: 47
Joined: Sun Aug 05, 2012 10:14 am

Re: Easiest way to mark scenarios complete?

Unread postby Chacal » Sat Aug 06, 2016 7:53 pm

The danger with that: it is very easy to make a typo and corrupt the file.
Over the hill and gathering speed
Chacal
Site Admin
 
Posts: 6479
Joined: Tue Jul 05, 2011 1:11 pm
Location: Quebec, Canada

Re: Easiest way to mark scenarios complete?

Unread postby ChrisNH » Sat Aug 06, 2016 9:30 pm

It seemed to treat my typos (I had one before I started to cut and paste, succesf... ly is a pain to spell..) as "NotCompleted" but maybe it was just regenerating the file.

I kept the file open until I confirmed I got the results I wanted when i reopened TS so I could correct errors.
ChrisNH
 
Posts: 47
Joined: Sun Aug 05, 2012 10:14 am

Re: Easiest way to mark scenarios complete?

Unread postby Ericmopar » Sat Aug 06, 2016 9:53 pm

As a side note to all this.
I'm pretty sure I lost my scenario completion check marks and my medals, when I did a clean install of Steam a couple of months ago and reinstalled my Railworks folder from a backup.
I forget now what happened, but the general consensus at Steam forums was a old installation of Steam software that had accumulated too much garbage.
It was a very old install. !*roll-laugh*!
New build. i7-7700k, MSI Z270 Gaming M5 Mobo, Hyper 212 Evo, Corsair DDR4 3200 Mhz RAM, Klipsch Pro Mediea 2.1 Speakers, Samsung 850 Evo SSD, HAF XM Case, Asus Strix GTX 1070 and Cooler Master Storm XT Keyboard.
Slick with Pretty Rainbow Colors.
User avatar
Ericmopar
 
Posts: 2797
Joined: Mon May 13, 2013 12:35 am
Location: Henderson NV.

Re: Easiest way to mark scenarios complete?

Unread postby Chacal » Sat Aug 06, 2016 11:54 pm

@Ericmopar, do you have a backup of the old config? More specifically, the Content/SDBCache.bin file?
If so, you can restore the scenario completion check marks easily.
Over the hill and gathering speed
Chacal
Site Admin
 
Posts: 6479
Joined: Tue Jul 05, 2011 1:11 pm
Location: Quebec, Canada

Re: Easiest way to mark scenarios complete?

Unread postby jalsina » Sun Aug 07, 2016 6:53 am

Chacal wrote:@Ericmopar, do you have a backup of the old config? More specifically, the Content/SDBCache.bin file?
If so, you can restore the scenario completion check marks easily.

I am not fond of medals, rewards and goals completed in TS and I don´t like career scenarios because of its stressing nature, other than providing fun and entertainment.
But this information you have provided is really useful and new to me. Thanks.
Intel i7-7900K (3.60 GHz) - ASUS Prime Z390A - 32 GB DDR4 RAM 2400 MHz
GPU EVGA GTX-1060 OC 6GB at 1920x1080, 144 Hz - Monitor ASUS VG-248QE
System Windows 11 Pro in WD SSD 500 GB. Games in Inland 1Tb M.2 NVMe PCIe
User avatar
jalsina
 
Posts: 2013
Joined: Sun Jul 05, 2015 8:32 pm

Re: Easiest way to mark scenarios complete?

Unread postby Chacal » Mon Aug 08, 2016 12:02 pm

It's just a question of not playing the same scenarios over and over again.
Over the hill and gathering speed
Chacal
Site Admin
 
Posts: 6479
Joined: Tue Jul 05, 2011 1:11 pm
Location: Quebec, Canada

Re: Easiest way to mark scenarios complete?

Unread postby Ericmopar » Mon Aug 08, 2016 2:23 pm

I'm kinda proud of some of my medals. Some of those timetabled passenger runs on British lines are not easy to medal in, much less a silver or gold.
In some other career scenarios, meh... *!greengrin!*

Most of the time I drive for fun though.
New build. i7-7700k, MSI Z270 Gaming M5 Mobo, Hyper 212 Evo, Corsair DDR4 3200 Mhz RAM, Klipsch Pro Mediea 2.1 Speakers, Samsung 850 Evo SSD, HAF XM Case, Asus Strix GTX 1070 and Cooler Master Storm XT Keyboard.
Slick with Pretty Rainbow Colors.
User avatar
Ericmopar
 
Posts: 2797
Joined: Mon May 13, 2013 12:35 am
Location: Henderson NV.


Return to TS 2016

Who is online

Users browsing this forum: No registered users and 1 guest