I have a program that creates dot to dot files and reads them back.
Except, if you make a new file, renpy.list_files does not show it until you restart the program.
how can I force it to reload the cache?
Susan
Currently typing from hospital room. I am soooo bored.
renpy.list_files using cached results
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.
- SusanTheCat
- Miko-Class Veteran
- Posts: 952
- Joined: Mon Dec 13, 2010 9:30 am
- Location: New Brunswick, Canada
- Contact:
renpy.list_files using cached results
" It's not at all important to get it right the first time. It's vitally important to get it right the last time. "
— Andrew Hunt and David Thomas
— Andrew Hunt and David Thomas
- PyTom
- Ren'Py Creator
- Posts: 16096
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: renpy.list_files using cached results
We do this for speed reasons, so it's not something that can be bypassed easily. What are you fundamentally trying to do?
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
- SusanTheCat
- Miko-Class Veteran
- Posts: 952
- Joined: Mon Dec 13, 2010 9:30 am
- Location: New Brunswick, Canada
- Contact:
Re: renpy.list_files using cached results
When you load the program, you can make a puzzle or play a puzzle.
To make a puzzle: use the program to make a series of dots, then you save the dots to an XML.
I want to be able to load the newly made xml to play without reloading the program.
It is not a program killer if I have to reload. I'll just have it exit after it saves.
Susan
To make a puzzle: use the program to make a series of dots, then you save the dots to an XML.
I want to be able to load the newly made xml to play without reloading the program.
It is not a program killer if I have to reload. I'll just have it exit after it saves.
Susan
" It's not at all important to get it right the first time. It's vitally important to get it right the last time. "
— Andrew Hunt and David Thomas
— Andrew Hunt and David Thomas
Re: renpy.list_files using cached results
Under what circumstances can you save a file to a disk but not load it using the same method you've used for saving?
- SusanTheCat
- Miko-Class Veteran
- Posts: 952
- Joined: Mon Dec 13, 2010 9:30 am
- Location: New Brunswick, Canada
- Contact:
Re: renpy.list_files using cached results
I could have a "play this file" menu instead of being lazy and reusing my main menu..
You could have you work on file A then on file B then you want to test file A.
I should just bite the bullet and have two seperate programs for playing and editing.
Susan
Insomnia is a wonderful thing
You could have you work on file A then on file B then you want to test file A.
I should just bite the bullet and have two seperate programs for playing and editing.
Susan
Insomnia is a wonderful thing
" It's not at all important to get it right the first time. It's vitally important to get it right the last time. "
— Andrew Hunt and David Thomas
— Andrew Hunt and David Thomas
Re: renpy.list_files using cached results
I don't follow but regardless, you cannot (normally) save a file to a disk without using something that can scan any folder and load the file... Normally you'd be using os module to save/load (will prolly not work on mobile devices), os module would have os.listdir method to list all files in specific directory and many others as well.
- PyTom
- Ren'Py Creator
- Posts: 16096
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: renpy.list_files using cached results
Yeah, it's probably best to just use open to open a file for loading and saving, and then os.listdir or os.path.exists for checking for file existence.
Ren'Py's internal caching really isn't meant for this.
Ren'Py's internal caching really isn't meant for this.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
Who is online
Users browsing this forum: Ahrefs [Bot], Amazon [Bot], Google [Bot]