Issues With Modifying The Save Screen

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
Braydxne
Regular
Posts: 50
Joined: Tue Aug 08, 2017 4:03 am
Projects: DR: Chains of Trust
Contact:

Issues With Modifying The Save Screen

#1 Post by Braydxne » Tue Aug 08, 2017 4:41 pm

Yesterday I began re-doing the menu using imagemaps with viewtopic.php?f=51&t=14237 this tutorial. It was going very well up until I began the save/load menu. Here is the code I'm using:

Code: Select all

screen load_save_slot():
      $ file_name = FileSlotName(i, columns * rows)
      $ file_time = FileTime(i, empty=_("Empty Slot."))
      $ save_name = FileSaveName(i)
      text "[file_name]. [file_time!t]\n[save_name!t]"


      add FileScreenshot(number) xpos 61 ypos 69
      text file_text xpos 215 ypos 92 size 18 color "#261d0c"

screen file_picker():

    imagemap:
        ground "gui/slground.png"
        idle "gui/slidle.png"
        hover "gui/slhover.png"
        selected_idle "gui/slidle.png"

        hotspot (625, 8, 36, 49) clicked FilePage(1)
        hotspot (678, 8, 38, 48) clicked FilePage(2)
        hotspot (732, 7, 44, 49) clicked FilePage(3)
        hotspot (787, 7, 50, 50) clicked FilePage(4)
        hotspot (842, 5, 49, 51) clicked FilePage(5)
        hotspot (903, 7, 42, 51) clicked FilePage(6)
        hotspot (957, 7, 44, 49) clicked FilePage(7)
        hotspot (1015, 8, 41, 49) clicked FilePage(8)
        hotspot (1072, 5, 39, 52) clicked FilePage(9)
        hotspot (1129, 10, 75, 47) clicked FilePage(10)

        hotspot (858, 98, 400, 201) clicked FileAction(1):
            use load_save_slot(number=1)
        hotspot (858, 307, 400, 198) clicked FileAction(2):
            use load_save_slot(number=2)
        hotspot (858, 514, 401, 196) clicked FileAction(3):
            use load_save_slot(number=3)

        hotspot (1206, 1, 74, 72) action Return()



screen save():
    use file_picker
    add "gui/slidle.png"

screen load():
    use file_picker
    add "gui/slidle.png"

init -2 python:
    style.file_picker_frame = Style(style.menu_frame)

    style.file_picker_nav_button = Style(style.small_button)
    style.file_picker_nav_button_text = Style(style.small_button_text)

    style.file_picker_button = Style(style.large_button)
    style.file_picker_text = Style(style.large_button_text)
    config.thumbnail_width = 75
    config.thumbnail_height = 42
and here is the issue I'm getting back:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/screens.rpy", line 592, in execute
    screen load():
  File "game/screens.rpy", line 592, in execute
    screen load():
  File "game/screens.rpy", line 593, in execute
    use file_picker
  File "game/screens.rpy", line 558, in execute
    screen file_picker():
  File "game/screens.rpy", line 558, in execute
    screen file_picker():
  File "game/screens.rpy", line 560, in execute
    imagemap:
  File "game/screens.rpy", line 577, in execute
    hotspot (858, 98, 400, 201) clicked FileAction(1):
  File "game/screens.rpy", line 578, in execute
    use load_save_slot(number=1)
Exception: Too many arguments in call (expected 0, got 1).

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

Full traceback:
  File "lib/windows-i686/_layout/screen_main_menu.rpymc", line 28, in script
  File "C:\Users\easyhome\Downloads\renpy-6.99.12.4-sdk\renpy\ast.py", line 814, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "C:\Users\easyhome\Downloads\renpy-6.99.12.4-sdk\renpy\python.py", line 1719, in py_exec_bytecode
    exec bytecode in globals, locals
  File "renpy/common/_layout/screen_main_menu.rpym", line 30, in <module>
    ui.interact()
  File "C:\Users\easyhome\Downloads\renpy-6.99.12.4-sdk\renpy\ui.py", line 285, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "C:\Users\easyhome\Downloads\renpy-6.99.12.4-sdk\renpy\display\core.py", line 2538, in interact
    scene_lists.replace_transient()
  File "C:\Users\easyhome\Downloads\renpy-6.99.12.4-sdk\renpy\display\core.py", line 822, in replace_transient
    self.remove(layer, tag)
  File "C:\Users\easyhome\Downloads\renpy-6.99.12.4-sdk\renpy\display\core.py", line 1107, in remove
    self.hide_or_replace(layer, remove_index, "hide")
  File "C:\Users\easyhome\Downloads\renpy-6.99.12.4-sdk\renpy\display\core.py", line 1031, in hide_or_replace
    d = oldsle.displayable._hide(now - st, now - at, prefix)
  File "C:\Users\easyhome\Downloads\renpy-6.99.12.4-sdk\renpy\display\screen.py", line 443, in _hide
    self.update()
  File "C:\Users\easyhome\Downloads\renpy-6.99.12.4-sdk\renpy\display\screen.py", line 578, in update
    self.screen.function(**self.scope)
  File "game/screens.rpy", line 592, in execute
    screen load():
  File "game/screens.rpy", line 592, in execute
    screen load():
  File "game/screens.rpy", line 593, in execute
    use file_picker
  File "game/screens.rpy", line 558, in execute
    screen file_picker():
  File "game/screens.rpy", line 558, in execute
    screen file_picker():
  File "game/screens.rpy", line 560, in execute
    imagemap:
  File "game/screens.rpy", line 577, in execute
    hotspot (858, 98, 400, 201) clicked FileAction(1):
  File "game/screens.rpy", line 578, in execute
    use load_save_slot(number=1)
  File "C:\Users\easyhome\Downloads\renpy-6.99.12.4-sdk\renpy\ast.py", line 134, in apply
    raise Exception("Too many arguments in call (expected %d, got %d)." % (len(self.positional), len(args)))
