Using images in subfolders without defining

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
lixy
Newbie
Posts: 7
Joined: Sun Mar 14, 2021 7:29 pm
Completed: office horror 1.0
Projects: untitled dating sim, BIRE
Contact:

Using images in subfolders without defining

#1 Post by lixy »

Hi, this may be a silly question, but is there a way to use a series of images in a subfolder without having to define every single one?
For instance, I have about 20 pictures all labelled things like "ind 1", "ind 1.1", "ind 2", etc., and have them in a folder labelled "Induction". Is there a way I can show these images using

Code: Select all

show ind 1
without having to first go through and do

Code: Select all

define ind 1 = "images/induction/ind 1.png"
for every single one? This seems like something that is possible, but even with all my googling, I can't find anything about it. Help?

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

Re: Using images in subfolders without defining

#2 Post by Ocelot »

Yes. Did you try to write show ind 1? Because automatic image definition should work in subfolders:
https://www.renpy.org/doc/html/displayi ... -directory
< < insert Rick Cook quote here > >

User avatar
lixy
Newbie
Posts: 7
Joined: Sun Mar 14, 2021 7:29 pm
Completed: office horror 1.0
Projects: untitled dating sim, BIRE
Contact:

Re: Using images in subfolders without defining

#3 Post by lixy »

Huh, weird. I tried and it told me it couldn't find the file. I'll dig through and make sure I labelled all the files correctly. It's probably user error, if it's meant to work

Edit: It seems to be working now. Don't know what I was doing that it wasn't before, but thank you!
Edit x2: It seems the error was with my naming; "ind 1.1" was pulling up an error while "ind 1_1" doesn't. The worst part is that I knew about this and just forgot. Time to rename all those files

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

Re: Using images in subfolders without defining

#4 Post by Imperf3kt »

You need to enable it first. Add this

Code: Select all

 config.automatic_images = True
somewhere in options.rpy
https://www.renpy.org/doc/html/config.h ... tic_images

This may also be of interest
https://www.renpy.org/doc/html/config.h ... ages_strip
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

Post Reply

Who is online

Users browsing this forum: BBN_VN, Google [Bot]