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

FPackageIndex::get_package for index>0 ? #10

Closed
QuentinBellus opened this issue Feb 12, 2020 · 3 comments
Closed

FPackageIndex::get_package for index>0 ? #10

QuentinBellus opened this issue Feb 12, 2020 · 3 comments

Comments

@QuentinBellus
Copy link

QuentinBellus commented Feb 12, 2020

if index < 0 {

In my experience if index>0 it should still return import_map.get(index - 1)
My own parser works that way and your commit history also shows it was working like that in the past.. Is that an oversight? If not could you explain why the change?

Thanks.

@SirWaddles
Copy link
Owner

I was trying to parse a few assets where a positive index almost always referred to either the wrong thing, or just was out of bounds and returned null. I realised my previous parser was making a mistake in this respect.

As far as I can tell, positive indices refer to exports (i.e. assets in the same file.) After parsing a few files using this method, particularly with entity location maps, it seemed to confirm that this was the case. It also explains how different exports are related to each other.

I've always tried to make sure that the data that the parser outputs is as representative of the underlying asset as possible, so the parser will output an array when it comes across a valid import, with each item in the array referring to the object_name of the import tree (where one import refers to another.) This has ended up meaning that you're able to get the full file path from an FPackageIndex when relevant.

@QuentinBellus
Copy link
Author

Very interesting, thank you for the detailed answer. I will run more tests on my side.

@QuentinBellus
Copy link
Author

QuentinBellus commented Feb 12, 2020

Not only your answer solved an issue I had with the value being strange (=wrong), but I can also know which specific export is the target and create links.
I'm specifically testing on /Game/Athena/Sounds/Emotes/Athena_Emote_Intensity_Music_Cue at the moment (Fortnite). The ChildNodes of SoundNodeDelay and SoundNodeMixer were referencing some other nodes by name (e.g. SoundNodeWavePlayer), but having the exact index to target in the export list is the perfect solution as names sometimes have duplicates.

Thank you again for your help, you can close this issue.

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

2 participants