CensoredUsername / unrpyc

A ren'py script decompiler
Other
821 stars 149 forks source link

Failed decompile script 'options.rpyс' from renpy 6.11.2 #209

Closed KennedyMcMillan closed 3 months ago

KennedyMcMillan commented 3 months ago

When trying to decompile options.rpyc from visual novel "[text] A Summer Story" (http://www.sakevisual.com/summerstory.html) I get the following error:

~/Desktop/Ren'Py_SDK's/unrpyc_renpy_6-7 python2 unrpyc.py options.rpyc Decompiling options.rpyc to options.rpy... Error while decompiling options.rpyc: Traceback (most recent call last): File "unrpyc.py", line 272, in worker try_harder=args.try_harder, sl_custom_names=args.sl_custom_names) File "unrpyc.py", line 211, in decompile_rpyc decompiler.pprint(out_file, ast, options) File "/home/christopher/Desktop/Ren'Py_SDK's/unrpyc_renpy_6-7/decompiler/init.py", line 59, in pprint Decompiler(out_file, options).dump(ast) File "/home/christopher/Desktop/Ren'Py_SDK's/unrpyc_renpy_6-7/decompiler/init.py", line 123, in dump super(Decompiler, self).dump(ast, skip_indent_until_write=True) File "/home/christopher/Desktop/Ren'Py_SDK's/unrpyc_renpy_6-7/decompiler/util.py", line 50, in dump self.print_nodes(ast) File "/home/christopher/Desktop/Ren'Py_SDK's/unrpyc_renpy_6-7/decompiler/util.py", line 141, in print_nodes self.print_node(node) File "/home/christopher/Desktop/Ren'Py_SDK's/unrpyc_renpy_6-7/decompiler/init.py", line 136, in print_node self.dispatch.get(type(ast), type(self).print_unknown)(self, ast) File "/home/christopher/Desktop/Ren'Py_SDK's/unrpyc_renpy_6-7/decompiler/init.py", line 513, in print_init self.print_nodes(ast.block) File "/home/christopher/Desktop/Ren'Py_SDK's/unrpyc_renpy_6-7/decompiler/util.py", line 141, in print_nodes self.print_node(node) File "/home/christopher/Desktop/Ren'Py_SDK's/unrpyc_renpy_6-7/decompiler/init.py", line 136, in print_node self.dispatch.get(type(ast), type(self).print_unknown)(self, ast) File "/home/christopher/Desktop/Ren'Py_SDK's/unrpyc_renpy_6-7/decompiler/init.py", line 836, in print_screen self.indent_level, self.linenumber, self.skip_indent_until_write File "/home/christopher/Desktop/Ren'Py_SDK's/unrpyc_renpy_6-7/decompiler/screendecompiler.py", line 37, in pprint ast, indent_level, linenumber, skip_indent_until_write) File "/home/christopher/Desktop/Ren'Py_SDK's/unrpyc_renpy_6-7/decompiler/screendecompiler.py", line 59, in dump self.print_screen(ast) File "/home/christopher/Desktop/Ren'Py_SDK's/unrpyc_renpy_6-7/decompiler/screendecompiler.py", line 112, in print_screen value = getattr(ast, key) AttributeError: 'ScreenLangScreen' object has no attribute 'variant'

Is there any way to fix this? Thank you in advance!

madeddy commented 3 months ago

Hey.

KennedyMcMillan commented 3 months ago

Hey.

* _Please_ try and format the error cite up there so it's readable.

* Which unrpyc version did you use? For such a old game, it could be required to apply a way older unrpyc as v1.2.0

I'm used "legacy (ren'py 6/7)" branch from repo. I've formatted the error text for easy reading

madeddy commented 3 months ago

I've formatted the error text for easy reading

Cool, thanks!

I'm used "legacy (ren'py 6/7)" branch from repo.

Thats v1.3.0 and could be a bit too "modern". ~Try with v1.0.15~ Edit: No, this version does also not work. v0.4 also not. Could be a so far unknown bug... Lets wait what @CensoredUsername says as he knows the code way better.

KennedyMcMillan commented 3 months ago

I've formatted the error text for easy reading

Cool, thanks!

I'm used "legacy (ren'py 6/7)" branch from repo.

Thats v1.3.0 and could be a bit too "modern". Try with v1.0.15