Exception: Too many arguments in call (expected 0, got 1).

Windows-8-6.2.9200
Ren'Py 6.99.12.4.2187
Danganronpa A New Chapter 1.0
I hope I can get some help, as I have no idea what too do! I'd really love to have a nice looking custom menu!

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: Issues With Modifying The Save Screen

#2 Post by Remix » Tue Aug 08, 2017 10:08 pm

From the log

screen load_save_slot(): <--- no parameters in definition

whereas the calls 'use load_save_slot(number=...)' try to pass a param
Frameworks & Scriptlets:

User avatar
skyeworks
Regular
Posts: 84
Joined: Thu Jul 27, 2017 11:36 am
Projects: K9-11
itch: skyefrost
Contact:

Re: Issues With Modifying The Save Screen

#3 Post by skyeworks » Wed Aug 09, 2017 12:39 am

Why does your code have () randomly?
in here:
screen load_save_slot():


screen file_picker():

screen save():

screen load():
I looked at my code used from that tutorial and at the tutorial itself and they both don't have those parentheses. I think it's just that somehow you got some extra () in there. (noob though.)
Image

User avatar
Braydxne
Regular
Posts: 50
Joined: Tue Aug 08, 2017 4:03 am
Projects: DR: Chains of Trust
Contact:

Re: Issues With Modifying The Save Screen

#4 Post by Braydxne » Wed Aug 09, 2017 3:55 am

The solution was so simple... Thank you so much for your help! However, none of the hotspots are working and the save-images don't show up. This is the code set up for the hotspots

Code: Select all

screen file_picker:

    imagemap:
            ground "gui/slground.png"
            idle "gui/slidle.png"
            hover "gui/slhover.png"
            selected_idle "gui/slidle.png"

            hotspot (625, 11, 31, 45) clicked FilePage(1)
            hotspot (678, 8, 38, 48) clicked FilePage(2)
            hotspot (732, 7, 44, 49) clicked FilePage(3)
            hotspot (787, 7, 50, 50) clicked FilePage(4)
            hotspot (842, 5, 49, 51) clicked FilePage(5)
            hotspot (903, 7, 42, 51) clicked FilePage(6)
            hotspot (957, 7, 44, 49) clicked FilePage(7)
            hotspot (1015, 8, 41, 49) clicked FilePage(8)
            hotspot (1072, 5, 39, 52) clicked FilePage(9)
            hotspot (1129, 10, 75, 47) clicked FilePage(10)

            hotspot (858, 98, 400, 201) clicked FileAction(1):
                use load_save_slot(number=1)
            hotspot (858, 307, 400, 198) clicked FileAction(2):
                use load_save_slot(number=2)
            hotspot (858, 514, 401, 196) clicked FileAction(3):
                use load_save_slot(number=3)

            hotspot (1206, 1, 74, 72) action Return()

User avatar
skyeworks
Regular
Posts: 84
Joined: Thu Jul 27, 2017 11:36 am
Projects: K9-11
itch: skyefrost
Contact:

Re: Issues With Modifying The Save Screen

#5 Post by skyeworks » Wed Aug 09, 2017 11:37 am

Braydxne wrote:
Wed Aug 09, 2017 3:55 am
The solution was so simple... Thank you so much for your help! However, none of the hotspots are working and the save-images don't show up. This is the code set up for the hotspots
This is probably why (I have two theories:) I think you blocked yourself from the hotspots.


First is this code here in your first code thingy:

Code: Select all

