In my game's script, i made the game go in another .rpy file using jump and label. In the new file, when the custom name appears the game haves an exception.
What should i do to fix this?
(I'm a complete newbie at this...)
Problem with custom names in a new .rpy file
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.
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.
Problem with custom names in a new .rpy file
Last edited by Altali on Thu Jan 04, 2018 3:49 am, edited 1 time in total.
- erickcire95
- Regular
- Posts: 33
- Joined: Tue Dec 26, 2017 7:38 pm
- Contact:
Re: Problem with custom names in a new .rpy
That could be a lot of things, it would be useful if you copy the exception text here so people can better understand the problem.
Re: Problem with custom names in a new .rpy
Thank you for the quick response!
In this case, "a" is the custom name.
Here's the code:
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/FloRoute.rpy", line 6, in script
a "We should not only train, but also study."
KeyError: u'name'
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "game/FloRoute.rpy", line 6, in script
a "We should not only train, but also study."
File "C:\Users\Vagner\Downloads\Trabalhos Rafa\ss\fon\trab\renpy-6.99.13-sdk\renpy\ast.py", line 624, in execute
renpy.exports.say(who, what, interact=self.interact, *args, **kwargs)
File "C:\Users\Vagner\Downloads\Trabalhos Rafa\ss\fon\trab\renpy-6.99.13-sdk\renpy\exports.py", line 1173, in say
who(what, *args, **kwargs)
File "C:\Users\Vagner\Downloads\Trabalhos Rafa\ss\fon\trab\renpy-6.99.13-sdk\renpy\character.py", line 889, in __call__
who = who_pattern.replace("[who]", sub(who))
File "C:\Users\Vagner\Downloads\Trabalhos Rafa\ss\fon\trab\renpy-6.99.13-sdk\renpy\character.py", line 884, in sub
return renpy.substitutions.substitute(s, scope=scope, force=force, translate=translate)[0]
File "C:\Users\Vagner\Downloads\Trabalhos Rafa\ss\fon\trab\renpy-6.99.13-sdk\renpy\substitutions.py", line 242, in substitute
s = formatter.vformat(s, (), kwargs)
File "/home/tom/ab/x64lucid-deps/install/lib/python2.7/string.py", line 563, in vformat
File "/home/tom/ab/x64lucid-deps/install/lib/python2.7/string.py", line 585, in _vformat
File "/home/tom/ab/x64lucid-deps/install/lib/python2.7/string.py", line 646, in get_field
File "/home/tom/ab/x64lucid-deps/install/lib/python2.7/string.py", line 605, in get_value
KeyError: u'name'
Windows-7-6.1.7601-SP1
Ren'Py 6.99.13.2919
In this case, "a" is the custom name.
Here's the code:
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/FloRoute.rpy", line 6, in script
a "We should not only train, but also study."
KeyError: u'name'
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "game/FloRoute.rpy", line 6, in script
a "We should not only train, but also study."
File "C:\Users\Vagner\Downloads\Trabalhos Rafa\ss\fon\trab\renpy-6.99.13-sdk\renpy\ast.py", line 624, in execute
renpy.exports.say(who, what, interact=self.interact, *args, **kwargs)
File "C:\Users\Vagner\Downloads\Trabalhos Rafa\ss\fon\trab\renpy-6.99.13-sdk\renpy\exports.py", line 1173, in say
who(what, *args, **kwargs)
File "C:\Users\Vagner\Downloads\Trabalhos Rafa\ss\fon\trab\renpy-6.99.13-sdk\renpy\character.py", line 889, in __call__
who = who_pattern.replace("[who]", sub(who))
File "C:\Users\Vagner\Downloads\Trabalhos Rafa\ss\fon\trab\renpy-6.99.13-sdk\renpy\character.py", line 884, in sub
return renpy.substitutions.substitute(s, scope=scope, force=force, translate=translate)[0]
File "C:\Users\Vagner\Downloads\Trabalhos Rafa\ss\fon\trab\renpy-6.99.13-sdk\renpy\substitutions.py", line 242, in substitute
s = formatter.vformat(s, (), kwargs)
File "/home/tom/ab/x64lucid-deps/install/lib/python2.7/string.py", line 563, in vformat
File "/home/tom/ab/x64lucid-deps/install/lib/python2.7/string.py", line 585, in _vformat
File "/home/tom/ab/x64lucid-deps/install/lib/python2.7/string.py", line 646, in get_field
File "/home/tom/ab/x64lucid-deps/install/lib/python2.7/string.py", line 605, in get_value
KeyError: u'name'
Windows-7-6.1.7601-SP1
Ren'Py 6.99.13.2919
- Remix
- Eileen-Class Veteran
- Posts: 1628
- Joined: Tue May 30, 2017 6:10 am
- Completed: None... yet (as I'm still looking for an artist)
- Projects: An un-named anime based trainer game
- Contact:
Re: Problem with custom names in a new .rpy file
How are you defining the character a?
... and equally as important, are you re-using the variable 'a' for anything else?
... and equally as important, are you re-using the variable 'a' for anything else?
Frameworks & Scriptlets:
- Speech Bubble dialogue system
- Multiple Notify with ATL and history
- (WIP) Radial Masking - needs updating to use Shader
- 7.4 - Smooth Tinting using ATL and matrixcolor
- Several other repositories there too
Re: Problem with custom names in a new .rpy file
It's being defined in this way:
Code: Select all
define a = Character("[name]")
Code: Select all
$ name = renpy.input("Now then... Why don't you introduce yourself?")
$ name = name.strip()
- Remix
- Eileen-Class Veteran
- Posts: 1628
- Joined: Tue May 30, 2017 6:10 am
- Completed: None... yet (as I'm still looking for an artist)
- Projects: An un-named anime based trainer game
- Contact:
Re: Problem with custom names in a new .rpy file
Do you have a
default name = "Bob"
or somesuch? If not, add one.
I'd also advise using a variable name that is a bit more obscure than just 'name'. That might well clash with inner workings of Ren'py
default name = "Bob"
or somesuch? If not, add one.
I'd also advise using a variable name that is a bit more obscure than just 'name'. That might well clash with inner workings of Ren'py
Frameworks & Scriptlets:
- Speech Bubble dialogue system
- Multiple Notify with ATL and history
- (WIP) Radial Masking - needs updating to use Shader
- 7.4 - Smooth Tinting using ATL and matrixcolor
- Several other repositories there too
Re: Problem with custom names in a new .rpy file
Only now i noticed that the problem resides in the fact that i made the script use a name before the input....
But thanks for the tips!
But thanks for the tips!
Who is online
Users browsing this forum: Majestic-12 [Bot], piinkpuddiin, snotwurm