Closed Bexa2 closed 4 months ago
Having everything as renpy.python
seems to get further before crashing (my added prints print 2000 lines vs 9000 lines)
dict={'expr': 'fade', 'paired': None, 'name': ('game/script.rpy', 1658182085, 13), 'filename': 'game/script.rpy', 'linenumber': 80}
items=['expr', 'fade', 'paired', None, 'name', ('game/script.rpy', 1658182085, 13), 'filename', 'game/script.rpy', 'linenumber', 80, 'next', None]
items[i]='next'
items[i+1]=None
dict=<renpy.revertable.RevertableDict object at 0x000001BB278114E0>
key='delay'
value=None
Same error message with game using Python 3.9. Game: VIS 2.0 Script: script.rpyc (other as well but this one is little) file game available under https://dikgames.com/vis/ (season 2 so not too big)
Other game with 2.7 python base: Helping hotites (https://dikgames.com/helping-the-hotties hh.zip
Might test with solution on post: https://github.com/CensoredUsername/unrpyc/issues/156#issue-1416743346
Works with python 2.7
File "G:\decompilers\rpa_decompiler\decompiler\magic.py", line 718, in safe_loads).load()
. In line 718! The magic.py of the last version 1.1.8 has however only 674 lines. Whatsoever version of unrpyc used was, makes every try of others to understand the code a waste of time.
- This should be in a way a duplicate of RenPy 7.5.0 changesΒ #146
- In the opener post of user @Bexa2 the tool complains two times about
File "G:\decompilers\rpa_decompiler\decompiler\magic.py", line 718, in safe_loads).load()
. In line 718! The magic.py of the last version 1.1.8 has however only 674 lines.Whatsoever version of unrpyc used was, makes every try of others to understand the code a waste of time.
Actually, #156 did fix my errors (on the games I tested), #146 was not enough.
As for the number of lines, black formatted on save, so my file has more lines.
Thanks for clearing this. It was confusing. Formaters can be a gift and hell at the same time. π
Did you use the whole of the changes form #156? @sigio uses in his pull request the change
magic.py line 112 replace "if args or kwargs:" with "if (args or kwargs) and args != ([],) and kwargs != {}:"
not, so i'am unsure if its needed. I noticed no problems only with the other corrections.
Greets
Thanks for clearing this. It was confusing. Formaters can be a gift and hell at the same time. π
Did you use the whole of the changes form #156? @sigio uses in his pull request the change
magic.py line 112 replace "if args or kwargs:" with "if (args or kwargs) and args != ([],) and kwargs != {}:"
not, so i'am unsure if its needed. I noticed no problems only with the other corrections.Greets
Yeah, I have a comment on that pull requests, those changes made it so it worked on one game and stopped working on another.
I think the change in magic.py is what made it work in both games.
I think the change in magic.py is what made it work in both games.
Interesting. Ok, thanks. I will test this and see. ππ»
I think the change in magic.py is what made it work in both games.
Interesting. Ok, thanks. I will test this and see. ππ»
I just tried OnthePrairie-0.3.0-pc and it gave me the error
G:\f95zone\todo\OnthePrairie-0.3.0-pc\temp_folder\script.rpyc
Failed at G:\f95zone\todo\OnthePrairie-0.3.0-pc
Traceback (most recent call last):
File "G:\f95zone\normalize_paths.py", line 576, in <module>
main()
File "G:\f95zone\normalize_paths.py", line 572, in main
fix_games(f95zone_path, type_of_game)
File "G:\f95zone\normalize_paths.py", line 550, in fix_games
raise e
File "G:\f95zone\normalize_paths.py", line 547, in fix_games
(name, version) = get_name_and_version(path)
File "G:\f95zone\normalize_paths.py", line 137, in renpy_get_name_and_version
raise err
File "G:\f95zone\normalize_paths.py", line 124, in renpy_get_name_and_version
ret = unrpyc.decompile_rpyc(file)
File "G:\f95zone\decompilers\rpa_decompiler\unrpyc.py", line 211, in decompile_rpyc
ast = read_ast_from_file(in_file, encoding=encoding)
File "G:\f95zone\decompilers\rpa_decompiler\unrpyc.py", line 170, in read_ast_from_file
data, stmts = magic.safe_loads(
File "G:\f95zone\decompilers\rpa_decompiler\decompiler\magic.py", line 718, in safe_loads
).load()
File "C:\Users\Bexa2\miniconda3\envs\f95zone\lib\pickle.py", line 1213, in load
dispatch[key[0]](self)
File "C:\Users\Bexa2\miniconda3\envs\f95zone\lib\pickle.py", line 1691, in load_setitem
dict[key] = value
TypeError: 'RevertableDict' object does not support item assignment
Just by changing
class RevertableDict(magic.FakeStrict, dict):
__module__ = "renpy.revertable"
to
class RevertableDict(magic.FakeStrict, dict):
__module__ = "renpy.python"
fixed it (Of course some other game will need the renpy.revertable in the future so I'll have to manually switch between the two), so it'd be nice to be able to use both, for new and old games.
Ahem... just a thought..
Which version has the game you used here? And if we're on it, which v. have the others you tested, where you changed back to renpy.python
?
renpy.revertable
should only be needed and actually working with Ren'py 7.5.x and 8.x. Just making sure nothing is accidentally overlooked.
btw.: The code change in magic.py is indeed also needed from the look of it. The pull request for the changes has it missing, but needs it to be complete.
This is also fixed. Problems arises not from Ren'Py v8 but from the revertable issue.
This is working on dev right now.
Should be fixed on master and releases as well now, so closing π
With python 3.10, the games uses RenPy 8.0.0
It fails at script.rpyc, attached a zip with the file that fails.
script.zip
Here's my class_factory
Update, changed
renpy.python
torenpy.revertable
Now it fails atload_setitems