Is the Theory About .ap Files Correct?

Help, problems, solutions, questions and answer about the new TS2014 upgrade - all in one place.

Re: Is the Theory About .ap Files Correct?

Unread postby mikesimpson » Sat Nov 09, 2013 12:41 am

Hi Harry,

The problem with making a clone of a folder like Kuju\RailsimulatorUS as Kuju\RailsimulatorUS_Mods is that you would then have to go through every file in the folder and all its sub-folders and search for 'RailsimulatorUS' and replace it with 'RailsimulatorUS_Mods' . Even then, you would need to modify any scenarios which used your modded assets to read the new folders.

To give an instance of this, the simple Box_Car.bin file in RailSimulatorUS has 14 links to other files in RailSimulatorUS for such things as couplings, bogies and numbers etc. This would be too much work for most people.

I think that if you wish to mod any assets, then just using 7zip or RW_Tools to extract the assets in question out of the .ap files and into a correct folder tree, modifying them, and saving copies of them to a #REINSTALL folder as with Doc Lisboa's batch files. Then if Steam overwrites the mods, you can just run Doc's batch files to restore the mods with little effort.

Mike
mikesimpson
 
Posts: 364
Joined: Sun Feb 15, 2009 4:49 pm

Re: Is the Theory About .ap Files Correct?

Unread postby OlPaint » Sat Nov 09, 2013 9:39 am

Mike

That is great advice. Doc Machinist's 2-Clickz #REINSTALL folder does the trick for me. I have saved all my mods there. So when RSC does a re-check and mysteriously removes or overwrites my mods, I simply run 2-Clickz to reset them where they belong.

It sure would be peachy if I could bulk un-compress the .AP archives from just a list of directory tree folders in each .AP, then bulk set the file attributes to Read/Write for these un-compressed files, thus making a shell for my 2-Clickz #REINSTALL files to reload and reside. Right now RW_Tools does indeed include all these functions but it is a tedious job to undertake for more than one or two times for all the .AP archives we now have. I would like to have the batch executable code to complete all these steps in one fell swoop. Chacal said he was developing just such a utility. I would love to see his code...I used to be proficient at designing BAT files in my old DOS days...But my memory fails me. LOL

OlPaint
__________________________
Chessie...Sleep Like A Kitten

OlPaint
User avatar
OlPaint
 
Posts: 595
Joined: Thu Jun 21, 2012 6:25 am

Re: Is the Theory About .ap Files Correct?

Unread postby mikesimpson » Sat Nov 09, 2013 5:24 pm

The problem with a batch file (which is what RW_Tools uses under the hood) is that the full version of 7zip which is very fast, does not have a command line option. The command line version of 7zip (7za.exe) which is included with RW_Tools is much slower than the full version.

I will see if I can find a faster alternative.

Mike
mikesimpson
 
Posts: 364
Joined: Sun Feb 15, 2009 4:49 pm

Re: Is the Theory About .ap Files Correct?

Unread postby harryadkins » Sat Nov 09, 2013 5:43 pm

OlPaint,

I have one "virgin" railworks folder in the traditional location under steam with ONLY RSC assets and content. I also have two other installs under C:/RW_Steam amd C:/RW_Diesel. Both of the separate installs have some basic RSC assets but otherwise are totally different in terms of assets and content. Both work exactly as the original install except faster. I didn't have to edit a single file. And, both the separate installs are unaffected by Steam "verify integrity" or file update commands. I have unpacked only the AP files I need in the separate installs. There is very little duplication of files except for the base RSC folders that I need for the separate installs (ie. the Smokebox folder is located in both the virgin folder and the RW_Steam folder).

Harry
User avatar
harryadkins
 
Posts: 3105
Joined: Sun Aug 23, 2009 8:01 am
Location: South Carolina, USA

Re: Is the Theory About .ap Files Correct?

Unread postby OlPaint » Sat Nov 09, 2013 6:15 pm

Harry

