[solved]evaluate variable as screen name for `use`

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
Kia
Eileen-Class Veteran
Posts: 1040
Joined: Fri Aug 01, 2014 7:49 am
Deviantart: KiaAzad
Discord: Kia#6810
Contact:

[solved]evaluate variable as screen name for `use`

#1 Post by Kia »

I'm wondering, is there any way to make this work?:

Code: Select all

    default screens = ["scr1", "scr2"]
    for i in screens:
        use i
Last edited by Kia on Mon May 17, 2021 10:00 am, edited 1 time in total.

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2400
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: evaluate variable as screen name for `use`

#2 Post by Ocelot »

There is an example of use expression in the documentation: https://www.renpy.org/doc/html/screens.html#use
< < insert Rick Cook quote here > >

User avatar
Kia
Eileen-Class Veteran
Posts: 1040
Joined: Fri Aug 01, 2014 7:49 am
Deviantart: KiaAzad
Discord: Kia#6810
Contact:

Re: [solved]evaluate variable as screen name for `use`

#3 Post by Kia »

thank you Ocelot, you're a savior.
I always miss those parts for some reason. I knew I saw it somewhere, just couldn't remember what it was :oops:

Post Reply

Who is online

Users browsing this forum: Google [Bot]