Interpreting [variable] on calling lists...

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
Errilhl
Regular
Posts: 164
Joined: Wed Nov 08, 2017 4:32 pm
Projects: HSS
Deviantart: studioerrilhl
Github: studioerrilhl
Contact:

Interpreting [variable] on calling lists...

#1 Post by Errilhl »

Okay, I have a slightly weird thing, which I assume has got to do with renpy.say() functionality, but I'm just checking to make sure.

I have a separate file with dialogue-content, and when I call the intro, like this:

Code: Select all

# this is the dialogue-file
init python:
    dialogue_fP_intro = ["{i}Hi! I'm [fP], and this is the story of what happens this summer. Did that come out a little stilted? I felt that it did. Oh, well, I'm not that well versed in being a narrator. Hence, I will mostly conduct this in a first-person perspective - you know, \"Hi, I'm [fP] and you're about to be taken for a wild ride!\" That sound good? {b}GREAT!{/b}{/i}",
        "{i}Now, where were we? Oh, right. Yeah. This summer. You know, the one you're gonna be playing through? So much have happened, I don't even really know where to start. Hmm... Maybe May? Or... no, I think we'll have to go all the way back to April, actually. You see, I was attending my last high-school semester. Grinding away, trying to get my grades up that last bit, all the while trying not to become a total geek.{/i}",
    ]
    dialogue_fP = ['So. I wake up on April 1st, trying to get my wits about me, and figuring out what I wanna do with the day. Then, shellshocked, and after that trying to figure out how to get the image of my naked sister off my mind. I decided spending the day working on my bike would be as good a way as any...'
    ]
    dialogue_fM = [
                    ["[fP]! Wake UP!",
                    "[fP]! Get out of bed THIS INSTANT!"
                    ]
        ]
# this is how I call the dialogue_fP_intro:
        python:
            for i in dialogue_fP_intro:
                renpy.say(fP,i)
# this renders the [fP] and such fine               
But, later, when I try to just output the content of dialogue_fM, directly, like this:

Code: Select all

            fM "[dialogue_fM[0][0]]"
            fP "uuuhh..."
            fM "[dialogue_fM[0][1]]"
 
The variables inside is not interpreted, and comes out like [fP] and so on - I'm assuming this is because I use renpy.say() on the first one, and just output the content directly on the second?
Currently working on: Image

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot], Kocker, plastiekk