Can't save after a certain point [solved]

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
BlueB
Regular
Posts: 57
Joined: Sat Dec 14, 2013 8:11 pm
Projects: Forbidden Arms
Contact:

Can't save after a certain point [solved]

#1 Post by BlueB »

Having some trouble with saving my game.

At the start of the game, saving works fine; press the save state and you're good to go. However, after a certain point, if you save, the game saves at the last "creation" screen.

During the tutorial, players must create a bronze pin using the creation screen to continue the game. To call the screen, I use this:

Code: Select all

v "Would you like me to go over it again?"
    
    menu:
        "Yes, please.":
            v "Hohoho. Were you paying attention, Emm?"
            EmSad "I was, I promise! It's just in the middle somewhere I got a little lost..."
            v "Alright. I'll say it again."
            jump create_tut
        "No, I'm ready!":
            show Vyorn Happy with dissolve
            v "That's my girl. Get to it!"
            hide Vyorn Happy with dissolve
    
    show screen create
    
label loop1:
    
    Em "Alright, select 'Pins,' then 'Bronze,' and hit 'start.' I can do that."
    
    if my_inventory.has_item(bronze_pin):
        jump first_continue
    else:
        jump loop1
The player navigates through the creation menu, which is a long and convoluted code at present. The beginning goes like this:

Code: Select all

screen create:
    tag menu
    add "CreateGround.png" xpos 250 ypos 20
    if pins_unlocked:
        imagebutton idle "text_pins_idle.png" hover "text_pins_active.png" action ShowMenu('pins') xpos 280 ypos 50
    if watches_unlocked:
        imagebutton idle "text_watches_idle.png" hover "text_watches_active.png" action ShowMenu('watches') xpos 280 ypos 100
    if rings_unlocked:
        imagebutton idle "text_rings_idle.png" hover "text_rings_active.png" action ShowMenu('rings') xpos 280 ypos 150
And the end the player arrives at is:

Code: Select all

label make_pin_bronze:
    $ store_inventory.lose(firewood)
    $ store_inventory.lose(bronze)
    $ my_inventory.get(bronze_pin)
    hide screen pins_bronze
    hide screen pins
    show screen clock
    show screen menu_buttons
    show Pin Bronze at accessory_position with dissolve
    EmHappy "Yes! I made a {b}Bronze Pin{/b}!"
if tutorial:
    jump first_continue
else:
    jump cellar
Everything seems to work fine; the player gets their bronze icon and the game continues on. HOWEVER, saving any time after this results in the game saving at the screen create line of code. What could possibly be causing this? Any help would be more than appreciated. If you need a screenshot, just let me know.
Last edited by BlueB on Sat Feb 01, 2014 12:24 pm, edited 1 time in total.
Hey, I'm on deviantArt! Currently doing commissions.

User avatar
Alex
Lemma-Class Veteran
Posts: 3095
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Can't save after a certain point

#2 Post by Alex »

Check if you actually hide "create" screen somewhere in your code.
Or you'd better attached the project folder to let people fix the issue.

User avatar
BlueB
Regular
Posts: 57
Joined: Sat Dec 14, 2013 8:11 pm
Projects: Forbidden Arms
Contact:

Re: Can't save after a certain point

#3 Post by BlueB »

Alright, attached are all the (currently used) .rpy files. The current game is all of 5 minutes long and is littered with bugs as it is, but the most pressing issue is that doing anything at all except click through dialogue after opening the "create" screen will send you right back to the "create" screen. It's a mess :? If you need anything else from me, just say so. I'll gladly give you my soul at this point.

Also, I realize I'm a very messy programmer; half the lines are unnecessary and convoluted, and there are 500 better ways to do what I'm doing. I always try and get the basic idea to work before cleaning it up and bugging it later. However, that might be what got me into this situation :oops:

If anybody could help out, it'd be much appreciated.
Attachments
script.rpy
Dialogue and such. This and 'screen.rpy' are the ones giving me hell.
(13.41 KiB) Downloaded 22 times
screens.rpy
The source of all my problems. The screens I've added are at the bottom. They'll have their own file eventually.
(21.12 KiB) Downloaded 32 times
options.rpy
Options that come packaged with Renpy
(8.91 KiB) Downloaded 26 times
images.rpy
Where I store most of the images that aren't UI related
(2.59 KiB) Downloaded 27 times
Hey, I'm on deviantArt! Currently doing commissions.

Anima
Veteran
Posts: 448
Joined: Wed Nov 18, 2009 11:17 am
Completed: Loren
Projects: PS2
Location: Germany
Contact:

Re: Can't save after a certain point

#4 Post by Anima »

I don't think jumping from a menu is a good idea. Since menus have their own context and it doesn't look like you ever leave that context again.
It would be better to use a call screen statement for the item creation screen and then change the subscreens either with show statements or with conditional use statements.
Attachments
script.rpy
A quick bug replication, confirming that jumping from a menu is unsafe.
(755 Bytes) Downloaded 24 times
Avatar created with this deviation by Crysa
Currently working on:
  • Winterwolves "Planet Stronghold 2" - RPG Framework: Phase III

User avatar
BlueB
Regular
Posts: 57
Joined: Sat Dec 14, 2013 8:11 pm
Projects: Forbidden Arms
Contact:

Re: Can't save after a certain point

#5 Post by BlueB »

Anima wrote:It would be better to use a call screen statement for the item creation screen and then change the subscreens either with show statements or with conditional use statements.
Your script helped tremendously. Thank you so much! Everything is running fine now.
Last edited by BlueB on Sat Feb 01, 2014 12:48 pm, edited 1 time in total.
Hey, I'm on deviantArt! Currently doing commissions.

Anima
Veteran
Posts: 448
Joined: Wed Nov 18, 2009 11:17 am
Completed: Loren
Projects: PS2
Location: Germany
Contact:

Re: Can't save after a certain point [solved]

#6 Post by Anima »

Glad you could pick it up from there.
You should take a look at the tag system as well. Should spare you all those hide actions.
Avatar created with this deviation by Crysa
Currently working on:
  • Winterwolves "Planet Stronghold 2" - RPG Framework: Phase III

Post Reply

Who is online

Users browsing this forum: Ocelot