(SOLVED) Help with imagebutton 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
1v0
Newbie
Posts: 2
Joined: Sun Oct 06, 2019 3:37 pm
Contact:

(SOLVED) Help with imagebutton screen

#1 Post by 1v0 » Sun Oct 06, 2019 3:54 pm

Hello I'm trying to make a screen with 4 (for now) imagebuttons. I'm new in renpy, and just followed some tutorials, I might have missed something. Not sure how to fix it.

I'm trying to make a desktop in renpy with the imagebuttons = icons and you click on them to open a program. For this script (tutorial) I need only the blog to be working (third imagebutton) while the other are there to work afther the tutorial

Here is the error

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/intro_desktop.rpy", line 4, in script
    e "I should write my blog"
  File "renpy/common/00library.rpy", line 268, in say
    who(what, interact=interact, *args, **kwargs)
  File "game/screenscustiom.rpy", line 1, in execute
    screen introdesktop():
  File "game/screenscustiom.rpy", line 1, in execute
    screen introdesktop():
  File "game/screenscustiom.rpy", line 2, in execute
    hbox:
  File "game/screenscustiom.rpy", line 5, in execute
    imagebutton:
  File "game/screenscustiom.rpy", line 5, in keywords
    imagebutton:
NameError: name 'null' is not defined

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

Full traceback:
  File "game/intro_desktop.rpy", line 4, in script
    e "I should write my blog"
  File "D:\Renpy\renpy-7.3.2-sdk\renpy\ast.py", line 708, in execute
    renpy.exports.say(who, what, *args, **kwargs)
  File "D:\Renpy\renpy-7.3.2-sdk\renpy\exports.py", line 1343, in say
    renpy.store.say(who, what, *args, **kwargs)
  File "renpy/common/00library.rpy", line 268, in say
    who(what, interact=interact, *args, **kwargs)
  File "D:\Renpy\renpy-7.3.2-sdk\renpy\character.py", line 1142, in __call__
    self.do_display(who, what, cb_args=self.cb_args, **display_args)
  File "D:\Renpy\renpy-7.3.2-sdk\renpy\character.py", line 842, in do_display
    **display_args)
  File "D:\Renpy\renpy-7.3.2-sdk\renpy\character.py", line 591, in display_say
    rv = renpy.ui.interact(mouse='say', type=type, roll_forward=roll_forward)
  File "D:\Renpy\renpy-7.3.2-sdk\renpy\ui.py", line 297, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "D:\Renpy\renpy-7.3.2-sdk\renpy\display\core.py", line 2702, in interact
    repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs)
  File "D:\Renpy\renpy-7.3.2-sdk\renpy\display\core.py", line 3094, in interact_core
    root_widget.visit_all(lambda i : i.per_interact())
  File "D:\Renpy\renpy-7.3.2-sdk\renpy\display\core.py", line 541, in visit_all
    d.visit_all(callback, seen)
  File "D:\Renpy\renpy-7.3.2-sdk\renpy\display\core.py", line 541, in visit_all
    d.visit_all(callback, seen)
  File "D:\Renpy\renpy-7.3.2-sdk\renpy\display\core.py", line 541, in visit_all
    d.visit_all(callback, seen)
  File "D:\Renpy\renpy-7.3.2-sdk\renpy\display\screen.py", line 430, in visit_all
    callback(self)
  File "D:\Renpy\renpy-7.3.2-sdk\renpy\display\core.py", line 3094, in <lambda>
    root_widget.visit_all(lambda i : i.per_interact())
  File "D:\Renpy\renpy-7.3.2-sdk\renpy\display\screen.py", line 440, in per_interact
    self.update()
  File "D:\Renpy\renpy-7.3.2-sdk\renpy\display\screen.py", line 625, in update
    self.screen.function(**self.scope)
  File "game/screenscustiom.rpy", line 1, in execute
    screen introdesktop():
  File "game/screenscustiom.rpy", line 1, in execute
    screen introdesktop():
  File "game/screenscustiom.rpy", line 2, in execute
    hbox:
  File "game/screenscustiom.rpy", line 5, in execute
    imagebutton:
  File "game/screenscustiom.rpy", line 5, in keywords
    imagebutton:
  File "<screen language>", line 8, in <module>
NameError: name 'null' is not defined

Windows-7-6.1.7601-SP1
Ren'Py 7.3.3.568
DVHotel 1.0
Sun Oct 06 22:48:28 2019

And the scripts included in the error

screenscustiom -

Code: Select all


screen introdesktop():
    hbox:
        xalign 0.5
        spacing 5
        imagebutton:
            idle "Cogsresize"
            hover "Cogsresize gover"
            action null
        imagebutton:
            idle "Shop cartresize"
            hover "Shop cartresize h"
            action null
        imagebutton:
            idle "BL resize"
            hover "BL resize h"
            action Jump ("blog")
        imagebutton:
            idle "folder resize"
            hover "folder resize h"
            action null
intro_desktop -

Code: Select all

label lobby_desktop_I:
    scene desktop with fade
    show screen introdesktop
    e "I should write my blog"
Last edited by 1v0 on Sun Oct 06, 2019 4:09 pm, edited 1 time in total.

User avatar
rayminator
Veteran
Posts: 265
Joined: Fri Feb 09, 2018 12:05 am
Projects: Redoing games to fix spelling mistakes other companys that don't care
Location: Canada
Contact:

Re: Help with imagebutton screen

#2 Post by rayminator » Sun Oct 06, 2019 4:05 pm

it should look like this I think that what the documentation says

https://www.renpy.org/doc/html/screen_a ... NullAction

Code: Select all

imagebutton:
            idle "folder resize"
            hover "folder resize h"
            action NullAction()

1v0
Newbie
Posts: 2
Joined: Sun Oct 06, 2019 3:37 pm
Contact:

Re: (SOLVED) Help with imagebutton screen

#3 Post by 1v0 » Sun Oct 06, 2019 4:09 pm

Thank you that worked. I will read that documentation.

Post Reply

Who is online

Users browsing this forum: Majestic-12 [Bot]