How To Edit Tsw2 .pak Files

Discussion in 'Creators Club' started by TheShotte, May 1, 2021.

  1. TheShotte

    TheShotte Well-Known Member

    Joined:
    Jun 16, 2020
    Messages:
    380
    Likes Received:
    662
    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 6
    • Like Like x 3
  2. PeterNeutron

    PeterNeutron Active Member

    Joined:
    Aug 21, 2018
    Messages:
    44
    Likes Received:
    104
    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:
    11,735
    Likes Received:
    17,949
    Try running as Adminstrator
     
  4. PeterNeutron

    PeterNeutron Active Member

    Joined:
    Aug 21, 2018
    Messages:
    44
    Likes Received:
    104
    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:
    662
    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.
     
    • Like Like x 1
  6. PeterNeutron

    PeterNeutron Active Member

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

    7orenz Well-Known Member

    Joined:
    Oct 5, 2018
    Messages:
    814
    Likes Received:
    1,062
    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:
    662
    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:
    814
    Likes Received:
    1,062
    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:
    662
    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:
    3,312
    Likes Received:
    8,665
    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?
     
    • Like Like x 2
  12. foruz

    foruz New Member

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

    Cotax Well-Known Member

    Joined:
    Mar 25, 2021
    Messages:
    150
    Likes Received:
    329
    Did you find out?

    185.2 in cab noise is making my ears bleed, want to lower it.
     
  14. Dinosbacsi

    Dinosbacsi Well-Known Member

    Joined:
    Sep 20, 2017
    Messages:
    3,312
    Likes Received:
    8,665
    I did, but I could only access textures so far, didn't have any luck modifying sounds yet :(
     
  15. skoaler

    skoaler New Member

    Joined:
    Feb 22, 2022
    Messages:
    1
    Likes Received:
    0
    Thanks The Shotte.. I have exported one of the train cars textures to tga format.. loaded it into dxtbmp and edited it in ms paint.. saved it.. then re saved it in dxtbmp as tga with alpha.. Ready for the next step.. How do I import it back into the TSW sand grade patch main PAK file and save the PAK file ? to load TSW and see the texture change
     
  16. houngan#5135

    houngan#5135 New Member

    Joined:
    May 8, 2022
    Messages:
    2
    Likes Received:
    1
    Hi, I would like to quickly ask for information on which repository the language interface of Tsw2 is located in. I would like to translate the game into my native language. Thank you in advance for your answer.:)
     
  17. dvdou#8372

    dvdou#8372 New Member

    Joined:
    Jul 14, 2022
    Messages:
    1
    Likes Received:
    0
    Hy
    LogInit: Display: Loading text-based GConfig....
    LogPakFile: Display: Using command line for crypto configuration
    LogPakFile: Display: Collecting files to add to pak file...
    LogPakFile: Display: Collected 2 files in 0.00s.
    LogPakFile: Display: Creating pak C:\Games\Steam\steamapps\common\Train Sim World 2\WindowsNoEditor\TS2Prototype\Content\DLC\TS2Prototype-WindowsNoEditor-MarseilleAvignon.pak.
    LogPakFile: Display: CompressionFormats in priority order: Zlib
    LogDerivedDataCache: Display: Pak cache opened for reading ../../../Engine/DerivedDataCache/Compressed.ddp.
    LogDerivedDataCache: Display: Performance to C:/Users/kauff/AppData/Local/UnrealEngine/Common/DerivedDataCache: Latency=0.00ms. RandomReadSpeed=999.00MBs, RandomWriteSpeed=999.00MBs. Assigned SpeedClass 'Local'
    LogPakFile: Warning: Missing file "C:/TSW2" will not be added to PAK file.
    LogPakFile: Warning: Missing file "../../../Engine/Binaries/Win64/Extract" will not be added to PAK file.

    LogPakFile: Display: CompressionFormat 0 [Zlib] : 0 files, 0 -> 0 bytes
    LogPakFile: Display: CompressionFormat 1 [None] : 0 files, 0 -> 0 bytes
    LogPakFile: Display: Added 0 files, 338 bytes total, time 0.02s.
    LogPakFile: Display: PrimaryIndex size: 105 bytes
    LogPakFile: Display: PathHashIndex size: 8 bytes
    LogPakFile: Display: FullDirectoryIndex size: 4 bytes
    LogPakFile: Display: Encryption - DISABLED
    LogPakFile: Display: Unreal pak executed in 0.034457 seconds
    PS C:\Program Files\Epic Games\UE_4.27\Engine\Binaries\Win64>
     
  18. Kitten

    Kitten Active Member

    Joined:
    Jul 9, 2022
    Messages:
    118
    Likes Received:
    120
    I use QuickBMS to unpak files. It's easier than having different versions of UnrealPak.
     
  19. Boa

    Boa Member

    Joined:
    Jun 29, 2022
    Messages:
    48
    Likes Received:
    8
    What command do you run to get it to make a pak file (even though it errors here, what command do you run?)
     

Share This Page