How to renpy.get_screen with .startswith?

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
GeeSeki
Regular
Posts: 112
Joined: Sat Dec 17, 2016 3:39 am
Projects: A Town Uncovered
itch: geeseki
Contact:

How to renpy.get_screen with .startswith?

#1 Post by GeeSeki »

Hi, I'm trying to get my code to get_screen of all the screens that start the same but have different endings.

# screen scr_test_1
# screen scr_test_2
# screen scr_test 3

I tried the following but it doesn't work

Code: Select all

$ renpy.get_screen(startswith("scr_test_")

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3794
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: How to renpy.get_screen with .startswith?

#2 Post by Imperf3kt »

GeeSeki wrote: Tue Nov 05, 2019 12:08 am I tried the following but it doesn't work

Code: Select all

$ renpy.get_screen(startswith("scr_test_")
I am not familiar with startswith, but in the code you provided, you're missing a second closing bracket )
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
GeeSeki
Regular
Posts: 112
Joined: Sat Dec 17, 2016 3:39 am
Projects: A Town Uncovered
itch: geeseki
Contact:

Re: How to renpy.get_screen with .startswith?

#3 Post by GeeSeki »

Oh, yeah. I mean besides the missing ')' it just doesn't work, I went about the code a different way, using a variable with a boolean to toggle on and off whatever I needed

Post Reply

Who is online

Users browsing this forum: Google [Bot], MSN [Bot]