[Solved] Call screen save from inside choice menu issues

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
Gamma Vector
Newbie
Posts: 20
Joined: Thu Feb 25, 2010 9:15 pm
Contact:

[Solved] Call screen save from inside choice menu issues

#1 Post by Gamma Vector » Sun Oct 16, 2016 7:00 am

EDIT: Partially solved, but not entirely. I've gotten around the "loading inside the save menu" issue with use of the after_load label. However, the screenshot is still messed up. Does anyone know how to either fix the screenshot, or replace it with a predefined image?

So if I use call screen to bring up the save screen when the player clicks on a certain menu option, it saves just fine. The only trouble is, when you load the game, you wind up inside the save menu. I have no earthly idea why it's doing that. It's not supposed to do that. In addition, the screenshot image on the save file is showing up as the gray room placeholder no matter what background or text is actually displayed in game.

But, again, I'm trying to get the engine to do something it doesn't really want to do. I'm trying to implement saving only in specific locations. (And yes, I realize that could be considered user unfriendly. It's not a choice I made lightly. I could explain my reasoning, but that would be beside the point of this post, so I'll spare you.)

So far, I've done this by removing the autosave feature, disabling rollback (history works just fine), and removing normal menu access to the save screen. Instead, the save screen is accessed with call screen when the correct option is selected from a dialogue menu inside the player's home. I don't see why this would cause a problem; but obviously, it does.

The menu in question. I'm not sure what else I should show y'all, if anything.

Code: Select all

label apartment:
    menu :
        "What do you want to do?"
        "Save":
            call screen save
            jump apartment
        "Check the clock":
            jump clock
        "Look around":
            jump lookapartment
        "Go outside":
            jump apartment_outside
        "Go to bed":
            scene bg sleep
            with fade
            "You sleep until morning"
            $ time_date.clockset(420)
            $ time_date.day_forward(1)
            jump apartment_init
Any idea why this is happening? And, more to the point, how I can fix it?
Last edited by Gamma Vector on Mon Oct 17, 2016 9:53 am, edited 4 times in total.

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

Re: Calling save screen inside a choice menu gives save issu

#2 Post by Ocelot » Sun Oct 16, 2016 7:35 am

Try to use $ ShowMenu("save") instead.
< < insert Rick Cook quote here > >

User avatar
papiersam
Veteran
Posts: 231
Joined: Fri Aug 12, 2016 2:24 pm
Completed: Gem Hunt Beta, 1/Probably, Animunch
Projects: The Panda Who Dreamed
Contact:

Re: Calling save screen inside a choice menu gives save issu

#3 Post by papiersam » Sun Oct 16, 2016 10:59 am

Try to use $ ShowMenu("save") instead.
I doubt that would work, syntax-wise: it's a screen action. You could try using the after_load label.

User avatar
Kia
Eileen-Class Veteran
Posts: 1011
Joined: Fri Aug 01, 2014 7:49 am
Deviantart: KiaAzad
Discord: Kia#6810
Contact:

Re: Calling save screen inside a choice menu gives save issu

#4 Post by Kia » Sun Oct 16, 2016 4:32 pm

a simple way is to make a screen with a text and two buttons that one close the screen and opens the save screen and the other jumps...
you can make it look like the menu if you want

Gamma Vector
Newbie
Posts: 20
Joined: Thu Feb 25, 2010 9:15 pm
Contact:

Re: Calling save screen inside a choice menu gives save issu

#5 Post by Gamma Vector » Sun Oct 16, 2016 7:03 pm

r_sami wrote:
Try to use $ ShowMenu("save") instead.
I doubt that would work, syntax-wise: it's a screen action. You could try using the after_load label.
Okay, so using the after_load label and a variable to determine which location the player saved from works just fine.

Now, the only trouble is that screenshots are still showing a grey placeholder screen instead of the actual background and menu. Does anyone know how to fix this? Or, alternately, does anyone know how to replace the screenshot on a savefile with a predefined image? I took a look in the save screen code, but I couldn't figure out how to replace "add FileScreenshot(slot)" and not break everything.

User avatar
Kia
Eileen-Class Veteran
Posts: 1011
Joined: Fri Aug 01, 2014 7:49 am
Deviantart: KiaAzad
Discord: Kia#6810
Contact:

Re: Calling save screen inside a choice menu gives save issu

#6 Post by Kia » Mon Oct 17, 2016 12:37 am

try it my way it should take the screenshot from the game just before opening the save screen

Gamma Vector
Newbie
Posts: 20
Joined: Thu Feb 25, 2010 9:15 pm
Contact:

Re: Calling save screen inside a choice menu gives save issu

#7 Post by Gamma Vector » Mon Oct 17, 2016 2:11 am

Kia wrote:try it my way it should take the screenshot from the game just before opening the save screen
Nope. Same problem. The screenshot still doesn't take correctly. I attached a picture of what it's doing.
Attachments
Capture.PNG

User avatar
Kia
Eileen-Class Veteran
Posts: 1011
Joined: Fri Aug 01, 2014 7:49 am
Deviantart: KiaAzad
Discord: Kia#6810
Contact:

Re: Calling save screen inside a choice menu gives save issu

#8 Post by Kia » Mon Oct 17, 2016 4:10 am

