[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
Miko-Class Veteran
Posts: 959
Joined: Fri Aug 01, 2014 7:49 am
Deviantart: KiaAzad
Skype: KiaAzad
Contact:

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

#1 Post by Kia » Mon May 17, 2021 5:35 am

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
Eileen-Class Veteran
Posts: 1090
Joined: Tue Aug 23, 2016 10:35 am
Skype: miinipaa
Contact:

Re: evaluate variable as screen name for `use`

#2 Post by Ocelot » Mon May 17, 2021 6:58 am

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
Miko-Class Veteran
Posts: 959
Joined: Fri Aug 01, 2014 7:49 am
Deviantart: KiaAzad
Skype: KiaAzad
Contact:

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

#3 Post by Kia » Mon May 17, 2021 10:03 am

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: No registered users