Sorrow446 / SRTools

Toolkit for modding Saints Row 2022 written in Go.
7 stars 2 forks source link

LZ4 Package #2

Open Narayanna opened 2 years ago

Narayanna commented 2 years ago

Hello, where exactly do we need to install the LZ4 package, because I did not understand it.

Sorrow446 commented 2 years ago

Hello. Windows: https://github.com/lz4/lz4/releases/download/v1.9.4/lz4_win64_v1_9_4.zip

It should come pre-installed on Linux. I'm not sure about Mac.

Put the lz4 exe next to main.go or sr_tools_x64.exe if you're running from the exe.

Narayanna commented 2 years ago

Thank you so much. I hope you make a tool for string, that is, for localization, we will be very happy. Good work.

Sorrow446 commented 2 years ago

You're welcome. I could look into the localization. Could you send the path of where localization is stored and in which packfile?

Narayanna commented 2 years ago

Thank you for your interest and help. Normally, in other Saints Row games, language files would be in the form of "le_strings". In this game, I opened all the archive files in the data, but no strings or localisation files were found. Where could it be?

Sorrow446 commented 2 years ago

If I had to guess, I'd say in engine.vpp_pc. I'll take a look.

Narayanna commented 2 years ago

Thank you. I hope you find it, I will be grateful.

Sorrow446 commented 2 years ago

Seems they are here in sr_city.vpp_pc. data\sr_city\scribe

Narayanna commented 2 years ago

I had noticed, but I wasn't sure, I guess it looks that way. There is a scribe folder in different archives. I hope it doesn't force you too much.

Sorrow446 commented 2 years ago

I have figured out the structure. I'm gonna write a parser soon.

Narayanna commented 2 years ago

I am so happy. I can sleep soundly tonight now. Thanks I'm following :)

Sorrow446 commented 2 years ago

:P.

Narayanna commented 2 years ago

Woww I hope that means it will. Good thing there are software experts :)

Sorrow446 commented 2 years ago

Hello. I just pushed read and write support for Scribe.

Instructions:

  1. Export scribe to JSON. convert -i activity.en.scribe_pad -o activity.en.json
  2. Open activity.en.json in a text editor to change the strings (see the text key and type string in each entry).
  3. Convert JSON to scribe. convert -i activity.en.json -o activity.en.scribe_pad

Using the pack feature with your modified scribe could work, but it's likely to crash until I perfect the packer. I'd like to add an append feature that will allow you to install mods quickly to existing original packfiles.

I hope this isn't too confusing for you. If you run into trouble or would like compiled binaries, please let me know.

Edit: https://anonfiles.com/xdwdIc6aye/srtools_x64_exe

Narayanna commented 2 years ago

Thank you so much for your hard work and dedication. It seems there are over 1000 pad files in this game and it's almost impossible to open one by one :( Is it possible for you to create a bat file that will extract these files in bulk?

Also, since almost all archive files in the game have separate scribe folders, I think we need modding as you said. Does the game read a modpack just like unreal engine?

Sorry if I pushed you a bit, I would be very grateful if you could help me with the localization.

And I would like to support you, a gift or something :)

Sorrow446 commented 2 years ago

You're welcome. The problem with adding batch support to convert is that it uses the file input and output file extensions to determine what to convert from and to. I'm not sure how to tackle that, there could be filename clashes. Maybe I could have it look for scribe files recursively and convert with folder structure. Instead of relying on file extensions, I could have two arguments like: -from scribe -to json

The game won't load loose files. I think the paths of the packfiles it loads are hardcoded, so you'd need to modify an original one to mod it.

Thank you, but I don't expect anything in return. I'll continue to update SRTools as often as I can.

Narayanna commented 2 years ago

I understood, okey. Then I wonder if it's possible for you to create a bat file just to make it a little easier. In terms of being more practical. Because there are too many files, one click to extract and repack with bat file, even one by one. If you're working on it, I'll wait, no problem.

Sorrow446 commented 2 years ago

Test build. convert -i boot -o out --from scribe --to json -b https://anonfiles.com/96u9P162y7/srtools_x64_exe

-b enables batch processing, only supported with convert at the moment. Unpack supports multiple input paths, but not batch.

Narayanna commented 2 years ago

Sorry for the late response, I just got back from work. Actually, I didn't quite understand how to use the tool :( that's why I wanted a bat file. How exactly am I going to use the tool because I failed to extract the file. Can you give an example usage please. Sorry for bothering you.

Narayanna commented 2 years ago

Whatever I did didn't work. Where am I doing wrong?

https://i.imgur.com/iWcbjoB.jpg https://i.imgur.com/nViq92U.jpg

Narayanna commented 2 years ago

Hello, is there any progress? Because I failed to use the tool. I'm sorry for the inconvenience.

Sorrow446 commented 2 years ago

Sorry, but I've been busy making a mod manager GUI for the game.

Boot should be the path of your folder containing the scribes, and out should be the output path.

Batch: srtools_x64.exe convert -i boot -o out --from scribe --to json -b Single: srtools_x64.exe convert -i 1.scribe_pad -o 1.json --from scribe --to json

Narayanna commented 2 years ago

Thank you. It's very nice of you to make a GUI mod tool. Are you going to include the text tool in this tool? it would be much easier to use that way. I was able to open the vpp_pc archives, but I couldn't figure out how to use the text tool. If you are making a vehicle, I would be happy to wait.

Narayanna commented 2 years ago

I was unable to open the file. Could you show an example usage with srtools_x64.exe via cmd? I couldn't export anyway.

Narayanna commented 2 years ago

Sorry to bother you again but can you help? I wonder why the tool doesn't work for me, where am I going wrong? Could you please show an example on cmd with just exe.

