[BUG] Variables no longer defined after repeated reloading

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
fishghost
Newbie
Posts: 17
Joined: Mon Oct 21, 2019 7:22 pm
Contact:

[BUG] Variables no longer defined after repeated reloading

#1 Post by fishghost »

Hey folks —

One of our players is running into a niche issue, where if they repeatedly reload at a choice menu, they'll get error messages claiming certain speakers or variables aren't defined. This can't be true, as to reach the points in the game our player reached they would have had to interact with those variables dozens of times.

Apparently, restarting the game makes the error message go away and the game is able to proceed normally. I've run into similar issues with bugtesting, where if I use the devtools to reload too many times on game launch, I start getting nonsense error messages, which all go away as soon as I restart the game.

Sample error messages below:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 5702, in script
    menu:
KeyError: u'previous_dialogue'

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

Full traceback:
  File "game/script.rpy", line 5702, in script
    menu:
  File "/home/carles/.local/share/Steam/steamapps/common/ScarletHollow/renpy/ast.py", line 1678, in execute
    renpy.exports.say(None, "\n".join(narration), interact=False)
  File "/home/carles/.local/share/Steam/steamapps/common/ScarletHollow/renpy/exports.py", line 1417, in say
    who(what, *args, **kwargs)
  File "/home/carles/.local/share/Steam/steamapps/common/ScarletHollow/renpy/character.py", line 1206, in __call__
    what = self.prefix_suffix("what", self.what_prefix, what, self.what_suffix)
  File "/home/carles/.local/share/Steam/steamapps/common/ScarletHollow/renpy/character.py", line 1125, in prefix_suffix
    return (sub(prefix) + sub(body) + sub(suffix))
  File "/home/carles/.local/share/Steam/steamapps/common/ScarletHollow/renpy/character.py", line 1105, in sub
    return renpy.substitutions.substitute(s, scope=scope, force=force, translate=translate)[0]
  File "/home/carles/.local/share/Steam/steamapps/common/ScarletHollow/renpy/substitutions.py", line 270, in substitute
    s = formatter.vformat(s, (), kwargs)
  File "/home/tom/ab/renpy-build/tmp/install.android-x86_64/lib/python2.7/string.py", line 563, in vformat
  File "/home/tom/ab/renpy-build/tmp/install.android-x86_64/lib/python2.7/string.py", line 585, in _vformat
  File "/home/tom/ab/renpy-build/tmp/install.android-x86_64/lib/python2.7/string.py", line 646, in get_field
  File "/home/tom/ab/renpy-build/tmp/install.android-x86_64/lib/python2.7/string.py", line 605, in get_value
KeyError: u'previous_dialogue'

Linux-5.9.16-1-MANJARO-x86_64-with-glibc2.2.5
Ren'Py 7.4.6.1693
Scarlet Hollow 
Sat Apr 23 09:46:39 2022
And another:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
File "game/monday_script/monday_climax_duke_dies.rpy", line 2706, in script
menu:
Exception: Sayer 'stella' is not defined.

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

Full traceback:
File "game/monday_script/monday_climax_duke_dies.rpy", line 2706, in script
menu:
File "/home/carles/.local/share/Steam/steamapps/common/ScarletHollow/renpy/ast.py", line 680, in execute
who = eval_who(self.who, self.who_fast)
File "/home/carles/.local/share/Steam/steamapps/common/ScarletHollow/renpy/ast.py", line 574, in eval_who
raise Exception("Sayer '%s' is not defined." % who)
Exception: Sayer 'stella' is not defined.

Linux-5.9.16-1-MANJARO-x86_64-with-glibc2.2.5
Ren'Py 7.4.6.1693
Scarlet Hollow
Fri Apr 22 18:57:35 2022
Not sure if there's anything I can do about this on my end, but I at least wanted to share it here in case it's something that can be addressed in future versions of Ren'py.

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: [BUG] Variables no longer defined after repeated reloading

#2 Post by PyTom »

Can you update Ren'Py. There as an issue that could plausibly have caused this that was fixed around then.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot]