A
A
Andrey Grinevich2021-08-06 12:11:32
Python
Andrey Grinevich, 2021-08-06 12:11:32

How to correctly and optimally unpack Paradox Script and pack it back?

Good afternoon.
I have been playing `Stellaris` for a long time and sometimes I want to edit save files, add some flags or something else.
How to do it with your hands and with the help of buttons has long been described, for example https://www.reddit.com/r/Stellaris/comments/acvec8...
I want to make a simple web face and use `json-patch` to edit it's from the UI without having to mess around with archives and peculiar syntax.

Essence of the question:
How to unpack and pack (ideally in json) such syntax using python optimally?
Found a bunch of solutions with regular expressions and payparse https://github.com/Shadark/ClauseWizard/blob/maste...(on reddit they write that the script works for several minutes (!)) or `tokenize` but they all do not know how to pack back.

format example
https://gist.github.com/Derfirm/e6e06dea233b5ef8b9...

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question