Narayanna commented 2 years ago

Hello, sorry to bother you again. But I've been trying for days and I couldn't open the file. I get this error, what exactly should I do?

https://imgur.com/a/EB7w5MJ

przemo20 commented 2 years ago

Test build. convert -i boot -o out --from scribe --to json -b https://anonfiles.com/96u9P162y7/srtools_x64_exe

-b enables batch processing, only supported with convert at the moment. Unpack supports multiple input paths, but not batch.

@skalia16 If you're using the file from this quoted post, then the command should be: srtools_x64.exe convert -i activity.en.scribe_pad -o activity.en.json --from scribe --to json

Hello. I just pushed read and write support for Scribe.

Instructions:

1. Export scribe to JSON.
   `convert -i activity.en.scribe_pad -o activity.en.json`

2. Open activity.en.json in a text editor to change the strings (see the text key and type string in each entry).

3. Convert JSON to scribe.
   `convert -i activity.en.json -o activity.en.scribe_pad`

Using the pack feature with your modified scribe could work, but it's likely to crash until I perfect the packer. I'd like to add an append feature that will allow you to install mods quickly to existing original packfiles.

I hope this isn't too confusing for you. If you run into trouble or would like compiled binaries, please let me know.

Edit: https://anonfiles.com/xdwdIc6aye/srtools_x64_exe

If the file from this one, use the following command: srtools_x64.exe convert -i activity.en.scribe_pad -o activity.en.json

Narayanna commented 2 years ago

Test yapısı. convert -i boot -o out --from scribe --to json -b https://anonfiles.com/96u9P162y7/srtools_x64_exe -b, şu anda yalnızca convert ile desteklenen toplu işlemeyi etkinleştirir. Paketi açma, birden çok giriş yolunu destekler, ancak toplu işlemi desteklemez.

@skalia16 Bu alıntılanan gönderideki dosyayı kullanıyorsanız, komut şöyle olmalıdır: srtools_x64.exe convert -i activity.en.scribe_pad -o activity.en.json --from scribe --to json

Merhaba. Sadece Scribe için okuma ve yazma desteğine bastım. Talimatlar:

1. Export scribe to JSON.
   `convert -i activity.en.scribe_pad -o activity.en.json`

2. Open activity.en.json in a text editor to change the strings (see the text key and type string in each entry).

3. Convert JSON to scribe.
   `convert -i activity.en.json -o activity.en.scribe_pad`

Paketleme özelliğini değiştirilmiş yazıcınızla kullanmak işe yarayabilir, ancak paketleyiciyi mükemmelleştirene kadar çökmesi muhtemeldir. Modları mevcut orijinal paket dosyalarına hızlı bir şekilde kurmanıza izin verecek bir ekleme özelliği eklemek istiyorum. Umarım bu sizin için çok kafa karıştırıcı değildir. Sorun yaşarsanız veya derlenmiş ikili dosyalar istiyorsanız, lütfen bana bildirin. Düzenleme: https://anonfiles.com/xdwdIc6aye/srtools_x64_exe

Dosya bu dosyadan ise, aşağıdaki komutu kullanın: srtools_x64.exe convert -i activity.en.scribe_pad -o activity.en.json

Thank you, I tried all of these but I could not open the file. If I send you a sample file, could you try to open the file. If you open it, I would be very happy if you make a short tutorial video. I've been working on this for days. If I haven't, forgive my ignorance.

https://www.mediafire.com/file/kz65sc4k4ki2zlv/activity.en.scribe_pad/file

przemo20 commented 2 years ago

I also get an error with your file. Unfortunately, this tool seems to have problems processing plenty of scribe_pad files – some won't process at all (example errors: panic: EOF and panic: runtime error: makeslice: len out of range) and some output gibberish data into a JSON file (Screenshot: https://i.imgur.com/un3zObW.png; not to mention that the process eats up your RAM, CPU (when I'm writing this, it uses 20% of CPU and 15 GB RAM), takes like 30 minutes to process some files (example: ui_base.es.scribe_pad), and in the end fails with an error like this:

runtime: VirtualAlloc of 17448304640 bytes failed with errno=1455
fatal error: out of memory

).

I guess that's something the author should look into.

EDIT: scribe_pad files: https://drive.google.com/file/d/1nYDECy4CsXfA4Jr31AG1uDhUCDKfJiRC/view?usp=sharing

Narayanna commented 2 years ago

Ayrıca dosyanızla ilgili bir hata alıyorum. Ne yazık ki, bu araç çok sayıda scribe_pad dosyasını işlemede sorun yaşıyor gibi görünüyor - bazıları hiç işlenmez (örnek hatalar: panic: EOFve panic: runtime error: makeslice: len out of range) ve bazıları anlamsız verileri bir JSON dosyasına verir (Ekran Görüntüsü: https://i.imgur.com/un3zObW .png ; işlemin RAM'inizi, CPU'nuzu yediğinden bahsetmiyorum bile (bunu yazarken CPU'nun %20'sini ve 15 GB RAM'i kullanır), bazı dosyaların işlenmesi 30 dakika kadar sürer (örnek: ui_base.es. scribe_pad) ve sonunda aşağıdaki gibi bir hatayla başarısız oluyor:

runtime: VirtualAlloc of 17448304640 bytes failed with errno=1455
fatal error: out of memory

).

Sanırım yazarın incelemesi gereken bir konu.

EDIT: scribe_pad dosyaları: https://drive.google.com/file/d/1nYDECy4CsXfA4Jr31AG1uDhUCDKfJiRC/view?usp=sharing

Yes, thank you. I couldn't manage to extract the file either. I hope dear @Sorrow446 will give an update. I haven't heard back from him for a long time, I hope he is fine.