[Solved] Saving screenshots just outside "/game/" directory? (but still within the game's folder!)

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
Wight
Regular
Posts: 47
Joined: Mon Jan 07, 2019 5:40 pm
Completed: A Transient Experiment
itch: wight
Contact:

[Solved] Saving screenshots just outside "/game/" directory? (but still within the game's folder!)

#1 Post by Wight »

Right now I have a Function that takes a screenshot of the game, gives it a certain file name, and saves it in a folder titled "album". Which means the path currently works like this:
MY_VN/game/album

This is what I have right now, and it works fine.

Code: Select all

default screenshot_firstscreenshot = os.path.join( renpy.config.gamedir, "album", "first_screenshot.png" )

Code: Select all

Function( renpy.screenshot, screenshot_firstscreenshot )

For the player to access the folder, they have to go into the "game" folder, and then the "album" folder. I realized I want to make it just a little bit more convenient and detectable for the player by putting it alongside the 'game' folder rather than within it, which means it would be visible on the same page as the game's .exe file. In other words, rather than
MY_VN/game/album
it would be
MY_VN/album
and it would look something like this
Image

I believe it's something I have to change in the "os.path.join( renpy.config.gamedir, "album", "first_screenshot.png" )" part but I can't figure out the exact terms I should use and I'm not having any luck through searching.
Last edited by Wight on Sat Mar 16, 2019 4:13 am, edited 2 times in total.

User avatar
IrinaLazareva
Veteran
Posts: 399
Joined: Wed Jun 08, 2016 1:49 pm
Projects: Legacy
Organization: SunShI
Location: St.Petersburg, Russia
Contact:

Re: Saving screenshots just outside "/game/" directory? (but still within the game's folder!)

#2 Post by IrinaLazareva »

Try renpy.config.basedir instead of renpy.config.gamedir.

User avatar
Wight
Regular
Posts: 47
Joined: Mon Jan 07, 2019 5:40 pm
Completed: A Transient Experiment
itch: wight
Contact:

Re: Saving screenshots just outside "/game/" directory? (but still within the game's folder!)

#3 Post by Wight »

IrinaLazareva wrote: Sat Mar 16, 2019 3:36 am Try renpy.config.basedir instead of renpy.config.gamedir.
No luck. It does recognize "basedir" because it's not giving me an AttributeError (which I get when I tried something like renpy.config.base), but it seems to do nothing.


UPDATE: Nevermind, it works! When I was trying to change some things, I noticed it wasn't behaving as expected and it made me realize something I forgot to try. So I closed the game, tried your suggestion again , relaunched it, and it worked! Thank you very much!

Post Reply

Who is online

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