It's confusing me, because it's copied from some existing code that works fine.
The value of destination_card_name is "a".
What I would expect to see from this is destination_card_name_in_hiragana should have the value "あ" at the end.
Code: Select all
# From a label:
$ destination_card_name_in_hiragana = convert_romaji_to_kana(destination_card_name, hiragana_list) # Line 325
init python:
def convert_romaji_to_kana(romaji, kana_list):
keys = kana_list.keys();
if romaji in keys:
kana = dict[romaji] # Line 350
return kana
hiragana_list = {
"a" : "あ",
"i" : "い",
"u" : "う",
"e" : "え",
"o" : "お"} -- Full Traceback ------------------------------------------------------------
Full traceback:
File "D:\Renpy\renpy\execution.py", line 288, in run
node.execute()
File "D:\Renpy\renpy\ast.py", line 718, in execute
renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
File "D:\Renpy\renpy\python.py", line 1297, in py_exec_bytecode
exec bytecode in globals, locals
File "game/Flashcards.rpy", line 325, in <module>
$ destination_card_name_in_hiragana = convert_romaji_to_kana(destination_card_name, hiragana_list)
File "game/Flashcards.rpy", line 350, in convert_romaji_to_kana
kana = dict[romaji]
TypeError: 'type' object has no attribute '__getitem__'
Windows-7-6.1.7601-SP1
Ren'Py 6.15.6.372
A Ren'Py Game 0.0


