CensoredUsername / unrpyc

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

Camera statement possibly broken in dev #184

Closed madeddy closed 4 months ago

madeddy commented 4 months ago

Tested with the AOSC. Question is if the source again the modified engine is.

olli@tty2*blue $ python2 unrpyc.py -c /home/olli/.xlib/RPG/_test/AttackOnSurveyCorps-0-16-0-pc/game/
...
Error while decompiling /home/olli/.xlib/RPG/_test/AttackOnSurveyCorps-0-16-0-pc/game/scenario/chapter1/dining_room.rpyc:
Traceback (most recent call last):
File "/home/olli/Code/Git/unrpyc/unrpyc.py", line 260, in worker
return decompile_rpyc(filename, args.clobber, args.dump, no_pyexpr=args.no_pyexpr,
File "/home/olli/Code/Git/unrpyc/unrpyc.py", line 202, in decompile_rpyc
decompiler.pprint(out_file, ast, options)
File "/home/olli/Code/Git/unrpyc/decompiler/__init__.py", line 54, 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 49, in dump
self.print_nodes(ast)
File "/home/olli/Code/Git/unrpyc/decompiler/util.py", line 140, in print_nodes
self.print_node(node)
File "/home/olli/Code/Git/unrpyc/decompiler/__init__.py", line 122, in print_node
self.dispatch.get(type(ast), type(self).print_unknown)(self, ast)
File "/home/olli/Code/Git/unrpyc/decompiler/__init__.py", line 330, in print_label
self.print_nodes(ast.block, 1)
File "/home/olli/Code/Git/unrpyc/decompiler/util.py", line 140, in print_nodes
self.print_node(node)
File "/home/olli/Code/Git/unrpyc/decompiler/__init__.py", line 122, in print_node
self.dispatch.get(type(ast), type(self).print_unknown)(self, ast)
File "/home/olli/Code/Git/unrpyc/decompiler/__init__.py", line 397, in print_if
self.print_nodes(block, 1)
File "/home/olli/Code/Git/unrpyc/decompiler/util.py", line 140, in print_nodes
self.print_node(node)
File "/home/olli/Code/Git/unrpyc/decompiler/__init__.py", line 122, in print_node
self.dispatch.get(type(ast), type(self).print_unknown)(self, ast)
File "/home/olli/Code/Git/unrpyc/decompiler/__init__.py", line 397, in print_if
self.print_nodes(block, 1)
File "/home/olli/Code/Git/unrpyc/decompiler/util.py", line 140, in print_nodes
self.print_node(node)
File "/home/olli/Code/Git/unrpyc/decompiler/__init__.py", line 122, in print_node
self.dispatch.get(type(ast), type(self).print_unknown)(self, ast)
File "/home/olli/Code/Git/unrpyc/decompiler/__init__.py", line 288, in print_camera
self.write(" %s" % ast.name)
TypeError: not all arguments converted during string formatting
...
Decompilation of 1002 files successful, but decompilation of 13 files failed

Btw.: The game needs because of a manipulated header position = 10 + 5 in _read_ast_fromfile()

AOSC_dining_room.zip

madeddy commented 4 months ago

Reopening as its also with py3 now. Tested with the "OurBrightDays-0.1.3".

Decompiling /home/olli/.xlib/RPG/_test/OurBrightDays-0.1.3-pc/game/scripts/tags/atl.rpyc to /home/olli/.xlib/RPG/_test/OurBrightDays-0.1.3-pc/game/scripts/tags/atl.rpy...
Error while decompiling /home/olli/.xlib/RPG/_test/OurBrightDays-0.1.3-pc/game/script.rpyc:
Traceback (most recent call last):
File "/home/olli/Code/Git/unrpyc/unrpyc.py", line 260, in worker
return decompile_rpyc(filename, args.clobber, args.dump, no_pyexpr=args.no_pyexpr,
File "/home/olli/Code/Git/unrpyc/unrpyc.py", line 202, in decompile_rpyc
decompiler.pprint(out_file, ast, options)
File "/home/olli/Code/Git/unrpyc/decompiler/__init__.py", line 54, 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 49, in dump
self.print_nodes(ast)
File "/home/olli/Code/Git/unrpyc/decompiler/util.py", line 140, in print_nodes
self.print_node(node)
File "/home/olli/Code/Git/unrpyc/decompiler/__init__.py", line 122, in print_node
self.dispatch.get(type(ast), type(self).print_unknown)(self, ast)
File "/home/olli/Code/Git/unrpyc/decompiler/__init__.py", line 330, in print_label
self.print_nodes(ast.block, 1)
File "/home/olli/Code/Git/unrpyc/decompiler/util.py", line 140, in print_nodes
self.print_node(node)
File "/home/olli/Code/Git/unrpyc/decompiler/__init__.py", line 122, in print_node
self.dispatch.get(type(ast), type(self).print_unknown)(self, ast)
File "/home/olli/Code/Git/unrpyc/decompiler/__init__.py", line 288, in print_camera
self.write(" %s" % ast.name)
TypeError: not all arguments converted during string formatting

Edit: Correct file: script.zip

CensoredUsername commented 4 months ago

Error while decompiling /home/olli/.xlib/RPG/_test/OurBrightDays-0.1.3-pc/game/script.rpyc:

I think you uploaded the wrong file ;)

CensoredUsername commented 4 months ago

Anyway, I think this is fixed in 4d0d80e , not sure why I used ast.name instead of ast.layer.

madeddy commented 4 months ago

I think you uploaded the wrong file ;)

You are right. I think i looked on the wrong line in terminal... Fixed upload anyway. Maybe it comes up again.

Anyway, my tests came up clean. This seems fixed.

CensoredUsername commented 4 months ago

Closing it then.