I need to ponder you suggestion for a little bit. Your dedicated alternate Railworks installs may be the way to go. I think I understand you now - you decide at launch time which flavor of scenarios you will play? Whether it be Steam or Diesel, correct? And to make that work you have segregated the scenarios as well? So, in effect you have three separate games setup - A Steam Loco, a Diesel Loco and a Plain Vanilla set of games. That is kind of neat!

OlPaint
__________________________
Chessie...Sleep Like A Kitten

OlPaint
User avatar
OlPaint
 
Posts: 595
Joined: Thu Jun 21, 2012 6:25 am

Re: Is the Theory About .ap Files Correct?

Unread postby mikesimpson » Sat Nov 09, 2013 7:32 pm

I have modified RW_Tools option to display all your .ap files so that it now includes 2 extra columns:-
Length of .ap file and Size of the folder

If the size of folder is much the same as the .ap file, then it has not been unpacked, and the .ap filename is shown in red.

This at least will quickly show you if a Steam update has removed all your previously unpacked files.

Also when unpacking with the 7zip option, all files are automatically made read/write.

Mike
mikesimpson
 
Posts: 364
Joined: Sun Feb 15, 2009 4:49 pm

Re: Is the Theory About .ap Files Correct?

Unread postby OlPaint » Sat Nov 09, 2013 10:05 pm

Mike

That is Marvelous. Your improvements have really make the conversion of .AP archives to normal directory trees a great deal more palatable.

I have heard that the removal of our modified files by RSC during the first run of Railworks and after the completion of a "Verify Integrity..." operation has been described as a "cleanup".

My experience shows that the "cleanup" happens just this one time. And subsequent Railworks launches do not repeat the "cleanup". So, any of my mods that I reinstall at this time, after that first launch of Railworks, are left alone . I guess It is safe to reinstall them to the Un-compressed Directories before the second launch of Railworks and thereafter. Does any one have a different experience?

OlPaint
__________________________
Chessie...Sleep Like A Kitten

OlPaint
User avatar
OlPaint
 
Posts: 595
Joined: Thu Jun 21, 2012 6:25 am

Re: Is the Theory About .ap Files Correct?

Unread postby latimers » Sat Nov 09, 2013 10:32 pm

My experience is that the "cleanup" happens only on the first running of TS2014 after performing a "Verify Integrity..." and not on a subsequent running of TS2014.

Bob.
latimers
 
Posts: 145
Joined: Thu Jul 26, 2012 9:29 pm
Location: Auckland, New Zealand

Re: Is the Theory About .ap Files Correct?

Unread postby artimrj » Sat Nov 09, 2013 11:30 pm

latimers wrote:My experience is that the "cleanup" happens only on the first running of TS2014 after performing a "Verify Integrity..." and not on a subsequent running of TS2014.

Bob.


That is my experience also.
Bob Artim - Generation X²
I don't have a PHD, I have a DD214... Freedom carries sacrifice
I'm crawling in the dark looking for the answer
User avatar
artimrj
 
Posts: 4722
Joined: Sun Jan 31, 2010 3:07 pm
Location: Beaver, Pennsylvania

Re: Is the Theory About .ap Files Correct?

Unread postby Chacal » Sun Nov 10, 2013 12:02 pm

OlPaint wrote:It sure would be peachy if I could bulk un-compress the .AP archives from just a list of directory tree folders in each .AP, then bulk set the file attributes to Read/Write for these un-compressed files, thus making a shell for my 2-Clickz #REINSTALL files to reload and reside. Right now RW_Tools does indeed include all these functions but it is a tedious job to undertake for more than one or two times for all the .AP archives we now have. I would like to have the batch executable code to complete all these steps in one fell swoop. Chacal said he was developing just such a utility. I would love to see his code...I used to be proficient at designing BAT files in my old DOS days...But my memory fails me. LOL


Here's your batch file.
Save it in any folder on your computer, and copy 7za.exe to this folder from your RW_Tools folder or from the internet.
Read the comments in the batch header and check if this is what you require.
You may run it before running the 2-click batch, or call it from your 2-click batch, or insert the lines in your 2-click batch.

