I think I broke the Save function... [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.
Message
Author
User avatar
pyopyon
Veteran
Posts: 451
Joined: Thu Aug 29, 2013 4:35 am
Completed: https://chouette.itch.io/
Projects: Ocean Pearls, Catching the Fox [NaNo16], Singles
Organization: Jellyfish Parade
Tumblr: jelpiparade
Skype: miss.chouette
Soundcloud: pyopyon
itch: chouette
Contact:

I think I broke the Save function... [SOLVED]

#1 Post by pyopyon »

EDIT: removed for spoiler purposes

Thank you, everyone for your help! :^)
Last edited by pyopyon on Sat Apr 05, 2014 7:38 pm, edited 2 times in total.
Image ImageImage

WiP: Image

✿ Writer for Trade/Commission ✿

Asceai
Eileen-Class Veteran
Posts: 1258
Joined: Fri Sep 21, 2007 7:13 am
Projects: a battle engine
Contact:

Re: I think I broke the Save function...

#2 Post by Asceai »

If you disable the dress-up menu (and leave the other two menus in) does save still get broken? This will help narrow things down because the other menu that breaks things (the computer one) is much less code and it's in screen language at least.

User avatar
pyopyon
Veteran
Posts: 451
Joined: Thu Aug 29, 2013 4:35 am
Completed: https://chouette.itch.io/
Projects: Ocean Pearls, Catching the Fox [NaNo16], Singles
Organization: Jellyfish Parade
Tumblr: jelpiparade
Skype: miss.chouette
Soundcloud: pyopyon
itch: chouette
Contact:

Re: I think I broke the Save function...

#3 Post by pyopyon »

If I disable the dress up menu, the save function totally normal.
Image ImageImage

WiP: Image

✿ Writer for Trade/Commission ✿

User avatar
rakada
Regular
Posts: 71
Joined: Tue Jan 07, 2014 11:00 pm
Contact:

Re: I think I broke the Save function...

#4 Post by rakada »

that mean it most likely something the dress up menu is doing to cause the save to muck up

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

Re: I think I broke the Save function...

#5 Post by Anima »

You never reach the return in the called label, every time you jump out of it. That's why the control flow never returns to the main context.
Avatar created with this deviation by Crysa
Currently working on:
  • Winterwolves "Planet Stronghold 2" - RPG Framework: Phase III

User avatar
pyopyon
Veteran
Posts: 451
Joined: Thu Aug 29, 2013 4:35 am
Completed: https://chouette.itch.io/
Projects: Ocean Pearls, Catching the Fox [NaNo16], Singles
Organization: Jellyfish Parade
Tumblr: jelpiparade
Skype: miss.chouette
Soundcloud: pyopyon
itch: chouette
Contact:

Re: I think I broke the Save function...

#6 Post by pyopyon »

rakada wrote:that mean it most likely something the dress up menu is doing to cause the save to muck up
I know XD I know that the problem is in both of these menus, I simply don't know where the problem lies, exactly.
Anima wrote:You never reach the return in the called label, every time you jump out of it. That's why the control flow never returns to the main context.
I deleted the 'return'!

...No change, though. )^:

I save, the picture that shows is of the place I saved, but when I click it.... automatically returns to the dress up game.
Last edited by pyopyon on Thu Mar 13, 2014 10:10 am, edited 1 time in total.
Image ImageImage

WiP: Image

✿ Writer for Trade/Commission ✿

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

Re: I think I broke the Save function...

#7 Post by Anima »

The return was correct, the jumps are the problem. You should never mix jumping and calling.
Avatar created with this deviation by Crysa
Currently working on:
  • Winterwolves "Planet Stronghold 2" - RPG Framework: Phase III

User avatar
pyopyon
Veteran
Posts: 451
Joined: Thu Aug 29, 2013 4:35 am
Completed: https://chouette.itch.io/
Projects: Ocean Pearls, Catching the Fox [NaNo16], Singles
Organization: Jellyfish Parade
Tumblr: jelpiparade
Skype: miss.chouette
Soundcloud: pyopyon
itch: chouette
Contact:

Re: I think I broke the Save function...

#8 Post by pyopyon »

Anima wrote:The return was correct, the jumps are the problem. You should never mix jumping and calling.
Ah, I see. Well... is there a way to fix it without taking out any of the dress-up code?
Image ImageImage

WiP: Image

✿ Writer for Trade/Commission ✿

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

Re: I think I broke the Save function...

#9 Post by Anima »

While I would recommend a complete rewrite, the whole things one big mess, it should be enough to replace the jump to dressednow with a return statement.
But you should seriously consider tidying up your script. Screen declarations shouldn't be in the middle of the script, loops should actually be done with a while instead of simply jumping somewhere back. Use screen language instead of ui functions and separate logic from GUI code whenever possible.
Avatar created with this deviation by Crysa
Currently working on:
  • Winterwolves "Planet Stronghold 2" - RPG Framework: Phase III

User avatar
pyopyon
Veteran
Posts: 451
Joined: Thu Aug 29, 2013 4:35 am
Completed: https://chouette.itch.io/
Projects: Ocean Pearls, Catching the Fox [NaNo16], Singles
Organization: Jellyfish Parade
Tumblr: jelpiparade
Skype: miss.chouette
Soundcloud: pyopyon
itch: chouette
Contact:

