Tool Ren'Py UnRenGUI, UnRen-forall(v9.4), UnRen-Powershell-forall(v9.4), UnRen-old

5.00 star(s) 3 Votes

Madeddy

Active Member
Dec 17, 2017
962
668
Ok. I figured out whats wrong with the bugs in my last bulled point:
The error roots in sl2decompiler.py in the class SLUse and is related to the move of PyExpr from module ast to astsupport. We import there just the old style PyExpr, but the new one appears there now also and it uses (logically) the wrong code for such appearances, because unrpyc supports it so far not.

So, just a bit more work needed to figure out how to deal with both variants. Yeah, soooooooo fun! </sarcasm-node=off> :oops:

Ok, i think/hope i got it. Three of the games above, including STS, decompiling with this clean and run also fine! All new fixes are in here: Take a look, test, report if you like. Have fun folks! :coffee:
 
Last edited:

kwazimoda

Newbie
Aug 5, 2018
61
47
Three of the games above, including STS, decompiling with this clean and run also fine! All new fixes are in here: Take a look, test, report if you like. Have fun folks! :coffee:
Thanks for the great work, BUT... it unpacks without errors, but there is one nuance: for some reason, it doesn't work correctly with the menus. Here's an example of what it should be and what it is. The selection conditions are lost. STS (game\src\plot\judith.rpyc) 1754335212124.png
 
Last edited:

Madeddy

Active Member
Dec 17, 2017
962
668
Right. I have this errors here also in my files. Thanks for bringing it to attention kwazimoda.
Something, somewhere is still skipped for some reason. Well shit. smiley_angry_sign.gif You all know the saying about "finding the needle in a haystack", right? The problem with this error is: I don't even know what our needle is or how it looks.

Edit: Found the needle, fixed. Was way easier then thought. Updated the PR on Github. (see post 1521)
 
Last edited:

mazinogamer

Member
Dec 2, 2022
140
575
Right. I have this here also in my files. Thanks for bringing it to attention kwazimoda.
Something, somewhere is still skipped for some reason. Well shit. View attachment 5111854 You all know the saying about "finding the needle in a haystack", right? The problem with this error is: I don't even know what our needle is or how it looks.

Edit: Found the needle, fixed. Updated the PR on GH. (see post 1521)
Thanks, it worked well for me. (y)
 

kwazimoda

Newbie
Aug 5, 2018
61
47
Right. I have this here also in my files. Thanks for bringing it to attention kwazimoda.
Something, somewhere is still skipped for some reason. Well shit. View attachment 5111854 You all know the saying about "finding the needle in a haystack", right? The problem with this error is: I don't even know what our needle is or how it looks.

Edit: Found the needle, fixed. Updated the PR on GH. (see post 1521)
Download from GH - all work! Thanks.
 
  • Like
Reactions: Madeddy

kwazimoda

Newbie
Aug 5, 2018
61
47
Right. I have this errors here also in my files. Thanks for bringing it to attention kwazimoda.
Something, somewhere is still skipped for some reason. Well shit. View attachment 5111854 You all know the saying about "finding the needle in a haystack", right? The problem with this error is: I don't even know what our needle is or how it looks.

Edit: Found the needle, fixed. Was way easier then thought. Updated the PR on Github. (see post 1521)
After decompiling the game High Scool Days, this error appears when launch the game. The decompiler report shows that it was decompiled correctly.
1754435992591.png
1754436333845.png
 

Madeddy

Active Member
Dec 17, 2017
962
668
After decompiling the game High Scool Days, this error appears when launch the game.
That's the one game v8.4+ i did not test with, as the DL is a bit big just for testing and i had others.

This game makes use of a code variant(init python) which the others don't have in this form, so it errors only (so far) in this one. Another error from the PyExpr/PyCode rework.

Another user fixed it already nicely in his on GH. I will did add this fix later to my PR, so interested people have all necessary fixes there in one go. This will surely not the last hiccup from some undiscovered Ren'Py code change.
 
Last edited:

Madeddy

Active Member
Dec 17, 2017
962
668
Here’s another one
This is the log
Thanks. Confirmed. Its a new class in the Lexer i noticed already 6 months back as they added it and i remember wanted to ask on GH about it. Now we know, i forgot about it till now. :giggle:

OK, just so people don't double report it i show the related errors in short:

>> First its this error:
Code:
Failed at decompiling G:\project\TWR_V0.1.5_un\game\scripts\layered_images1.rpyc
Traceback (most recent call last):
  File "<string>", line 15, in decompile_game
  File "<string>", line 7, in decompile_rpyc
  File "<string>", line 2, in read_ast_from_file
  File "<string>", line 129, in pickle_safe_loads
  File "<string>", line 152, in safe_loads
  File "lib/python3.12/pickle.py", line 1256, in load
  File "lib/python3.12/pickle.py", line 1557, in load_newobj
  File "<string>", line 26, in __new__
decompiler.magic.FakeUnpicklingError: <class 'renpy.lexer.GroupedLine'> was instantiated with unexpected arguments ('game/scripts/layered_images1.rpy', 12, 8, '"base_body_gwen_1"', []), {}
>> And after you add the code for it we get another bug because we forgot some code:
Code:
Decompiling /home/olli/.xlib/_test/TwistedWorld-0.1.5-pc/game/scripts/layered_images2.rpyc to layered_images2.rpy ...
Error while decompiling /home/olli/.xlib/_test/TwistedWorld-0.1.5-pc/game/scripts/layered_images2.rpyc:
Traceback (most recent call last):
File "/home/olli/Code/Git/unrpyc/unrpyc.py", line 246, in worker_common
decompile_rpyc(
File "/home/olli/Code/Git/unrpyc/unrpyc.py", line 199, in decompile_rpyc
decompiler.pprint(out_file, ast, options)
File "/home/olli/Code/Git/unrpyc/decompiler/__init__.py", line 52, in pprint
Decompiler(out_file, options).dump(ast)
File "/home/olli/Code/Git/unrpyc/decompiler/__init__.py", line 109, in dump
super(Decompiler, self).dump(ast, skip_indent_until_write=True)
File "/home/olli/Code/Git/unrpyc/decompiler/util.py", line 70, in dump
self.print_nodes(ast)
File "/home/olli/Code/Git/unrpyc/decompiler/util.py", line 171, in print_nodes
self.print_node(node)
File "/home/olli/Code/Git/unrpyc/decompiler/__init__.py", line 125, in print_node
self.dispatch.get(type(ast), type(self).print_unknown)(self, ast)
File "/home/olli/Code/Git/unrpyc/decompiler/__init__.py", line 509, in print_init
self.print_nodes(ast.block)
File "/home/olli/Code/Git/unrpyc/decompiler/util.py", line 171, in print_nodes
self.print_node(node)
File "/home/olli/Code/Git/unrpyc/decompiler/__init__.py", line 125, in print_node
self.dispatch.get(type(ast), type(self).print_unknown)(self, ast)
File "/home/olli/Code/Git/unrpyc/decompiler/__init__.py", line 751, in print_userstatement
self.print_lex(ast.block)
File "/home/olli/Code/Git/unrpyc/decompiler/__init__.py", line 759, in print_lex
for file, linenumber, content, block in lex:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: too many values to unpack (expected 4)
valery-iwanofu (Github) solved this already as the previous error with the "init bug" and i will add it to my fork/PR for completeness. Thanks to him!

----
Just so you folks understand why i not simply point you to the other PR on GH:
  • There are other code improvements and additions in there where i solong not know for what they are.
  • Some error fixes i made are missing in his.
So you see, i complete my step by step as the errors from you rolling in. Or the unrpyc dev finds some time to catch up on the project. What ever happens first...

Greets
 

Tacito

Forum Fanatic
Jul 15, 2017
5,876
52,283
Thanks. Confirmed. Its a new class in the Lexer i noticed already 6 months back as they added it and i remember wanted to ask on GH about it. Now we know, i forgot about it till now. :giggle:

OK, just so people don't double report it i show the related errors in short:

>> First its this error:
Code:
Failed at decompiling G:\project\TWR_V0.1.5_un\game\scripts\layered_images1.rpyc
Traceback (most recent call last):
  File "<string>", line 15, in decompile_game
  File "<string>", line 7, in decompile_rpyc
  File "<string>", line 2, in read_ast_from_file
  File "<string>", line 129, in pickle_safe_loads
  File "<string>", line 152, in safe_loads
  File "lib/python3.12/pickle.py", line 1256, in load
  File "lib/python3.12/pickle.py", line 1557, in load_newobj
  File "<string>", line 26, in __new__
decompiler.magic.FakeUnpicklingError: <class 'renpy.lexer.GroupedLine'> was instantiated with unexpected arguments ('game/scripts/layered_images1.rpy', 12, 8, '"base_body_gwen_1"', []), {}
It's Ok , Thanks :)
 
  • Heart
Reactions: Madeddy

Nighthawk604

New Member
Game Developer
Oct 14, 2020
9
7
I had re-install windoze 11 but since then the oiwershell version of unren won't work

rpatool.py:128: SyntaxWarning: invalid escape sequence '\{'
os.remove("{0}\{1}".format(directory, archive))
Traceback (most recent call last):
File "rpatool.py", line 11, in <module>
import renpy.config
File "renpy/config.py", line 1056, in <module>
AttributeError: module 'renpy' has no attribute 'error'

Creating unrpyc...
Traceback (most recent call last):
File "unrpyc.py", line 66, in <module>
import decompiler
File "decompiler\__init__.py", line 35, in <module>
store = magic.fake_package("store")
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "decompiler\magic.py", line 637, in fake_package
return __import__(name)
^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'store'

Has anyone seen this problem?

Its never done this before.. (I'm wracking my brain thinking what am I forgetting)
 

joelurmel

Engaged Member
Nov 3, 2022
2,387
4,211
I had re-install windoze 11 but since then the oiwershell version of unren won't work

rpatool.py:128: SyntaxWarning: invalid escape sequence '\{'
os.remove("{0}\{1}".format(directory, archive))
Traceback (most recent call last):
File "rpatool.py", line 11, in <module>
import renpy.config
File "renpy/config.py", line 1056, in <module>
AttributeError: module 'renpy' has no attribute 'error'

Creating unrpyc...
Traceback (most recent call last):
File "unrpyc.py", line 66, in <module>
import decompiler
File "decompiler\__init__.py", line 35, in <module>
store = magic.fake_package("store")
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "decompiler\magic.py", line 637, in fake_package
return __import__(name)
^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'store'

Has anyone seen this problem?

Its never done this before.. (I'm wracking my brain thinking what am I forgetting)
The PowerShell version of this script is no more up to date with Ren'Py 8.4.*
 

joelurmel

Engaged Member
Nov 3, 2022
2,387
4,211
It's time for me to share my modified UnRen-forall.bat with you :)

What's changed:
Added latest rpatool version 0.8 which supports RPA v3 deobsfuscation (not implemented for now).
(used only if Python >= 3.8, otherwise use the old one).

Replaced the old unrpyc with the latest versions of , version 1.3.2 for Ren'Py <= 7 and version 2.0.2 for Ren'Py V8.
Fixed the bug that prevented UnRen-forall from being used if there was a space in the tree structure (as in MyBimbo Beta).
Improved control of the Python version that accompanies the game, to avoid choosing the wrong one as in Milfania.
All commands are now checked for correct execution.
RPA files moved to the game/rpa directory, if you choose not to delete them. This is to avoid the duplicate labels problem when the archive has been poorly constructed.
Introduction of the option not to rewrite RPY files if already present.
Added a timer of 5 sec on Y/N questions with default at N for RPA and RPY. After choosing option from the menu, the script takes care of itself.
Use of a more explicit color coding. Green for goods, yellow for logos and warnings and red for errors.
A UnRen-forall.log file is now created in the game directory for more details.
I've also integrated right-click registry add/remove (Admin right required).
The script is now 9.6.39. 39 being the number of changes made to the script.
If you have any problems, please let me know using the UnRen-forall.log file, and I'll make the corrections.

Apparently, the temporary fix for decompiling Ren'Py 8.4 prevents Ren'Py 7 files from being decompiled.
So, while waiting for the final version, use version 9.6.42 for Ren'Py 7.


You don't have permission to view the spoiler content. Log in or register now.
Updated to 9.6.50

Checked
with Ren'Py 8.4.*:
AfterClass-Patreon-v0.12.51p-a01-pc
AwkwardAweakenings-0.20.05-pc
HighSchoolDays-0.23-pc
LoggedOut-0.01PreAlpha-win
summertimesaga-21.0.0-wip.6155-pc
TwistedWorld-0.1.5-pc

with Ren'Py 8.2.*:
hearts_of_the_city2-1.0-pc

With Ren'Py 7.4.*:
Apocalust0.09-0.09-pc

Decompiled without error and game start, still have some cosmetic differences with the original rpy when provided.

IMPORTANT:
For translators who don't understand why certain phrases aren't translated if the scripts are in an rpa archive when it's translated when it's out.
This is because unrpyc is strict about spaces, and if, for example, the developer wrote:

MC“Hello Mom”

unrpyc will rewrite it as

MC “Hello Mom”

I found another error that does not affect the game's functionality, but does affect the translations!
If the second menu entry is followed by a blank line:

mc "No need to apologize. Family is important."
"Make a joke to lighten the mood":

mc "Well, at least you're prepared for any medical emergencies in the neighborhood now."

unrpyc rewrote it by moving the blank line before the menu entry

mc "No need to apologize. Family is important."

"Make a joke to lighten the mood":
mc "Well, at least you're prepared for any medical emergencies in the neighborhood now."

Maybe Madeddy can find a solution, because I haven't been able to.
 
Last edited:

"CJ"LongDong

Conversation Conqueror
Mar 6, 2021
6,730
71,494
No problemo. Test it and have fun. I don't use them myself so no idea if its correct.

INFO: Attached is a possible unstable dev version of the injector, a bit ahead of unrpyc v2.0.2 to support Ren'Py v8.4+ games.
Thanks. Confirmed. Its a new class in the Lexer i noticed already 6 months back as they added it and i remember wanted to ask on GH about it. Now we know, i forgot about it till now. :giggle:

valery-iwanofu (Github) solved this already as the previous error with the "init bug" and i will add it to my fork/PR for completeness. Thanks to him!

----
Just so you folks understand why i not simply point you to the other PR on GH:
  • There are other code improvements and additions in there where i solong not know for what they are.
  • Some error fixes i made are missing in his.
So you see, i complete my step by step as the errors from you rolling in. Or the unrpyc dev finds some time to catch up on the project. What ever happens first...

Greets
Madeddy pls update the injectors to the latest version of your GH fork/RP. I'd highly appreciate it!

Could you add these injectors to your GH fork/RP, perhaps in the comments? Then I wouldn't have to ask you here every time you update your fork/RP, as I don't want to bother you.
 

Madeddy

Active Member
Dec 17, 2017
962
668
If the second menu entry is followed by a blank line:

....

unrpyc rewrote it by moving the blank line before the menu entry
Could be multiple reasons. Linenumbers counting and tracking etc. is a finicky thing. There is also a antique issue on GH about problems with the monologue mode - still unresolved. EDIT: After reading through this again, it seems to me this could be such a case: See and the ".

I think you should make on GH a new issue about this thing.
 
Last edited:
5.00 star(s) 3 Votes