isn't that your game screen just before saving? no background, no characters and an empty chat window?

Gamma Vector
Newbie
Posts: 20
Joined: Thu Feb 25, 2010 9:15 pm
Contact:

Re: Calling save screen inside a choice menu gives save issu

#9 Post by Gamma Vector » Mon Oct 17, 2016 5:55 am

Kia wrote:isn't that your game screen just before saving? no background, no characters and an empty chat window?
Nope. That's the problem. There should be text in the chat window and a background image, though there aren't any characters on the screen.

User avatar
Kia
Eileen-Class Veteran
Posts: 1011
Joined: Fri Aug 01, 2014 7:49 am
Deviantart: KiaAzad
Discord: Kia#6810
Contact:

Re: Calling save screen inside a choice menu gives save issu

#10 Post by Kia » Mon Oct 17, 2016 6:12 am

I guess you need to narrow your problem in a new project and send it here for us to check, the problem should have originated from another part of your code

Gamma Vector
Newbie
Posts: 20
Joined: Thu Feb 25, 2010 9:15 pm
Contact:

Re: Calling save screen inside a choice menu gives save issu

#11 Post by Gamma Vector » Mon Oct 17, 2016 7:28 am

Kia wrote:I guess you need to narrow your problem in a new project and send it here for us to check, the problem should have originated from another part of your code
Okay, I probably sound really stupid now. But what you want me to do is upload a distribution of a new project that only contains the problem (So, the modifications to the save system and a menu screen that demonstrates the problem), right? Do I also need to past my code into a code block, or will you be able to access it?

User avatar
Kia
Eileen-Class Veteran
Posts: 1011
Joined: Fri Aug 01, 2014 7:49 am
Deviantart: KiaAzad
Discord: Kia#6810
Contact:

Re: Calling save screen inside a choice menu gives save issu

#12 Post by Kia » Mon Oct 17, 2016 7:40 am

not a distribution, make a new game and put the code you use to call the save with, then check if the problem is still there, if not add another part of the code you think might contain the problem, do this till you narrow down where the problem comes from. then you can zip and send the game folder for us to check.
or if that's simply too much work, you can strip your current game folder from large files like unused images, save and cache folders and music to reduce the size and send that, just make sure it still works to the point that the problem happens.

Gamma Vector
Newbie
Posts: 20
Joined: Thu Feb 25, 2010 9:15 pm
Contact:

Re: Calling save screen inside a choice menu gives save issu

#13 Post by Gamma Vector » Mon Oct 17, 2016 7:47 am

Okay, I made a new project and copied over the modifications to the quickmenu, pause menu, and keybindings. I then included a choice menu just like in my actual game. The problem persists. So, here we are: https://mega.nz/#!ktNw3aJT!ttLibyHjjFUB ... lpyFgKKmdA

User avatar
Kia
Eileen-Class Veteran
Posts: 1011
Joined: Fri Aug 01, 2014 7:49 am
Deviantart: KiaAzad
Discord: Kia#6810
Contact:

Re: Calling save screen inside a choice menu gives save issu

#14 Post by Kia » Mon Oct 17, 2016 8:14 am

Kia wrote:a simple way is to make a screen with a text and two buttons that one close the screen and opens the save screen and the other jumps...
you can make it look like the menu if you want
I guess you didn't try this one...

Code: Select all

define e = Character('Eileen')
screen save_c:
    modal True
    vbox:
        xalign .5 yalign .2
        text "What do you want to do?" size 40 color "#FFF"
        hbox:
            xalign .5 yalign .5 spacing 10
            textbutton _("Let's save") action [Hide("save_c"),ShowMenu("save")] background "#000"
            textbutton _("Nah...") action [Hide("save_c"),Jump("save_choice")] background "#000"

init python: 
    config.keymap['rollback'].remove('K_PAGEUP')
    config.keymap['rollback'].remove('repeat_K_PAGEUP')
    config.keymap['rollback'].remove('K_AC_BACK')
    config.keymap['rollback'].remove('mousedown_4')
    _game_menu_screen = "pause_menu"
    config.has_autosave = False
    config.has_quicksave = False
    config.autosave_on_quit = False
    config.autosave_on_choice = False

## The game starts here.

label start:

    scene bg room
    show eileen happy
    show screen save_c
    "something that should be seen in the save"
label save_choice:

    "You did nothing."

    return

Gamma Vector
Newbie
Posts: 20
Joined: Thu Feb 25, 2010 9:15 pm
Contact:

Re: Calling save screen inside a choice menu gives save issu

#15 Post by Gamma Vector » Mon Oct 17, 2016 9:35 am

I did try something like that, but it didn't work.

Oddly enough, your version works in my test game, but doesn't work in my full game. I'm going to go through and redo the changes in my full game so that I know I haven't accidentally done something different than I did with the test game. (I didn't copy and paste, I just retyped what I had done)

Thank you very much for your help!

EDIT: Okay, so there was nothing drastically off about my code. On a whim, I tried deleting all the saves and using the "delete persistent" button. For whatever reason, the problem is solved now. The extra screen call works perfectly. Thank you so much for your help!

Post Reply

Who is online

Users browsing this forum: No registered users