[delete post] non-issue resolved.

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
ISAWHIM
Veteran
Posts: 318
Joined: Sun Nov 06, 2016 5:34 pm
Contact:

[delete post] non-issue resolved.

#1 Post by ISAWHIM »

I am using a construction process to display menus.
renpy.display_menu()...

When I have normal values, even lists, or dicts... it works fine.

However, when I use this setup, it fails, giving the error. "list index out of range". Though, it clearly is not. It even displays it. The error shows AFTER selecting the choice.

This just Jumps to the label with the same name as the QST.

QST is a {dict}, with "choices" being a
  • Code: Select all

    label TimeLoop:
        for i in QST:
            if QST.get(i)["active"] == True:
                m = str(QST.get(i)["choices"][1])
                renpy.display_menu([(QST.get(i)["question"],None),(m,Jump(str(i)))], interact=True, screen="choice")
        "annoying infinite loop protection text"
        jump TimeLoop

    Code: Select all

    label q2:
        init python:
            QST.update({
                "q2":{
                    "active":True,
                    "day":"",
                    "time":"",
                    "location":"poolyard",
                    "action":"swim1",
                    "with":"t",
                    "sleep":False,
                    "question":"No-one is looking...",
                    "choices":["Take it!","Run away!"]}
                })
    Manually setting it to [0] results in the same thing, but it clearly displays the correct values. Selecting the choice will result in the same index error.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot]