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

Preprocessor "pipeline" #48

Open
Noggog opened this issue May 3, 2024 · 37 comments
Open

Preprocessor "pipeline" #48

Noggog opened this issue May 3, 2024 · 37 comments

Comments

@Noggog
Copy link
Member

Noggog commented May 3, 2024

For example, CK randomizes script properties. Some people might want that ordered, and so a preprocessor cmd could be added that did the job before flowing into the spriggit call.

Would be nice to have this in the UI somehow to where it could run these for the user as part of the single click

@Noggog Noggog modified the milestone: Initial Release May 3, 2024
@Noggog
Copy link
Member Author

Noggog commented Aug 23, 2024

Not yet, but I'll see if i can whip up something soon

@Noggog
Copy link
Member Author

Noggog commented Aug 24, 2024

Alright, did some work on a property sorter in 2c2548f

Still need to finish the "pipeline" itself

@Noggog Noggog added this to the Initial Release milestone Aug 24, 2024
@Noggog
Copy link
Member Author

Noggog commented Aug 24, 2024

Is there an example on how to use it?

I'll have to push a new version of spriggit for it to hit, but it would be something like:
.\Spriggit-CLI.exe sort-script-properties -i "Path/To/Mod.esp" -o "Temp/Path/To/Mod.esp" -g SkyrimSE
Where it would output the sorted mod to the temp path, which you could then pass to the serialize command as a followup

the 2nd half of the ticket mentions a nicety to have this in the GUI, and it seems much more complicated

Yeah, the pipeline would be a convenience feature for the UI to abstract away running all the commands one by one like you would in a bash script or whatever

Why not just emplace them into a sorted set or something? That way when they're deserialized, they will be alphabetized

Spriggit serializes into/from the Mutagen record definitions, which try to allow a 1:1 representation of what's in the binary file. If the mutagen definitions were to be a Set, then it would be impossible for it to represent some binary files that had duplicate names, and be impossible to represent a file that was in an odd order. These definitions are used for a lot more than just Spriggit, so they need the ability/power to have that granularity.

So the idea of there being a sorted set is something we need to add on top of the more "raw" definitions. Lots of approaches, but the cleanest imo is to just process the raw files to be how spriggit would prefer them. Making a whole 2nd wrapper of new definitions, /w just one field being a set instead of a list seems unnecessary. There's gonna be a lot of small tweaks spriggit users will want, so just toss it on the pile of something to process before doing a seriaization

@Noggog
Copy link
Member Author

Noggog commented Aug 28, 2024

@gir489returns sorry about that! Pull dev and try again

@Noggog
Copy link
Member Author

Noggog commented Aug 28, 2024

It wants a "normal" mod name that can be parsed into a ModKey. Eg XYZ.esp. Add a .esp to your output path

@Noggog
Copy link
Member Author

Noggog commented Aug 28, 2024

it's sorting it and then I desearlize the sorted ESP?

yeah, the idea is you have an unsorted esp, you run this to get a sorted one, and serialize that instead


Ah, i can probably improve the logic to be less picky for the next version, but for now, let's do this:
-o D:\Backup\Stuff\Starfield\mods\Cheat Terminal\Sorted\CheatTerminal.esp
Where Sorted is a folder now, and the name of the mod remains the same

@Noggog
Copy link
Member Author

Noggog commented Aug 28, 2024

Aight, pull dev and try again:

  • Uncompresses (for now, will be adding compression support soon)
  • Less picky on output mod name

@Noggog
Copy link
Member Author

Noggog commented Aug 28, 2024

Cool! I'll be working to get this more integrated overall, but hopefully that keeps you going in the meantime

@Noggog
Copy link
Member Author

Noggog commented Aug 28, 2024

Are these within the VirtualMachineAdapter of the terminal menu?
Edit: Maybe reproduced, give me a few

@Noggog
Copy link
Member Author

Noggog commented Aug 28, 2024

Didn't reproduce. Red herring.

Here's a unit test flexing the sort of Terminal Menu in starfield:
efb70b1#diff-c4956256eb7a305e70915a92051ac80b6bb4e1f5aacc43e9af84263b0e58e87fR107


Is it perhaps something else at play?
The left side doesn't look sorted (Weapon should be after Outpost), so it makes sense that a sort pass would change it from there? Maybe the test battery got crossed somehow. I'd maybe try again and see if it keeps failing to sort?

@Noggog
Copy link
Member Author

Noggog commented Sep 2, 2024

If I sort the ESP, it claims those same Objects now circularly belong to my mod (CheatTerminal.ESP).

What command are you running for the sort CLI? Are you including the DataFolder parameter? That'll be required for Starfield (almost for every command nowadays, until #81 is done)

If omitted, the formID indices can be scrambled (One of starfield's major design flaws)

@Noggog
Copy link
Member Author

Noggog commented Sep 2, 2024

alright, add -d "Path/To/Data/Folder" and see if it does better. I'll adjust the script to scream a bit more if missing for starfield

@Noggog
Copy link
Member Author

Noggog commented Sep 2, 2024

Yeah, UI needs a repass before 1.0 #85

The CLI and/or logs will give the detail you're hoping for, at the moment. Can you upload Current.log with the failure included?

@Noggog
Copy link
Member Author

Noggog commented Sep 2, 2024

Opening Spriggit v0.26.0+a3c9c97e9

Let's grab the 0.27 versions of the CLI/UI and give it another spin

@Noggog
Copy link
Member Author

Noggog commented Sep 2, 2024

Can you upload your latest CheatTerminal.esp for me to look at? I've only got the one /w Starfield.esm as a master

@Noggog
Copy link
Member Author

Noggog commented Sep 2, 2024

Alright, pushed a fix to the sort CLI on dev branch. Was missing a parameter pass, so the data folder wasn't getting considered in one of the steps

@Noggog
Copy link
Member Author

Noggog commented Sep 3, 2024

Cool. Yeah, i think we just need to get in the weeds on the details.. as the sorting code is hand crafted, so could be areas that I missed.

I think i got the fragments that you were showing in your previous pictures. Grab the latest cli from dev and give it another spin. Let me know if there's any more to look at

@Noggog
Copy link
Member Author

Noggog commented Sep 3, 2024

Thanks for the back and forth!

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
@Noggog and others