Ren'Py Check if save exist on Android

dakila

New Member
Mar 31, 2018
9
0
Hello there,

i need some help.
How can i check if my save exists on Android?
On PC this works well with the Path to the file, but on Android i don't even know the right path.
Maybe there is a easier solution? Please help :)

Thank you!
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,978
16,235
How can i check if my save exists on Android?
Hmm, why do you want to do this ? I suspect that it's not how what you want to do should be done.


On PC this works well with the Path to the file, but on Android i don't even know the right path.
On PC, Ren'Py have two save paths, that are both used at the same time, with one that change depending if the game is played on Linux, Windows or MacOS. So, I suspect that whatever you use to check if your save exist do not works as well as you imagine.

Code:
label whatever:
    if len( renpy.list_saved_games( fast=True ) ) != 0:
        "At least one save file exist."

    if len( renpy.list_saved_games( "^[^a_].*", fast=True ) ) != 0:
        "The player saved at least once."

    if len( renpy.list_saved_games( "^[^aq_].*", fast=True ) ) != 0:
        "The player saved at least once without using the quick save."

    if len( renpy.list_saved_games( "1-2", fast=True ) ) != 0:
        "The player made a save by using the second slot of the first save page."

    if len( renpy.list_saved_games( "2-1", fast=True ) ) != 0:
        "The player made a save by using the first slot of the second save page."

    if len( renpy.list_saved_games( "3-.*", fast=True ) ) != 0:
        "The player made at least one save on the third save page."

    if len( renpy.list_saved_games( ".*-3", fast=True ) ) != 0:
        "The player made at least one save on the third slot of one of the save pages."
 
  • Like
Reactions: dakila

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,611
2,258
There are a couple of RenPy functions you could use, they are all covered here:


The most obvious candidate being .

But like Anne says... I don't see any reason why you would want to.

Android has issues with saves, since their security considerations make it difficult for an app to access anything except the folders it's allowed to. I believe this is why files .
 

dakila

New Member
Mar 31, 2018
9
0
Hmm, why do you want to do this ? I suspect that it's not how what you want to do should be done.
Because my game only uses one save slot and I want it to load automatically when I start it. The game saves automatic, also on quit. So if there is no saved game, a new saved game will be created and loading of the saved game will be skipped. And yeah, it works now :)

Thank you very much!
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,978
16,235
Because my game only uses one save slot and I want it to load automatically when I start it.
Sorry if it feel harsh, but it's two reasons for me to not play your game.

Your game will not be good and interesting enough to justify such behavior. Not that I expect your game to be bad, but a game need to be exceptionally good and interesting for one to accept playing it under those conditions. And if there's really good and interesting games available on the scene, none have yet reached the "exceptional" level, and I don't expect one to do it in the future.
What mean that people will play your game for its entertainment value, not for the challenge it can possibly represent. Therefore, it's the kind of restriction that would make your game less enjoyable, and so less played.


This being said, using a combination between and would probably be better.