Need Help With Imagebutton Save/Load Screen [/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
Aurehan
Regular
Posts: 47
Joined: Fri Nov 25, 2011 9:19 pm
Location: USA
Contact:

Need Help With Imagebutton Save/Load Screen [/Solved]

#1 Post by Aurehan »

Edit: Tinkered with the code a bit and solved it somehow! LOL

Helloo! :)

I'm having a bit of trouble getting my s/l screen to work. I've been using Leon's Imagebutton GUI Sample and renpy documentation for some help, but my understanding has plateaued lol.

Code: Select all

## ==================SAVE / LOAD SLOT ##

init -2 python: #we initialize x and y, so the load_save_slot screen below works at startup
    x=0
    y=0
screen file_slot(slot):
    $ file_text = "% s\n  %s" % (FileTime(number, empty="Nothing Here"), FileSaveName(number))
    add FileScreenshot(number) xpos 418 ypos 226
    text file_text xpos 318 ypos 598 size 20

##  ==================SAVE SCREEN ##

screen save():

    tag menu

    add "gui/background.png"
    add "gui/menus_overlay.png"
    add "gui/bar_overlay.png"
    add "gui/save_overlay.png"

    use file_picker

##  ==================LOAD SCREEN ##

screen load():

    tag menu

    add "gui/background.png"
    add "gui/menus_overlay.png"
    add "gui/bar_overlay.png"
    add "gui/load_overlay.png"

    use file_picker

##  ==================SAVE / LOAD FILE PICKER ##

screen file_picker:
    
    use navigation
    
    imagebutton auto "gui/next_%s.png" xpos 901 ypos 181 focus_mask None action FilePageNext() hover_sound "gui/click.wav"
    imagebutton auto "gui/back_%s.png" xpos 339 ypos 181 focus_mask None action FilePagePrevious() hover_sound "gui/click.wav"
    
    imagebutton auto "gui/file_%s.png" xpos 901 ypos 181 focus_mask None action FileAction(default) hover_sound "gui/click.wav"
    use file_slot
At its current state, the error I get is:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/screens.rpy", line 509, in execute
    screen load():
  File "game/screens.rpy", line 509, in execute
    screen load():
  File "game/screens.rpy", line 518, in execute
    use file_picker
  File "game/screens.rpy", line 522, in execute
    screen file_picker:
  File "game/screens.rpy", line 522, in execute
    screen file_picker:
  File "game/screens.rpy", line 531, in execute
    use file_slot
Exception: Required parameter slot has no value.
"use file_slot" seems to be the problem, but I have no clue how to make it work.

Please send help. :') Thanks.
"The two most important days of your life are
the day you are born, and the day you find out why.
"
[♦] Mark Twain

Post Reply

Who is online

Users browsing this forum: goldo, Google [Bot], Kocker, VESTED