But now to the problem: The error looks like this:
Code: Select all
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/girlNavData.rpy", line 118, in script
TypeError: list indices must be integers, not unicode
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "/home/nait/Downloads/renpy-6.14.1-sdk/renpy/execution.py", line 266, in run
node.execute()
File "/home/nait/Downloads/renpy-6.14.1-sdk/renpy/ast.py", line 1222, in execute
renpy.exports.say(None, "\n".join(narration), interact=False)
File "/home/nait/Downloads/renpy-6.14.1-sdk/renpy/exports.py", line 750, in say
who(what, interact=interact)
File "/home/nait/Downloads/renpy-6.14.1-sdk/renpy/character.py", line 762, in __call__
what = renpy.substitutions.substitute(what)
File "/home/nait/Downloads/renpy-6.14.1-sdk/renpy/substitutions.py", line 218, in substitute
s = formatter.vformat(s, (), kwargs)
File "./install/lib/linux-x86_64/lib/python2.7/string.py", line 549, in vformat
File "./install/lib/linux-x86_64/lib/python2.7/string.py", line 571, in _vformat
File "./install/lib/linux-x86_64/lib/python2.7/string.py", line 640, in get_field
TypeError: list indices must be integers, not unicode
Linux-3.2.0-32-generic-x86_64-with-debian-wheezy-sid
Ren'Py 6.14.1.366
Code: Select all
init python:
[...]
girlsname = ["Misty", "Saphire", "Cynthia"]
girlsnameS = [ # the genitive
"'s", ## Misty
"'s", ## Saphire
"'s"] ## Cynthia
[...]
label meetMisty:
$ girl = 0
show misty normal at right
jump meetGirl
[...]
label meetGirl:
if girllist[girl].hasChanged() == True:
"Congratulation, now you are [girlsname[girl]][girlnameS[girl]] [girllist[girl].MilestoneName]!"
menu:
"HP: [prota.HealthPoints]\nRelation: [girllist[girl].MilestoneName]\nExperience: [girllist[girl].Exp]"
"speak":
jump speakGirl
[...]
I solved the problem by doing a trick literally just now:
Code: Select all
label meetGirl:
$ GIQ = girllist[girl] ## short for "girl in question"
$ GNIQ = girlsname[girl] + girlsnameS[girl] ## short for "girl's name in question"
if girllist[girl].hasChanged() == True:
"Congratulation, now you are [GNIQ] [GIQ.MilestoneName]!"
menu:
"HP: [prota.HealthPoints]\nRelation: [GIQ.MilestoneName]\nExperience: [GIQ.Exp]"