I have a system here for drawing cards- it tells you what rarity of card you got, and what character's card you got. It's very basic, and in no way done, but I was testing it to make sure it worked at this level and I kept getting this error message.
Code: Select all
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/script.rpy", line 147, in script
"You got a [girlnam] R card!"
KeyError: u'girlnam'
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "game/script.rpy", line 147, in script
"You got a [girlnam] R card!"
File "C:\Users\SerebiiGamer\Desktop\renpy-6.99.12.4-sdk\renpy\ast.py", line 613, in execute
renpy.exports.say(who, what, interact=self.interact)
File "C:\Users\SerebiiGamer\Desktop\renpy-6.99.12.4-sdk\renpy\exports.py", line 1147, in say
who(what, interact=interact)
File "C:\Users\SerebiiGamer\Desktop\renpy-6.99.12.4-sdk\renpy\character.py", line 868, in __call__
what = what_pattern.replace("[what]", sub(what, translate=translate))
File "C:\Users\SerebiiGamer\Desktop\renpy-6.99.12.4-sdk\renpy\character.py", line 850, in sub
return renpy.substitutions.substitute(s, scope=scope, force=force, translate=translate)[0]
File "C:\Users\SerebiiGamer\Desktop\renpy-6.99.12.4-sdk\renpy\substitutions.py", line 232, 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'girlnam'
Windows-8-6.2.9200
Ren'Py 6.99.12.4.2187
Hyper Stars! Cyber Idol Project 0.0
Code: Select all
label RESULTSPROTO:
if result == "R":
"You got a [girlnam] R card!"
jump scout
if result == "SR":
"You got a [girlnam] SR card!"
jump scout
if result == "SSR":
"You got a [girlnam] SSR card!"
jump scout
if result == "UR":
"You got a [girlnam] UR card!"
jump scout