screen save:
    use file_picker
    add "gui/slidle.png"

screen load:
    use file_picker
    add "gui/slidle.png"
You basically just reused the image for this part when You're supposed use different image.

so the point of

Code: Select all

add  "gui/load.png" 
and

Code: Select all

add "gui/Save.png" 
It's a picture of a word that said "save/load " so that the save screen would look different from the load screen... (cause they use the same graphic) If you add the idle screen instead, it probably covered up your hotspots. Fuck, that's sounds confusing as hell.
Example cause I don't word good. (using my project)
Image + Image = Image
===================Load.png================================Slidle.png================================All together
See the picture on the left? It's just a transparent image that is as big as slidle.png and it's goes On Top the other screen. This way Whenever people save, they see the word save and whenever they load they see the word load. The image in the middle is my slidle. So yeah, you're basically blocking yourself from the hotspots.

This is my first theory....and I forgot my second....freck. I'll reply later if it doesn't work. Quote me so I'll get a notification. :D
Image

User avatar
Pyr0
Newbie
Posts: 20
Joined: Mon Aug 07, 2017 4:34 pm
Contact:

Re: Issues With Modifying The Save Screen

#6 Post by Pyr0 » Wed Aug 09, 2017 4:37 pm

skyeworks wrote:
Wed Aug 09, 2017 12:39 am
I looked at my code used from that tutorial and at the tutorial itself and they both don't have those parentheses. I think it's just that somehow you got some extra () in there. (noob though.)
Providing screen statements with round brackets even if they take no parameters is good for optimization as detailed here

User avatar
Braydxne
Regular
Posts: 50
Joined: Tue Aug 08, 2017 4:03 am
Projects: DR: Chains of Trust
Contact:

Re: Issues With Modifying The Save Screen

#7 Post by Braydxne » Wed Aug 09, 2017 7:56 pm

skyeworks wrote:
Wed Aug 09, 2017 11:37 am
Braydxne wrote:
Wed Aug 09, 2017 3:55 am
The solution was so simple... Thank you so much for your help! However, none of the hotspots are working and the save-images don't show up. This is the code set up for the hotspots
This is probably why (I have two theories:) I think you blocked yourself from the hotspots.


First is this code here in your first code thingy:

Code: Select all

screen save:
    use file_picker
    add "gui/slidle.png"

screen load:
    use file_picker
    add "gui/slidle.png"
You basically just reused the image for this part when You're supposed use different image.

so the point of

Code: Select all

add  "gui/load.png" 
and

Code: Select all

add "gui/Save.png" 
It's a picture of a word that said "save/load " so that the save screen would look different from the load screen... (cause they use the same graphic) If you add the idle screen instead, it probably covered up your hotspots. Fuck, that's sounds confusing as hell.
Example cause I don't word good. (using my project)
Image + Image = Image
===================Load.png================================Slidle.png================================All together
See the picture on the left? It's just a transparent image that is as big as slidle.png and it's goes On Top the other screen. This way Whenever people save, they see the word save and whenever they load they see the word load. The image in the middle is my slidle. So yeah, you're basically blocking yourself from the hotspots.

This is my first theory....and I forgot my second....freck. I'll reply later if it doesn't work. Quote me so I'll get a notification. :D
It worked perfectly! Thank you for all your help!

User avatar
skyeworks
Regular
Posts: 84
Joined: Thu Jul 27, 2017 11:36 am
Projects: K9-11
itch: skyefrost
Contact:

Re: Issues With Modifying The Save Screen

#8 Post by skyeworks » Wed Aug 09, 2017 8:08 pm

Pyr0 wrote:
Wed Aug 09, 2017 4:37 pm
skyeworks wrote:
Wed Aug 09, 2017 12:39 am
I looked at my code used from that tutorial and at the tutorial itself and they both don't have those parentheses. I think it's just that somehow you got some extra () in there. (noob though.)
Providing screen statements with round brackets even if they take no parameters is good for optimization as detailed here
Oh cool! Thank you for telling me! Always great to learn things! :D
Image

User avatar
skyeworks
Regular
Posts: 84
Joined: Thu Jul 27, 2017 11:36 am
Projects: K9-11
itch: skyefrost
Contact:

Re: Issues With Modifying The Save Screen

#9 Post by skyeworks » Wed Aug 09, 2017 11:39 pm

Braydxne wrote:
Wed Aug 09, 2017 7:56 pm

It worked perfectly! Thank you for all your help!
You welcome! Us noobs gotta stick together....I'm trying to learn to do the pref. screen and it's waaaaay too hard for me. (I have to because otherwise it wouldn't match with the save/load and other screens.)
Image

Post Reply

Who is online

Users browsing this forum: Google [Bot], Ocelot