Issues with NVL and gui.preference

In this forum we discuss the future of Ren'Py, both bug fixes and longer-term development. Pre-releases are announced and discussed here.
Post Reply
Message
Author
User avatar
Camille
Eileen-Class Veteran
Posts: 1227
Joined: Sat Apr 23, 2011 2:43 pm
Completed: Please see http://trash.moe
Projects: the head well lost
Organization: L3
Tumblr: narihira
Deviantart: crownwaltz
itch: lore
Contact:

Issues with NVL and gui.preference

#1 Post by Camille »

In the game I'm working on right now, it's all NVL. I've seen two problems pop up.

First, I coded in the ability for players to choose text size, which can cause text overflow when switching to a larger size for the text. So I have tried making it so that nvl_list_length is a preference. When the player has selected default text size, nvl_list_length is set to 4. When they select the larger size, nvl_list_length should be 3.

The problem is that when this preference is changed, although the text size changes, nvl_list_length doesn't until the game is quit and opened again.

Actually, when I have having issues getting it to change at all, I noticed that there's two different spots that nvl_list_length shows up. First it's in screens.rpy as config.nvl_list_length and then it also shows up in gui.rpy as gui.nvl_list_length. So there's effectively two different variables that control the same thing. I've noticed that only the config one matters. If these are set to two different numbers, the config one is the one that's used. I'm guessing that's why nvl_list_length won't change, because it's a config variable?

The second problem is that whenever the text size is changed mid-game, when returning to the game, when you advance the text you get this fun error:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 109, in script
    x "Ohhhhh!!! Ok, yeah. Got it! Thank you!"
  File "renpy/common/00nvl_mode.rpy", line 382, in do_display
    self.pop_nvl_list()
  File "renpy/common/00nvl_mode.rpy", line 337, in pop_nvl_list
    store.nvl_list.pop()
IndexError: pop from empty list

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

Full traceback:
  File "game/script.rpy", line 109, in script
    x "Ohhhhh!!! Ok, yeah. Got it! Thank you!"
  File "C:\Program Files (x86)\renpy\ast.py", line 708, in execute
    renpy.exports.say(who, what, *args, **kwargs)
  File "C:\Program Files (x86)\renpy\exports.py", line 1345, in say
    who(what, *args, **kwargs)
  File "C:\Program Files (x86)\renpy\character.py", line 1142, in __call__
    self.do_display(who, what, cb_args=self.cb_args, **display_args)
  File "renpy/common/00nvl_mode.rpy", line 382, in do_display
    self.pop_nvl_list()
  File "renpy/common/00nvl_mode.rpy", line 337, in pop_nvl_list
    store.nvl_list.pop()
  File "C:\Program Files (x86)\renpy\python.py", line 731, in do_mutation
    return method(self, *args, **kwargs)
IndexError: pop from empty list

Windows-8-6.2.9200
Ren'Py 7.3.5.606
the head well lost 0.2.1
Thu Jul 02 00:29:25 2020
Of course, you can just ignore this and continue and it doesn't seem to actually do anything, but still.

Post Reply

Who is online

Users browsing this forum: No registered users