Re: I think I broke the Save function...

#10 Post by pyopyon »

Unfortunately, as this isn't my own work (I got it from the cookbook), I don't know how to rewrite it...

But I can fix minor things if you specify. I think I understand what you're saying, so I'll attempt to fix it.
Image ImageImage

WiP: Image

✿ Writer for Trade/Commission ✿

User avatar
pyopyon
Veteran
Posts: 451
Joined: Thu Aug 29, 2013 4:35 am
Completed: https://chouette.itch.io/
Projects: Ocean Pearls, Catching the Fox [NaNo16], Singles
Organization: Jellyfish Parade
Tumblr: jelpiparade
Skype: miss.chouette
Soundcloud: pyopyon
itch: chouette
Contact:

Re: I think I broke the Save function...

#11 Post by pyopyon »

I think the use of a jump is unavoidable, or else you can't ge back to the game...

This is what I did:

Code: Select all

if picked == "goback":
        menu:
    
            "I like the way I look.":
                
                nimpov "Perfect."
                
                scene bedroom with fade
                
                "Almost as soon as you complete this small task, you hear a loud knock on the door."
            
                jump defdressednow
        
            "I want to change something.":
                
                "Mhm... you look good, but there's something off about your uniform choices."
            
                return
And also, it doesn't fix it;;
Image ImageImage

WiP: Image

✿ Writer for Trade/Commission ✿

User avatar
pyopyon
Veteran
Posts: 451
Joined: Thu Aug 29, 2013 4:35 am
Completed: https://chouette.itch.io/
Projects: Ocean Pearls, Catching the Fox [NaNo16], Singles
Organization: Jellyfish Parade
Tumblr: jelpiparade
Skype: miss.chouette
Soundcloud: pyopyon
itch: chouette
Contact:

Re: I think I broke the Save function...

#12 Post by pyopyon »

bump
Image ImageImage

WiP: Image

✿ Writer for Trade/Commission ✿

neowired
Regular
Posts: 199
Joined: Mon Dec 01, 2008 2:33 pm
Contact:

Re: I think I broke the Save function...

#13 Post by neowired »

I think you can relatively easily simplify/shorten this code by a lot by using normal screen functions, that would probably also make it easier to figure out

for example, this code, when put inside a screen statement (you would need to adjust it properly though, i'm writing it from the top of my head; I think you will need an arrowL_hover.png and an arrowL_idle.png etc.):

Code: Select all

imagebutton auto "arrowL%s.png" action SetVariable('skin',max(skin-1,0))
imagebutton auto "arrowR%s.png" action SetVariable('skin',min(skin+1,skin_styles_num))
should be able to do the same as this whole code

Code: Select all

        ui.imagebutton("arrowL.png", "arrowL.png", clicked=ui.returns("skinL"), ypos=y, xpos=70)
        ui.imagebutton("arrowR.png", "arrowR.png", clicked=ui.returns("skinR"), ypos=y, xpos=430)

    $ picked = ui.interact()
    # based on the selection, we increase or decrease the index of the appropriate dress up item
    if picked == "skinL":
        $ skin -= 1 # previous skin
    if picked == "skinR":
        $ skin += 1 # next skin
    if skin < 1: # making sure we don't get out of index range (index 0 is not allowed)
        $ skin = skin_styles_num
    if skin > skin_styles_num: # making sure we don't get out of index range (index musn't be bigger than hair_styles_num)
        $ skin = 1
I'll link you to this lovely guide about imagebuttons made by leon
http://lemmasoft.renai.us/forums/viewto ... 51&t=22565

User avatar
pyopyon
Veteran
Posts: 451
Joined: Thu Aug 29, 2013 4:35 am
Completed: https://chouette.itch.io/
Projects: Ocean Pearls, Catching the Fox [NaNo16], Singles
Organization: Jellyfish Parade
Tumblr: jelpiparade
Skype: miss.chouette
Soundcloud: pyopyon
itch: chouette
Contact:

Re: I think I broke the Save function...

#14 Post by pyopyon »

Well... I'll try my best to recode it;;;

That said, can I have some help with the second menu, the computer screen menu?

The image map of the Map (screen #2) is between the two screens and it works perfectly fine, so I would assume that the issues are separate.

I'm going to try to do the dress-up game over but I'm really not an experienced programmer so... yes. In any case, any theories with the second menu?
Image ImageImage

WiP: Image

✿ Writer for Trade/Commission ✿

User avatar
pyopyon
Veteran
Posts: 451
Joined: Thu Aug 29, 2013 4:35 am
Completed: https://chouette.itch.io/
Projects: Ocean Pearls, Catching the Fox [NaNo16], Singles
Organization: Jellyfish Parade
Tumblr: jelpiparade
Skype: miss.chouette
Soundcloud: pyopyon
itch: chouette
Contact:

Re: I think I broke the Save function...

#15 Post by pyopyon »

I seriously have no idea what I'm doing and I haven't been able to figure it out on my own at all...

I think my only alternative is me going to have to just disable the save option altogether, because I can't fix it.

The problem with that is because there are so many love interests, besides that the game really does have high replay value so it's such a problem that I've knocked out the save function...

I really need help orz;;
Image ImageImage

WiP: Image

✿ Writer for Trade/Commission ✿

Post Reply

Who is online

Users browsing this forum: No registered users