[SOLVED]Where to place the Scrolling Load/Save Screen coding

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
Colby Alighieri
Regular
Posts: 75
Joined: Thu Apr 07, 2011 10:39 am
Completed: [KN]Hope In The Morning(Willow's Dream Diary)
Projects: The Last Order: Black Wings
Organization: InsertNameHere Productions
Location: Quezon City, Philippines
Contact:

[SOLVED]Where to place the Scrolling Load/Save Screen coding

#1 Post by Colby Alighieri »

Unfortunately, I'm still a n0ob. Please bear with me... >.<

Image

I want to achieve something like this. I need to know the basic layouts first so that I could imagemap and mess around with it later. (Urgh... No doubt I'll ask for help some time later...)

So I've been to the Cookbook to know the coding of a vertical version of a Save/Load screen. It's here..

But I don't understand where to put the coding! Where should the coding go for this? In options.rpy, screens.rpy or script.rpy? If it's in the screens.rpy, how much of the Save/Load Screens coding should I remove or add?
Last edited by Colby Alighieri on Sun May 20, 2012 12:08 am, edited 1 time in total.
Stagnant? Me too!
Send me a note to my dA Account and I'll see what I can do~!

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

Re: Help me understand the Scrolling Load/Save Screen coding

#2 Post by Alex »

To use this layout you need to add next lines to your script

Code: Select all

init-2:
    $ layout.scrolling_load_save()
Also, you need to disable save and load screens (delete or comment code) or just rename them

Code: Select all

screen my_save:
    # rest of code unchanged
screen my_load:
    # rest of code unchanged

Colby Alighieri
Regular
Posts: 75
Joined: Thu Apr 07, 2011 10:39 am
Completed: [KN]Hope In The Morning(Willow's Dream Diary)
Projects: The Last Order: Black Wings
Organization: InsertNameHere Productions
Location: Quezon City, Philippines
Contact:

Re: Help me understand the Scrolling Load/Save Screen coding

#3 Post by Colby Alighieri »

Alex wrote:To use this layout you need to add next lines to your script

Code: Select all

init-2:
    $ layout.scrolling_load_save()
Also, you need to disable save and load screens (delete or comment code) or just rename them

Code: Select all

screen my_save:
    # rest of code unchanged
screen my_load:
    # rest of code unchanged
I followed the instructions and the code works for my other projects, except for the one I'm working on! :(

I get this error.

Code: Select all


I'm sorry, but an uncaught exception occurred.

While running game code:
ValueError: invalid literal for int() with base 10: '1-1'

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "C:\Users\misiel\Desktop\renpy-6.13.12\renpy\execution.py", line 265, in run
  File "C:\Users\misiel\Desktop\renpy-6.13.12\renpy\ast.py", line 632, in execute
  File "C:\Users\misiel\Desktop\renpy-6.13.12\renpy\python.py", line 972, in py_exec_bytecode
  File "common/_layout/scrolling_load_save.rpym", line 223, in <module>
  File "common/_layout/scrolling_load_save.rpym", line 131, in _file_picker
ValueError: invalid literal for int() with base 10: '1-1'

Windows-7-6.1.7601-SP1
Ren'Py 6.13.12.1728

Does the error have something to do with my other imagemapped menus and customizations? The code you gave me worked for the project without any imagemapped menus or any customization whatsoever.
Stagnant? Me too!
Send me a note to my dA Account and I'll see what I can do~!

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

Re: Help me understand the Scrolling Load/Save Screen coding

#4 Post by Alex »

You need to delete old saves. Do it manually or turn on screens and press "del' key over every not empty save slot. Then you'll get no errors with scrolling save/load.

Colby Alighieri
Regular
Posts: 75
Joined: Thu Apr 07, 2011 10:39 am
Completed: [KN]Hope In The Morning(Willow's Dream Diary)
Projects: The Last Order: Black Wings
Organization: InsertNameHere Productions
Location: Quezon City, Philippines
Contact:

Re: Help me understand the Scrolling Load/Save Screen coding

#5 Post by Colby Alighieri »

Alex wrote:You need to delete old saves. Do it manually or turn on screens and press "del' key over every not empty save slot. Then you'll get no errors with scrolling save/load.
It works now! Thanks!

But unfortunately, my navigation menu is affected. It's supposed to be an imagemap. All the other screens have the imagemapped navigation menu except for this Save/Load Screen.

Image

Anything I need to change in the Navigation screens or in the script?
Stagnant? Me too!
Send me a note to my dA Account and I'll see what I can do~!

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

Re: Help me understand the Scrolling Load/Save Screen coding

#6 Post by Alex »

Colby Alighieri wrote:Anything I need to change in the Navigation screens or in the script?
Yes, of course - http://www.renpy.org/wiki/renpy/doc/ref ... navigation and http://www.renpy.org/wiki/renpy/doc/ref ... _load_save

Colby Alighieri
Regular
Posts: 75
Joined: Thu Apr 07, 2011 10:39 am
Completed: [KN]Hope In The Morning(Willow's Dream Diary)
Projects: The Last Order: Black Wings
Organization: InsertNameHere Productions
Location: Quezon City, Philippines
Contact:

Re: Help me understand the Scrolling Load/Save Screen coding

#7 Post by Colby Alighieri »

Alex wrote:
Colby Alighieri wrote:Anything I need to change in the Navigation screens or in the script?
Yes, of course - http://www.renpy.org/wiki/renpy/doc/ref ... navigation and http://www.renpy.org/wiki/renpy/doc/ref ... _load_save
That did the trick for the navigation! But unfortunately, all of the navigation buttons are stuck on "ground" so I'm unable to click or go anywhere else. Again, this problem is only on the Save/Load screen.

Image

This is my code which I copied from the Cookbook link you gave me and input the necessary coordinates.

Code: Select all


init -2 python:
layout.imagemap_navigation(
        "navi_ground.png", #ground
        "navi_idle.png", #idle
        "navi_hover.png", #hover
        "navi_selected_idle.png", #selected idle
        "navi_selected_hover.png", #selected hover
        [
            (580,361,182,28, "Return"),
            (580,427,182,31, "Save Game"),
            (580,461,182,30, "Load Game"),
            (580,392,182,31, "Preferences"),
            (580,494,182,29, "Main Menu"),
            (580,527,182,31, "Quit"),            
            ])    

Does clearing the cache solve this problem or no?
Stagnant? Me too!
Send me a note to my dA Account and I'll see what I can do~!

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

Re: Help me understand the Scrolling Load/Save Screen coding

#8 Post by Alex »

Khm, not sure, but you could try... The new (screen language) imagemap hotspots are (x, y, width, height) where x, y - coordinates of top left corner of hotspot, but old imagemap hotspots were (x1, y1, x2, y2), where x2, y2, coordinates of bottom right corner of hotspot. So, change coordinates for hotspots.
http://www.renpy.org/wiki/renpy/doc/ref ... y.imagemap

Colby Alighieri
Regular
Posts: 75
Joined: Thu Apr 07, 2011 10:39 am
Completed: [KN]Hope In The Morning(Willow's Dream Diary)
Projects: The Last Order: Black Wings
Organization: InsertNameHere Productions
Location: Quezon City, Philippines
Contact:

Re: Help me understand the Scrolling Load/Save Screen coding

#9 Post by Colby Alighieri »

Alex wrote:Khm, not sure, but you could try... The new (screen language) imagemap hotspots are (x, y, width, height) where x, y - coordinates of top left corner of hotspot, but old imagemap hotspots were (x1, y1, x2, y2), where x2, y2, coordinates of bottom right corner of hotspot. So, change coordinates for hotspots.
http://www.renpy.org/wiki/renpy/doc/ref ... y.imagemap
I've been following the new imagemap hotspots since I've started. I've double-checked everything in their Photoshop files (and slices) so I'm sure I followed X, Y, W, H in all of my imagemap codes.
Stagnant? Me too!
Send me a note to my dA Account and I'll see what I can do~!

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

Re: Help me understand the Scrolling Load/Save Screen coding

#10 Post by Alex »

Mmm, wait a bit. So you already have "Preferences" made of imagemap, don't you? And what about "Navigation" for it - do you have it? If "yes" then you don't need to make another one using layout, but if "no" and you want to make it using layout - then try to set hotspots in old style ('cause layouts are the old way of doing stuff in Ren'Py).

Colby Alighieri
Regular
Posts: 75
Joined: Thu Apr 07, 2011 10:39 am
Completed: [KN]Hope In The Morning(Willow's Dream Diary)
Projects: The Last Order: Black Wings
Organization: InsertNameHere Productions
Location: Quezon City, Philippines
Contact:

Re: Help me understand the Scrolling Load/Save Screen coding

#11 Post by Colby Alighieri »

Alex wrote:Mmm, wait a bit. So you already have "Preferences" made of imagemap, don't you? And what about "Navigation" for it - do you have it? If "yes" then you don't need to make another one using layout, but if "no" and you want to make it using layout - then try to set hotspots in old style ('cause layouts are the old way of doing stuff in Ren'Py).
I don't have any other menus made of imagemaps yet (except for the Main Menu).

And just to make sure, are old style hotspots written this way: X,W,Y,H
Stagnant? Me too!
Send me a note to my dA Account and I'll see what I can do~!

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

Re: Help me understand the Scrolling Load/Save Screen coding

#12 Post by Alex »

Colby Alighieri wrote:And just to make sure, are old style hotspots written this way: X,W,Y,H
No, old imagemap hotspots were (x1, y1, x2, y2), where x1, y1 - coordinates of top left corner and x2, y2 - coordinates of bottom right corner of hotspot.
http://www.renpy.org/wiki/renpy/doc/ref ... y.imagemap

Colby Alighieri
Regular
Posts: 75
Joined: Thu Apr 07, 2011 10:39 am
Completed: [KN]Hope In The Morning(Willow's Dream Diary)
Projects: The Last Order: Black Wings
Organization: InsertNameHere Productions
Location: Quezon City, Philippines
Contact:

Re: Help me understand the Scrolling Load/Save Screen coding

#13 Post by Colby Alighieri »

Alex wrote:
Colby Alighieri wrote:And just to make sure, are old style hotspots written this way: X,W,Y,H
No, old imagemap hotspots were (x1, y1, x2, y2), where x1, y1 - coordinates of top left corner and x2, y2 - coordinates of bottom right corner of hotspot.
http://www.renpy.org/wiki/renpy/doc/ref ... y.imagemap
Image

Works like a charm now! Thanks!

I'm planning to turn the Save/Load menu into an imagemap so, just to be sure I'll be asking:
So when I'm using a layout, it only uses the old imagemap coordinates for hotspots?
Stagnant? Me too!
Send me a note to my dA Account and I'll see what I can do~!

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

Re: Help me understand the Scrolling Load/Save Screen coding

#14 Post by Alex »

Yes, layouts are using old style hotspot coordinates.
You might be interested in reading this thread about imagemap screen-based menus - http://lemmasoft.renai.us/forums/viewto ... 15#p141051

Colby Alighieri
Regular
Posts: 75
Joined: Thu Apr 07, 2011 10:39 am
Completed: [KN]Hope In The Morning(Willow's Dream Diary)
Projects: The Last Order: Black Wings
Organization: InsertNameHere Productions
Location: Quezon City, Philippines
Contact:

[SOLVED] Where to place the Scrolling Load/Save Screen codin

#15 Post by Colby Alighieri »

Alex wrote:Yes, layouts are using old style hotspot coordinates.
You might be interested in reading this thread about imagemap screen-based menus - http://lemmasoft.renai.us/forums/viewto ... 15#p141051
Thank you, THANK YOU! <3
Stagnant? Me too!
Send me a note to my dA Account and I'll see what I can do~!

Post Reply

Who is online

Users browsing this forum: No registered users