OlegWock / Roselia-achievements

RenPy achievements module
MIT License
75 stars 10 forks source link

Не могу понять почему, но при попытке выдать достижение возникает ошибка. #8

Open licomnaklavy opened 1 year ago

licomnaklavy commented 1 year ago

[code] I'm sorry, but an uncaught exception occurred.

While running game code: File "game/script.rpy", line 56, in script $ get_achievement("con", trans=achievement_transform) File "game/script.rpy", line 56, in $ get_achievement("con", trans=achievement_transform) File "game/achievement.rpy", line 66, in get_achievement ach = persistent.achievements_dict[ach_id] KeyError: 'con'

-- Full Traceback ------------------------------------------------------------

Full traceback: File "game/script.rpy", line 56, in script $ get_achievement("con", trans=achievement_transform) File "A:\GOG\renpy-8.0.3-sdk\renpy\ast.py", line 1131, in execute renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store) File "A:\GOG\renpy-8.0.3-sdk\renpy\python.py", line 1061, in py_exec_bytecode exec(bytecode, globals, locals) File "game/script.rpy", line 56, in $ get_achievement("con", trans=achievement_transform) File "game/achievement.rpy", line 66, in get_achievement ach = persistent.achievements_dict[ach_id] KeyError: 'con'

Windows-10-10.0.17763 AMD64 Ren'Py 8.0.3.22090809 NilsMurder 2.0_BETA Sat Apr 29 11:01:15 2023 [/code]

licomnaklavy commented 1 year ago

Имя "con" само присутствует при объявлении словаря.

if not persistent.achievements_dict: persistent.achievements_dict = {"con": {"type": 0, # One time achievent "title": "Добро пожаловать!", # Also neame for steam "text": "Впервые зайти в игру.", # description "icon": "test" # 96x96 image } }

Но на $ get_achievement("con", trans=achievement_transform) Всё ломается

OlegWock commented 1 year ago

Попробуй почистить persistent data