Code: Select all
@ECHO OFF
REM --------------------------------------------------------
REM AP_Extract.bat
REM Chacal 2013
REM Extracts the Railvehicles folder
REM   from every .ap archive in Railworks\Assets,
REM   to the appropriate Railworks\Assets\Provider\Product folder,
REM   overwriting existing files without prompting,
REM and clears the read-only attributes for the extracted files.
REM I am not responsible for adverse effects to your Railworks installation
REM or if this melts your computer.
REM Always make a backup before using any batch file!
REM *** IMPORTANT *** Change the first line of the script(SET RW=) to your own Railworks folder location
REM --------------------------------------------------------
SET RW=I:\Steam\steamapps\common\railworks
ECHO Processing .ap files, please wait
FOR /F "delims=" %%I in ('DIR /B /S %RW%\Assets\*.ap') DO (
ECHO Extracting %%I
7za.exe x %%I -ir!Railvehicles\* -o%%~dpI -y > NUL
ECHO Clearing read-only attributes
ATTRIB -R %%~dpI\*.* /S > NUL
ECHO.
ECHO.
)
ECHO Finished processing .ap files.
PAUSE
Over the hill and gathering speed
Chacal
Site Admin
 
Posts: 6487
Joined: Tue Jul 05, 2011 1:11 pm
Location: Quebec, Canada

Re: Is the Theory About .ap Files Correct?

Unread postby OlPaint » Sun Nov 10, 2013 2:45 pm

Chacal
Absolutely marvelous work. I shall put this bad boy to the task immediately.
OlPaint
__________________________
Chessie...Sleep Like A Kitten

OlPaint
User avatar
OlPaint
 
Posts: 595
Joined: Thu Jun 21, 2012 6:25 am

Re: Is the Theory About .ap Files Correct?

Unread postby peterhayes » Sun Nov 10, 2013 3:21 pm

Chacal
Great bat file
Will this also so the same for the ap files in the CONTENT folder or is it just for Assets.
If we change this line
FOR /F "delims=" %%I in ('DIR /B /S %RW%\Assets\*.ap') DO (
Assets to CONTENT will that work?
Great work
Regards
pH
User avatar
peterhayes
 
Posts: 807
Joined: Sun Oct 02, 2011 12:34 am
Location: Antipodes

Re: Is the Theory About .ap Files Correct?

Unread postby mikesimpson » Sun Nov 10, 2013 4:47 pm

Hi Peter,

No, read the comment, that batch file only extracts 'RailVehicles' folders from the .ap files in Assets. It will be very useful for those reskinning or modding their rolling stock.

However, if you change Assets to Content and also change RailVehicles to Scenarios then it works fine to extract all of your scenarios.

This should then work fine with RW_Tools to allow you to edit scenarios once I work out how to extract the RouteProperties.xml from each folder.

Perhaps Chacal can help me with that?

Mike
mikesimpson
 
Posts: 364
Joined: Sun Feb 15, 2009 4:49 pm

Re: Is the Theory About .ap Files Correct?

Unread postby Chacal » Sun Nov 10, 2013 10:30 pm

Do you want to extract RouteProperties.xml from each route, or
extract ScenarioProperties.xml from each scenario?
Over the hill and gathering speed
Chacal
Site Admin
 
Posts: 6487
Joined: Tue Jul 05, 2011 1:11 pm
Location: Quebec, Canada

Re: Is the Theory About .ap Files Correct?

Unread postby mikesimpson » Sun Nov 10, 2013 11:03 pm

Chacal wrote:Do you want to extract RouteProperties.xml from each route, or
extract ScenarioProperties.xml from each scenario?

Hi Chacal,

It was RouteProperties.xml from each route, however I have managed to convert the Assets batch file you posted to extract the Scenarios AND the RouteProperties.xml file from each of the .ap files in the Content folders (I need RouteProperties.xml to allow RW_Tools to find the name of the route and associate it with the HEX number used as the route folder name).

Can I have your permission to use converted versions of your batch files with my program. I shall of course mention your work in this matter.

Thanks - Mike
mikesimpson
 
Posts: 364
Joined: Sun Feb 15, 2009 4:49 pm

PreviousNext

Return to TS 2014 - Train Simulator

Who is online

Users browsing this forum: No registered users and 0 guests

cron