Changing Stock That Are In An Ap-file

Discussion in 'General Discussion' started by Måns Johannesson, May 27, 2021.

  1. Måns Johannesson

    Måns Johannesson Member

    Joined:
    May 23, 2019
    Messages:
    69
    Likes Received:
    13
    I've recently started to learn how to change stock in scenarios. Have used both TS-Tools and scenario editor and definitely prefer TS-tools. However TS-tools can't find stock that are in an ap-file. Is it possible in any way to use TS-tools if I don´t extract the ap-files?
    If not, is it possible to extract the ap-file, do the substitution and then delete the extracted files (keeping only the ap-file) or won't TS find the changed stock after that? I've would rather have only the ap-files on my system (partly because the memory usage and partly because i'd like to keep the installation clean).

    /Måns
     
  2. 749006

    749006 Well-Known Member

    Joined:
    Dec 10, 2016
    Messages:
    8,488
    Likes Received:
    2,708
    What you suggest would work but you would have to know which files to extract
    But you don't need to extract every AP file
    TS Tools only need to see what is inside the AP file for stock swaps but TS Tools has no effect when the game is running.

    A Scenario is basically a big text file that TS Tools amends
    If you wanted to amend another scenario later then the files would need extracting again
     
    Last edited: Jun 6, 2021
  3. Cyclone

    Cyclone Well-Known Member

    Joined:
    Feb 29, 2020
    Messages:
    3,166
    Likes Received:
    1,057
    The quick way to answer this question is yes.

    NOTE: I am aware you have done this. I'm posting this as a general guide for other people. You can follow up with additional questions as it helps you.

    Let's say you want to swap in a Sherman Hill ES44AC over a BNSF one in a scenario somewhere, for instance. The reason for doing this? Maybe you're not American and cannot buy the BNSF one. So you want to play the scenario with something else.

    The first step, if it's an official scenario, is to clone it. Otherwise, you might cause problems with an official scenario and would have to fess up to what you did if asking for support, and they aren't able to help you fix something if you edited official content to start with (they also don't support third-party utilities, so don't even try). The good news is the AP file should be left untouched as your attempt to edit official content would require it being unpacked first, anyway. In any case, whether official or not, clone it and name it something else (or just leave "Copy" on the name). If the scenario is an official one and unpacked, you can clone it in Ts-Tools like any other scenario. Since I can't for the life of me find that right now, I'll suggest instead to go to the Build menu in the game and clone it there. This also means you don't have to unpack the official scenario, and the clone will be unpacked and have its own entry. (It also means you aren't editing an official scenario. Hurray!)

    Over in Ts-Tools, you will want to find the AP file with the assets. For my example, it's at RailWorks\Assets\RSC\ShermanHill\ShermanHillAssets.ap. In Ts-Tools, you will want to go to Files --> Find all AP files and select it. A list of all AP files found in your Railworks directory (Content folder, Assets folder...and that's probably about it generally) will appear. Locate the AP file you are searching for and then click "Extract rolling stock from selected .ap files". (By the way, I advise backing up any assets folder you unpack before unpacking in case something goes wrong.) As a side note, you can have the search occur only in the Assets folder via a different menu option.

    Once you have your duplicate scenario and unpacked stock, find the scenario in Ts-Tools under Edit Scenarios. You will need to select the route and locate the...wait, the route isn't there? (If it is, skip ahead.) You might have to index the routes first. A quick trip to the Index Route Properties will do it. I have build 1.0.20 (I really ought to update), so mine's under the Route Building Tools menu. I'm told there's a more convenient button for this now. Once the task is complete, come back to Edit Scenarios and meet the skip ahead folks.

    So, back at Edit Scenarios, you now have the route in question. Select the scenario - let's say a clone of The Midnight Magnet, which you can identify by the word "Copy" - and click Edit. Ten years later, the following box appears:

    Box.png

    I'll do the next two steps and show you the next box. My next step is finding the player service, SD70M 3954 Special. My next task is to then find the Sherman Hill assets folder, in the lower right of the window by going through the directory tree for my Sherman Hill folder. Once you find the RailVehicles folder, select the type of train - in this case, diesel, though you can also search for things like passenger coaches and freight stock, not to mention other types of trains where they exist (Sherman Hill is all diesel) - and click on Find Available Rolling Stock. The directory will auto-update as it searches for stock. When done, this has happened:

    Box2.png

    Notice in this image I have the player train selected. Notice the Driven Loco Index 0 entry. I believe that indicates your train, though if you were to peruse the scenario's XML file you'd confirm it's the correct train thanks to a 1 under the Player Loco entry (don't have the exact container on me ATM). Also, notice I have some reskins from RWA in the Boy Scouts, Pink Ribbon, and 5000th versions,. among a couple of other rogue ones; these are not in the DLC. Heck, maybe I'll put one of those on the final ES44AC scenario and rerun it with that loco. That would be a treat.

    In any case, select your engine under consist details. Select, in my case, the SH ES44AC UP (or pick the SD40-2 if you are so inclined). Click "Swap a SINGLE selected item". Note, since this is a different train, you will want to select to use a new stock option in the extreme lower left of the window; if using a different version of the same general engine, you might opt to keep the stock number. After the confirmation, save over in the lower left. Exit Ts-Tools, load the game, and find the copied scenario. Play the different consist. Just note that the text on your engine number will be wrong in the scenario unless you go into the timetable mode and fix it before playing. (You can also keep the wrong number on the new train; I put a CN number on a CP engine once and it was no worse for wear.)

    Note that some swaps are not advisable. For instance, if you want to replace a Black 5 from Kuju with the Bossman Games Black 5, you HAVE to do this via the editor. This is a different guide. Note if the train you want to replace can no longer be obtained or you just don't own it, you will want to use a stand-in (do this for all applicable consists) and then add the correct train into the editor, move the tasks and such over to it, delete the stand-in, and move your train in. The reason I bring up BMG here is because I've been advised swapping in Ts-Tools leaves the reverser unable to function. So if there is a problem with a Ts-Tools swap, you may want to try redoing it in the editor and try again.

    If you don't want to keep the unpacked files, you can now replace your unpacked version of the folder with your backed up copy. Note that if you install reskins like I did, however, it might be advisable to leave the trains unpacked for easy access to GEO files. If no reskins are in the directory in question, nothing is lost here.

    I hope this helps, post any other questions. :cool:
     
    Last edited: May 31, 2021
  4. Måns Johannesson

    Måns Johannesson Member

    Joined:
    May 23, 2019
    Messages:
    69
    Likes Received:
    13
    Perhaps a little late but thanks for the answers.

    /Måns
     

Share This Page