Code: Select all
### Function for callback hooks for NVL character dialogues ###
def nvlsayhooks(event, interact=True, **kwargs):
if not interact:
return
if event == "begin":
if info.nvl_cleared is True:
store.nvl_list = [store.nvl_list[-1]]
info.nvl_cleared = False
elif event == "end":
if len(store.nvl_list) > 4:
store.nvl_list = [store.nvl_list[-1]]
info.nvl_cleared = True
I was hoping someone would have an idea on how to properly clear the NVL list automatically after a certain number of lines.
This is not a necessity, merely a functionality I would like to have. Any help is appreciated.
Edit: The error I get with any other method is:
Code: Select all
IndexError('list index out of range',)
Full traceback:
File "game/script.rpy", line 119, in script
anon_nvl "You really don't know what you are doing, do you?"
File "C:\Program Files (x86)\Renpy\renpy\ast.py", line 593, in execute
renpy.exports.say(who, what, interact=self.interact)
File "C:\Program Files (x86)\Renpy\renpy\exports.py", line 999, in say
who(what, interact=interact)
File "C:\Program Files (x86)\Renpy\renpy\character.py", line 829, in __call__
self.do_done(who, what)
File "renpy/common/00nvl_mode.rpy", line 288, in do_done
nvl_list[-1][2]["what_args"]["alt"] = ""
IndexError: list index out of range