How to organize 10.000 images in the script.rpy?
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.
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.
How to organize 10.000 images in the script.rpy?
Currently I'm using 1000 images in my script but at the end of the game there gonna be about 10.000! How can I folder them inside the script.rpy so that I don't have 1000000 lines at the end???
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3792
- Joined: Mon Dec 14, 2015 5:05 am
- itch: Imperf3kt
- Location: Your monitor
- Contact:
Re: How to organize 10.000 images in the script.rpy?
I'll ignore the reason why you have so many and just suggest you create a new "images.rpy" and define your images in that.
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
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Re: How to organize 10.000 images in the script.rpy?
Ok, but how do I open that special "images.rpy"? I'm using Atom and it creates only "untitled" new tabs! I don't know how to rename them. If this is the right way at all.
Re: How to organize 10.000 images in the script.rpy?
Never mind. I've just copied the screens.rpy and renamed to images.rpy. Moved all the image files in images.rpy and it worked!
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3792
- Joined: Mon Dec 14, 2015 5:05 am
- itch: Imperf3kt
- Location: Your monitor
- Contact:
Re: How to organize 10.000 images in the script.rpy?
You could name it anything, 'images' was just a fitting name.
You could also break up your game this way, it is commonly used to separate chapters.
Additionally, an .rpy file is actually just a .txt file with a custom extension. You could create 'myfile.txt' and then rename it 'myfile.rpy' and it would work.
Its the .rpyc (RenPY Compiled) files that matter, which renpy makes automatically.
You could also break up your game this way, it is commonly used to separate chapters.
Additionally, an .rpy file is actually just a .txt file with a custom extension. You could create 'myfile.txt' and then rename it 'myfile.rpy' and it would work.
Its the .rpyc (RenPY Compiled) files that matter, which renpy makes automatically.
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
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
- noeinan
- Eileen-Class Veteran
- Posts: 1153
- Joined: Sun Apr 04, 2010 10:10 pm
- Projects: Ren'Py QuickStart, Crimson Rue
- Organization: Statistically Unlikely Games
- Deviantart: noeinan
- Github: noeinan
- Location: Washington State, USA
- Contact:
Re: How to organize 10.000 images in the script.rpy?
Since a few updates ago, Ren'Py automatically defines your images if you go into your game folder and create a new folder called "images". You just have to put all the image files in there, and name them according to how you would define them. It is okay if they are in multiple folders, too.
For example, I have game/images/bg for my backgrounds, then the file names are like "bg forest". I can then type "scene bg forest" in the code, without having to define the images at all.
For example, I have game/images/bg for my backgrounds, then the file names are like "bg forest". I can then type "scene bg forest" in the code, without having to define the images at all.
Re: How to organize 10.000 images in the script.rpy?
I use a battery of im.Composite() manipulators to produce variations in facial expressions as a means to reduce image file size. Character images are created in two parts: one of the character's body without any facial features, and many more containing only eyes, mouth, nose, and other such features. These images are composed two at a time to create the emotions of a single character, rather than many images that share a large amount of redundant data. It is a very effective technique that can reduce the total file size of a project significantly, but all such files must be defined manually. A file that I name define.rpy contains hundreds of image statements that I would not need to edit or review after confirming that they display correctly. If you want to sort these image names alphabetically in your script, advanced text editors such as Notepad++ and EditPad have functions to sort select lines in that manner. I use the professional edition of the latter for all of my scripting tasks, as it is much more feature-rich than the text editors packaged with Ren'Py.
- Ibitz
- Regular
- Posts: 63
- Joined: Thu Jul 27, 2017 4:47 pm
- Projects: Magical Disarray (WIP)
- Organization: Ibitz Visual Novels
- Deviantart: http://ibitz.deviant
- itch: ibitz
- Contact:
Re: How to organize 10.000 images in the script.rpy?
Notepad is going to be your friend. I use notepad and, in my case, an unusable file in Editra that I write up all my images in. For my current demo, I have 501 images total. I separated them into categories (SFX/CGS/Menus/Sprites/Backgrounds, etc.) and then further categorized them (by character, route, chapter, etc.). Using # (which can't be read by Ren'Py as part of your script) is a good way to bounce back and forth between categories and to find images in your code. I use those and then, in the unusable Editra file, basically make a list of all the images I use and their shortcut codes. I also do the same thing, but split up images by category, in Notepad. I have all of these things open while I work on my game. It seems like a lot of work, but it's actually worth it. I just finished my first of 3 demos in a few months (which is good, since I work alone) and having the ability to copy and paste quickly, really helped get me there.
DEVIANT ART:http://ibitz.deviantart.com/
Ibitz is a self-taught coder/artist who works alone on their games. All games I create are freeware. If you need any help with coding or creating your game, just let me know. I'd be more than happy to help.
Who is online
Users browsing this forum: No registered users