"string indices must be integers, not tuple" [solved]

In this forum we discuss the future of Ren'Py, both bug fixes and longer-term development. Pre-releases are announced and discussed here.
Post Reply
Message
Author
User avatar
balldancing
Regular
Posts: 65
Joined: Tue Sep 03, 2013 9:32 am
Location: milan
Contact:

"string indices must be integers, not tuple" [solved]

#1 Post by balldancing » Wed Jan 15, 2014 9:12 am

I'm trying to figure out how to customize the in-game messaging system I retrieved from this thread and I came up with an error I'm unsure how to fix.

Code: Select all

            use mailbox_commands

screen mailbox_commands:
    hbox:
        if current_message and current_message.can_reply:
            imagebutton idle "reply_ground.png" hover "reply_hover.png" action current_message.reply
        else:
            imagebutton idle "reply_ground.png" hover "reply_hover.png" action None
        if current_message:
            imagebutton idle "delete_ground.png" hover "delete_hover.png" action [current_message.delete, SetScreenVariable("current_message", None)]
        else:
            imagebutton idle "delete_ground.png" hover "delete_hover.png" action None
        if new_messages > 0:
            imagebutton idle "mark_ground.png" hover "mark_hover.png" [mark_all_read, SetVariable("new_messages",0)]
        else:
            imagebutton idle "mark_ground.png" hover "mark_hover.png" action None
        imagebutton idle "restore_ground.png" hover "restore_hover.png" action restore_all
        imagebutton idle "exit_ground.png" hover "exit_hover.png" action Hide("mailbox")
This is where the error occured, and this is the traceback:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 21, in script
  File "game/messages.rpy", line 94, in python
  File "game/messages.rpy", line 107, in python
TypeError: string indices must be integers, not tuple
Last edited by balldancing on Wed Jan 15, 2014 9:23 am, edited 1 time in total.
Image
I offer proofreading and editing services~

User avatar
Anima
Veteran
Posts: 448
Joined: Wed Nov 18, 2009 11:17 am
Completed: Loren
Projects: PS2
Location: Germany
Contact:

Re: "string indices must be integers, not tuple"

#2 Post by Anima » Wed Jan 15, 2014 9:15 am

Code: Select all

imagebutton idle "mark_ground.png" hover "mark_hover.png" Keyword! [mark_all_read, SetVariable("new_messages",0)]
Here is a keyword missing.
General pointer, when a traceback gives you the line number where things go wrong, you should mark the line in the posts, so people don't have to hunt trough the whole code to find the error.
Avatar created with this deviation by Crysa
Currently working on:
  • Winterwolves "Planet Stronghold 2" - RPG Framework: Phase III

User avatar
balldancing
Regular
Posts: 65
Joined: Tue Sep 03, 2013 9:32 am
Location: milan
Contact:

Re: "string indices must be integers, not tuple"

#3 Post by balldancing » Wed Jan 15, 2014 9:22 am

Oh goodness I didn't look hard enough ^^; and thank you so much!! I'll remember for next time.
Image
I offer proofreading and editing services~

Post Reply

Who is online

Users browsing this forum: No registered users