NicknineTheEagle / Frostbite-Scripts

Python scripts for extracting Frostbite Engine assets
Other
87 stars 14 forks source link

Added path input and -validation #14

Closed manavortex closed 3 years ago

manavortex commented 4 years ago

Added getpath.py: File contains a few helper methods in case directories aren't set. Directory entries can still be hardcoded in source files. Hardcoded entry as well as user input will be validated.

Added exception handling: Any raised exception within the script's scope will output an error message to console, rather than crashing the entire loop. I found it rather annoying when my dump blew up a few hours in.

NicknineTheEagle commented 4 years ago

Skipping the bundle in the dumper script and continuing on is a bad idea since if you got an error there that means something is really wrong and most if not all other bundles will also fail. You're also not printing the exceptions themselves anywhere so the output will not be very informative.

manavortex commented 4 years ago

Ah - the reason why I ran into exception was that the script tried to parse .ascii-files and then failed with "it's not an ebx". I wasn't certain where to add file ending verification. :D

NicknineTheEagle commented 4 years ago

Why do you have extra files in ebx dir? Also, wouldn't it be better to add extension check instead then?

manavortex commented 4 years ago

I did nothing to the directory content that wasn't in the scripts, so - I have no idea how they ended up there.

It would be better, but I wasn't sure where to add it. Pretty sure you know the best spot from the top of your head, would you mind? :)

Besides, the dump for me was a rather lengthy process. Perhaps it would be better to log exceptions in a well-defined way? I'm not that fluent in Python (yet), it might show.

NicknineTheEagle commented 4 years ago

Then where did those .ascii files come from? Maybe you were using some editor program that generated them as temp or config files?

manavortex commented 4 years ago

I'm not sure, I can start over from scratch and see if they pop up again? Anyway, file extension checking would be a lot better than the entire program aborting. I imagine users might be scared by that?

NicknineTheEagle commented 4 years ago

It wouldn't hurt either way, in retrospect, we can't 100% expect ebx dir to not contain any excess files. Could you rework your PR to only contain user input for directories (use force push)? I'll take care of EBX issue myself. Also, you got a bunch of trailing spaces all over the place, please, fix.

manavortex commented 4 years ago

Oh - of course, I'll check that. Wrote them on windows, I'm just glad that's the worst of the issues. :D

Give me an hour-ish.

NicknineTheEagle commented 4 years ago

You have also only made your changes to frostbite3, don't forget about frostbite2.

manavortex commented 4 years ago

Will do. :) If I understood correctly, there won't be any more fb2-games, right? In that case, could we build a list and somehow auto-check the installation?

NicknineTheEagle commented 4 years ago

In that case, could we build a list and somehow auto-check the installation?

I'm not sure if that's possible. Regardless, FB2 and FB3 are way too different from each other so they have to be kept separate

manavortex commented 4 years ago

If it's complex, let's not. I just thought there was a finite number of possibilities and/or maybe a single file in the root directory or something about the root dir's structure that could be used as flag.

Would it be possible to somehow remember successfully dumped files, so that if I run into an exception at some point I don't have to start over completely? See my comment above.

manavortex commented 4 years ago

Sorry for opening all the cans of worms. I just ran into all these issues and would like to resolve them for good instead of locally hacking around in my scripts, the next user who'll try won't be a programmer and be lost. :)

NicknineTheEagle commented 3 years ago

IMHO, it's better to pass paths using arguments, this allows for potential automation using batch scripts. Also, EBX scripts could use the ability to convert individual files but that would require some logic to detect ebx root.