[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
User avatar
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 » Wed May 16, 2012 10:15 am

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: 2516
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

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

#2 Post by Alex » Wed May 16, 2012 4:31 pm

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

User avatar
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 » Wed May 16, 2012 11:08 pm

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: 2516
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

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

#4 Post by Alex » Thu May 17, 2012 2:16 am

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.

User avatar
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 » Thu May 17, 2012 8:46 am

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: 2516
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

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

#6 Post by Alex » Thu May 17, 2012 12:18 pm

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

User avatar
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 » Fri May 18, 2012 12:17 am

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: 2516
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

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

#8 Post by Alex » Fri May 18, 2012 3:29 am

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

User avatar
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 » Fri May 18, 2012 9:28 am

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: 2516
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

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

#10 Post by Alex » Fri May 18, 2012 3:32 pm

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).

User avatar
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 » Fri May 18, 2012 11:51 pm

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: 2516
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

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

#12 Post by Alex » Sat May 19, 2012 2:53 am

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

User avatar
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 » Sat May 19, 2012 7:49 am

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: 2516
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

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

#14 Post by Alex » Sat May 19, 2012 12:05 pm

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

User avatar
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 » Sun May 20, 2012 12:06 am

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: Mumeishi