Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue exporting non package raw files #26

Open
MinshuG opened this issue Dec 11, 2024 · 7 comments
Open

issue exporting non package raw files #26

MinshuG opened this issue Dec 11, 2024 · 7 comments

Comments

@MinshuG
Copy link
Owner

MinshuG commented Dec 11, 2024

#23 (comment)

@MinshuG
Copy link
Owner Author

MinshuG commented Dec 11, 2024

I tried with a ini file from valorant seems to be working fine. Can share the error you are getting and possibly code too? @joric

@mortalis13
Copy link

Managed to get the reader for a package with get_reader, so if the wanted file appears in the self.files, in principle it should be retrievable. So it would be needed the error stack and debugging step by step to know what happened.
The only thing is that it failed for a package name with only one "/", like "Engine/GlobalShaderCache-PCD3D_SM5", as it searches the root based on 2 slash indexes.

@joric
Copy link
Contributor

joric commented Dec 12, 2024

@MinshuG It kind of works, but apparently not for 5.1. I am trying to read '/Stalker2/Content/GameLite/GameData/ItemPrototypes/WeaponPrototypes.cfg'

for x in provider.files says (among others)

('Stalker2/Content/GameLite/GameData/ItemPrototypes/WeaponPrototypes', <Name=/Stalker2/Content/GameLite/GameData/ItemPrototypes/WeaponPrototypes.cfg>)

        # package path = 'Stalker2/Content/GameLite/GameData/ItemPrototypes/WeaponPrototypes'
        package = provider.try_load_package(package_path)

        if not package:
            reader = provider.get_reader(package_path)
            if reader:
                filename += '.cfg'
                print('writing "%s" ...' % filename)
                with open(filename, 'wb') as f:
                    f.write(reader.read())
            else:
                print('get_reader failed at', package_path)
            continue

But it doesn't seem consistent. Sometimes data is 0 bytes, sometimes it's larger than needed. Maybe it's because Stalker2 is UE5.1 not 5.0?

E,g, here's `/Stalker2/Content/GameLite/GameData/QuestPrototypes.cfg pulls extra data comparing with FModel

[0] : struct.begin
   SID = empty
   MainQuest = false
   Image =
   Name =
   Description =
   StartQuestNodeSID =
   LocalQuest = false
struct.end
\xef\xbb\xbf[0] : struct <-- this shouldn't be here, extra data, must be the next file in the storage

And for Stalker2/Content/GameLite/GameData/ItemPrototypes/WeaponPrototypes reader.read() returns 0 bytes though it should be 102kb. Alignment perhaps?

@MinshuG
Copy link
Owner Author

MinshuG commented Dec 12, 2024

maybe UE 5.1 containers (.utoc/.pak) aren't supported

@mortalis13
Copy link

ok, in theory it would be: Epic Launcher -> Login -> Unreal Engine -> Library -> + -> 5.1.1 -> Install -> find UnrealPak.exe -> check the correct flags and use [not tested]

@MinshuG
Copy link
Owner Author

MinshuG commented Dec 15, 2024

If you’re gonna use UnrealPak, might as well just use FModel since it’s may more user friendly.

@mortalis13
Copy link

ok, thanks a lot. Didn't know about that tool...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants