Trouble with text variables [Solved]
Posted: Sat May 10, 2014 9:32 pm
This should be simple, but I can't find it anywhere. I'm just starting out, and I'm prolly doping something totally stupid, so there's that as well... So frustrated I actually joined the forum.
Here's the code, totally generic.
I've tried all three of the variables but all error out. Here's the traceback.
Thanks for any help!
Here's the code, totally generic.
Code: Select all
# Declare characters used by this game.
define e = Character('Eileen', color="#c8ffc8")
$ age1 = 18
$ age2 = "eighteen"
$ age3 = 'eighteen'
# The game starts here.
label start:
e "You've created a new Ren'Py game."
e "I'm [age3] years old."
return
Code: Select all
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/script.rpy", line 17, in script
e "I'm [_age3] years old."
KeyError: u'_age3'
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "game/script.rpy", line 17, in script
e "I'm [_age3] years old."
File "C:\Users\me\Desktop\Games\renpy-6.17.6-sdk\renpy\ast.py", line 558, in execute
renpy.exports.say(who, what, interact=self.interact)
File "C:\Users\me\Desktop\Games\renpy-6.17.6-sdk\renpy\exports.py", line 925, in say
who(what, interact=interact)
File "C:\Users\me\Desktop\Games\renpy-6.17.6-sdk\renpy\character.py", line 808, in __call__
what = what_pattern.replace("[what]", sub(what, translate=translate))
File "C:\Users\me\Desktop\Games\renpy-6.17.6-sdk\renpy\substitutions.py", line 223, in substitute
s = formatter.vformat(s, (), kwargs)
File "/home/tom/ab/x64lucid-deps/install/lib/python2.7/string.py", line 549, in vformat
File "/home/tom/ab/x64lucid-deps/install/lib/python2.7/string.py", line 571, in _vformat
File "/home/tom/ab/x64lucid-deps/install/lib/python2.7/string.py", line 632, in get_field
File "/home/tom/ab/x64lucid-deps/install/lib/python2.7/string.py", line 591, in get_value
KeyError: u'_age3'