Reserved names

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
User avatar
Karrion
Regular
Posts: 73
Joined: Fri Jan 18, 2019 8:33 pm
Projects: Murder on the Marine Express
Organization: 1564 Studio
itch: 1564-studio
Contact:

Reserved names

#1 Post by Karrion »

So I made a fresh project, wrote a few lines and got this error when clicking launch project:
I'm sorry, but an uncaught exception occurred.

After initialization, but before game start.
File "game/screens.rpy", line 716, in prepare_screen
screen preferences():
File "game/screens.rpy", line 716, in prepare
screen preferences():
File "game/screens.rpy", line 720, in prepare
use game_menu(_("Preferences"), scroll="viewport"):
File "game/screens.rpy", line 720, in prepare
use game_menu(_("Preferences"), scroll="viewport"):
File "game/screens.rpy", line 722, in prepare
vbox:
File "game/screens.rpy", line 722, in prepare
vbox:
File "game/screens.rpy", line 754, in prepare
hbox:
File "game/screens.rpy", line 754, in prepare
hbox:
File "game/screens.rpy", line 768, in prepare
vbox:
File "game/screens.rpy", line 768, in prepare
vbox:
File "game/screens.rpy", line 770, in prepare
if config.has_music:
File "game/screens.rpy", line 770, in prepare
if config.has_music:
File "game/screens.rpy", line 773, in prepare
hbox:
File "game/screens.rpy", line 773, in prepare
hbox:
File "game/screens.rpy", line 774, in prepare
bar value Preference("music volume")
File "game/screens.rpy", line 774, in prepare
bar value Preference("music volume")
File "renpy/common/00preferences.rpy", line 470, in Preference
rv = get()
File "renpy/common/00preferences.rpy", line 440, in get
if len(n) == 3 and n[0] == "mixer":
Exception: Character expects its what argument to be a string, got [u'music', u'volume'].

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

Full traceback:
File "C:\Users\karri\Downloads\renpy-7.1.0-sdk\renpy\bootstrap.py", line 313, in bootstrap
renpy.main.main()
File "C:\Users\karri\Downloads\renpy-7.1.0-sdk\renpy\main.py", line 520, in main
run(restart)
File "C:\Users\karri\Downloads\renpy-7.1.0-sdk\renpy\main.py", line 90, in run
renpy.display.screen.prepare_screens()
File "C:\Users\karri\Downloads\renpy-7.1.0-sdk\renpy\display\screen.py", line 909, in prepare_screens
s.ast.prepare_screen()
File "game/screens.rpy", line 716, in prepare_screen
screen preferences():
File "game/screens.rpy", line 716, in prepare
screen preferences():
File "game/screens.rpy", line 720, in prepare
use game_menu(_("Preferences"), scroll="viewport"):
File "game/screens.rpy", line 720, in prepare
use game_menu(_("Preferences"), scroll="viewport"):
File "game/screens.rpy", line 722, in prepare
vbox:
File "game/screens.rpy", line 722, in prepare
vbox:
File "game/screens.rpy", line 754, in prepare
hbox:
File "game/screens.rpy", line 754, in prepare
hbox:
File "game/screens.rpy", line 768, in prepare
vbox:
File "game/screens.rpy", line 768, in prepare
vbox:
File "game/screens.rpy", line 770, in prepare
if config.has_music:
File "game/screens.rpy", line 770, in prepare
if config.has_music:
File "game/screens.rpy", line 773, in prepare
hbox:
File "game/screens.rpy", line 773, in prepare
hbox:
File "game/screens.rpy", line 774, in prepare
bar value Preference("music volume")
File "game/screens.rpy", line 774, in prepare
bar value Preference("music volume")
File "C:\Users\karri\Downloads\renpy-7.1.0-sdk\renpy\python.py", line 1953, in py_eval_bytecode
return eval(bytecode, globals, locals)
File "<screen language>", line 774, in <module>
File "renpy/common/00preferences.rpy", line 470, in Preference
rv = get()
File "renpy/common/00preferences.rpy", line 440, in get
if len(n) == 3 and n[0] == "mixer":
File "C:\Users\karri\Downloads\renpy-7.1.0-sdk\renpy\character.py", line 1043, in __call__
raise Exception("Character expects its what argument to be a string, got %r." % (what,))
Exception: Character expects its what argument to be a string, got [u'music', u'volume'].

Windows-8-6.2.9200
Ren'Py 7.1.4.1266
Marine Express Satsujin Jiken 1.0
Tue Feb 19 20:27:53 2019
It seems that one of the character definitions is redirecting to a music parameter. Are there any reserved variables that I should know of?

These are my definitions:
define ran = Character("Ranko")
define ast = Character("Astrid")
define eri = Character("Erica")
define ire = Character("Irene")
define jes = Character("Jessica")
define fra = Character("Frank")
define law = Character("Lawrence")
define len = Character("Lena")
define cla = Character("Clarisse")
define gat = Character("Gatas")
define cat = Character("Catherine")
define mao = Character("Mao")
define kat = Character("Katya")
define spi = Character("Spike")
define mad = Character("Maddy")
Thanks in advance.
1564 Studio, an indie studio dedicated to developing mystery VNs!
Follow us on Twitter for updates on our projects!

Image

Check out our current project, just released on PC, Android, Switch, XBox ONE/Series S/X and PS4/5!
Also available in Spanish, English, French and Japanese!

Image

strayerror
Regular
Posts: 159
Joined: Fri Jan 04, 2019 3:44 pm
Contact:

Re: Reserved names

#2 Post by strayerror »

I suspect that at least len may be problematic, as it's a commonly used top-level function in python. I'd expect redefining like this it to give you some grief.

User avatar
Alex
Lemma-Class Veteran
Posts: 3093
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Reserved names

#3 Post by Alex »


Post Reply

Who is online

Users browsing this forum: No registered users