Unfortunately it doesn't work, i get the same error:

~/Desktop/Ren'Py_SDK's/unrpyc-legacy(2019): python2 unrpyc.py options.rpyc Decompiling options.rpyc to options.rpy... Error while decompiling options.rpyc: Traceback (most recent call last): File "unrpyc.py", line 146, in worker no_pyexpr=args.no_pyexpr, comparable=args.comparable, translator=translator, init_offset=args.init_offset) File "unrpyc.py", line 119, in decompile_rpyc translator=translator, init_offset=init_offset) File "/home/christopher/Desktop/Ren'Py_SDK's/unrpyc-legacy(2019)/decompiler/init.py", line 46, in pprint decompile_python=decompile_python, translator=translator).dump(ast, indent_level, init_offset) File "/home/christopher/Desktop/Ren'Py_SDK's/unrpyc-legacy(2019)/decompiler/init.py", line 89, in dump super(Decompiler, self).dump(ast, indent_level, skip_indent_until_write=True) File "/home/christopher/Desktop/Ren'Py_SDK's/unrpyc-legacy(2019)/decompiler/util.py", line 29, in dump self.print_nodes(ast) File "/home/christopher/Desktop/Ren'Py_SDK's/unrpyc-legacy(2019)/decompiler/util.py", line 120, in print_nodes self.print_node(node) File "/home/christopher/Desktop/Ren'Py_SDK's/unrpyc-legacy(2019)/decompiler/init.py", line 106, in print_node self.dispatch.get(type(ast), type(self).print_unknown)(self, ast) File "/home/christopher/Desktop/Ren'Py_SDK's/unrpyc-legacy(2019)/decompiler/init.py", line 590, in print_init self.print_nodes(ast.block) File "/home/christopher/Desktop/Ren'Py_SDK's/unrpyc-legacy(2019)/decompiler/util.py", line 120, in print_nodes self.print_node(node) File "/home/christopher/Desktop/Ren'Py_SDK's/unrpyc-legacy(2019)/decompiler/init.py", line 106, in print_node self.dispatch.get(type(ast), type(self).print_unknown)(self, ast) File "/home/christopher/Desktop/Ren'Py_SDK's/unrpyc-legacy(2019)/decompiler/init.py", line 841, in print_screen self.printlock) File "/home/christopher/Desktop/Ren'Py_SDK's/unrpyc-legacy(2019)/decompiler/screendecompiler.py", line 39, in pprint ast, indent_level, linenumber, skip_indent_until_write) File "/home/christopher/Desktop/Ren'Py_SDK's/unrpyc-legacy(2019)/decompiler/screendecompiler.py", line 63, in dump self.print_screen(ast) File "/home/christopher/Desktop/Ren'Py_SDK's/unrpyc-legacy(2019)/decompiler/screendecompiler.py", line 116, in print_screen value = getattr(ast, key) AttributeError: 'ScreenLangScreen' object has no attribute 'variant'

KennedyMcMillan commented 3 months ago

Lets wait what @CensoredUsername says as he knows the code way better.

Thanks!

CensoredUsername commented 3 months ago

@madeddy legacy should support every ren'py 6, there should be no reason to use an older version.

@KennedyMcMillan Seems you hit a previously unknown issue that only affects 6.11! Screen language was originally introduced in 6.11, and the property that the code is expecting to find was introduced in 6.12. Should be a reasonably easy fix, I'll let you know when it's done.

KennedyMcMillan commented 3 months ago

@madeddy legacy should support every ren'py 6, there should be no reason to use an older version.

@KennedyMcMillan Seems you hit a previously unknown issue that only affects 6.11! Screen language was originally introduced in 6.11, and the property that the code is expecting to find was introduced in 6.12. Should be a reasonably easy fix, I'll let you know when it's done.

Thank you very much!

madeddy commented 3 months ago

@madeddy legacy should support every ren'py 6, there should be no reason to use an older version.

Ah, ok. Didn't know it reaches this far back. Anyway a interesting find after so much time, huh.

CensoredUsername commented 3 months ago

@KennedyMcMillan the fix should be out, could you confirm it works?

KennedyMcMillan commented 3 months ago

@KennedyMcMillan the fix should be out, could you confirm it works?

Yes, the file decompiles successfully. Thank you very much!

CensoredUsername commented 3 months ago

Perfect.