How To Edit Tsw2 .pak Files

Discussion in 'Creation Centre' started by TheShotte, May 1, 2021.

  1. TheShotte

    TheShotte Well-Known Member

    Joined:
    Jun 16, 2020
    Messages:
    380
    Likes Received:
    648
    A. Install UnrealEngine 4.23, and create a new project in it called "TS2Prototype".

    B.
    Now that you have the engine installed, go to "(Unreal Install Directory)\UE_4.23\Engine\Binaries\Win64", hold down Shift and Right Click on an empty space in the window, choose "Open PowerShell Here".

    C. Once you have the PowerShell window open, you use this command to extract:
    ./UnrealPak.exe (Path to .pak File) -Extract (Path to Extract Directory)
    So in example:

    - just make sure your output directory actually exists, the quotes are necessary if you have spaces in your path, and also make sure the output directory doesn't have a trailing \.

    D. So now you have some source files which you can look through. They're fairly well organized and easy to navigate. Get yourself UE Viewer. Once you have it, open it, and point it to your newly extracted .pak directory (in above example - "S:\TSW2 Source"). UE Viewer will let you export certain assets although they have been cooked, so you can see what's what.

    Next Steps:
    You can easily replace default assets such as textures, materials, sounds, etc. by importing them into the engine and cooking the assets, and creating a pak file with them, but this is for part 2 which I would gladly share with you, if you decide to go that far.
     
    Last edited: May 3, 2021
    • Helpful Helpful x 4
    • Like Like x 2
  2. PeterNeutron

    PeterNeutron Member

    Joined:
    Aug 21, 2018
    Messages:
    32
    Likes Received:
    80
    For me it says access denied and that i am not allowed to run this app on my PC.

    I have Unreal Engine 4 installed but upon executing the commandline it says access denied.
     
  3. solicitr

    solicitr Well-Known Member

    Joined:
    Jun 20, 2020
    Messages:
    6,054
    Likes Received:
    8,646
    Try running as Adminstrator
     
  4. PeterNeutron

    PeterNeutron Member

    Joined:
    Aug 21, 2018
    Messages:
    32
    Likes Received:
    80
    Worked....was typo error.
    Does anyone know how to edit the service timetable?
     
  5. TheShotte

    TheShotte Well-Known Member

    Joined:
    Jun 16, 2020
    Messages:
    380
    Likes Received:
    648
    You will not be able to edit timetables (much, you can do it to some extent, but very minimal and it takes a lot of work), scenarios, any of that stuff as it was created by a customized version of the editor which unfortunately we do not have access to. Mostly, you can just replace assets such as textures and sounds.
     
  6. PeterNeutron

    PeterNeutron Member

    Joined:
    Aug 21, 2018
    Messages:
    32
    Likes Received:
    80
    :( sorry to hear that
     
  7. 7orenz

    7orenz Well-Known Member

    Joined:
    Oct 5, 2018
    Messages:
    812
    Likes Received:
    1,047
    C:\Program Files\Epic Games\UE_4.26\Engine\Binaries\Win64> ./UnrealPak.exe C:\Users\Utente\OneDrive\Desktop\provaPAK\TS2Prototype-TaurusSound.pak -Extract C:\Temp
    LogPakFile: Display: Using command line for crypto configuration
    LogPakFile: Display: Unreal pak executed in 0.002028 seconds
    C:\Program Files\Epic Games\UE_4.26\Engine\Binaries\Win64>

    --------------------------------------------------------------------------------------------------

    Premise: today I started trying to understand how to do it. I tried with 2 files.PAK.
    The first PAK extracted was the sound of the AC4400CW and I extracted it correctly.
    The second PAK is this from the log above (I renamed the files to make the path easier and without spaces, "TaurusSound" is nothing more than the PAK with the sounds of the BR182 (the old Rapid Transit model: DB BR 182 Soundmod - Rail-Sim.de - Die deutsche Train Simulator Community). with the original name which with this renamed by me. Either way it tells me that the PAK file is encrypted? Has anyone ever received a similar error?

    For both I used the same folders (created specifically for testing) so I don't think the error is due to omitted spaces or quotes.
     
    Last edited: Jul 21, 2021
  8. TheShotte

    TheShotte Well-Known Member

    Joined:
    Jun 16, 2020
    Messages:
    380
    Likes Received:
    648
    Is it a 4.26 pak file? If the file hasn't been updated to Rush Hour update, then you will need UnrealPak from engine version 4.23.
     
    • Like Like x 1
  9. 7orenz

    7orenz Well-Known Member

    Joined:
    Oct 5, 2018
    Messages:
    812
    Likes Received:
    1,047
    https://rail-sim.de/forum/filebase/entry/4550-db-br-182-soundmod/

    It's been several months, so I don't remember exactly what I was doing (which UE version I was using). For sure the pak file (in the link) was prior to the launch of Rush Hours, so compiled with UE 4.23.

    I believe I have downloaded both "compilers/development kit" 4.23 and 4.26. What I didn't understand is how I can decrypt the .pak file of the link above using the command to decrypt the pak compiled with UE 4.23 rather than 4.26.
    There should be 2 distinct executable (.EXE) files, one relating to 4.23 and the other to 4.26, I suppose.

    However in the next few days I will try again. Thanks for your help.
     
    Last edited: Nov 2, 2021
  10. TheShotte

    TheShotte Well-Known Member

    Joined:
    Jun 16, 2020
    Messages:
    380
    Likes Received:
    648
    Yeah you technically would have to install both version 4.23 and 4.26 of the Unreal Engine, thus you would get the appropriate UnrealPak.
     
  11. Dinosbacsi

    Dinosbacsi Well-Known Member

    Joined:
    Sep 20, 2017
    Messages:
    1,495
    Likes Received:
    2,517
    I gave it a try and extracted some files. Going to try starting off with a few texture replacements to see what I can play with.

    So after I extracted a .pak file, exported some textures from it and modified them, how can I import them into the game again as a .pak mod?
     
  12. foruz

    foruz New Member

    Joined:
    Jan 8, 2022
    Messages:
    1
    Likes Received:
    1
    Hi Shotte, can you continued with part2? thank you:))
     
    • Like Like x 1

Share This Page