Problems with Imagemaps

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
martinA123_05
Newbie
Posts: 5
Joined: Tue Mar 31, 2020 9:44 pm
Contact:

Problems with Imagemaps

#1 Post by martinA123_05 »

Good night! Again I seek your help. This time, they are the famous ImageMaps.

I'm actually a novice with the Renpy operating system, but I try to learn with tutorials and blogs, however, more than once they fail me.

The problem arises, as I mentioned earlier, when I try to press an access point of the ImageMap and this does not lead me to the corresponding information. For example, I try to modify the main interface of my game, and when I press the button that takes me to the "configuration" the following error occurs.

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "renpy/common/00action_menu.rpy", line 100, in __call__
    raise Exception("%r is not a screen or a label." % orig_screen)
Exception: u'acerca de' is not a screen or a label.

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

Full traceback:
  File "renpy/common/_layout/screen_main_menu.rpym", line 28, in script
    python hide:
  File "C:\Users\Alumno\Desktop\renpy-7.3.5-sdk\renpy\ast.py", line 914, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "C:\Users\Alumno\Desktop\renpy-7.3.5-sdk\renpy\python.py", line 2028, in py_exec_bytecode
    exec bytecode in globals, locals
  File "renpy/common/_layout/screen_main_menu.rpym", line 28, in <module>
    python hide:
  File "renpy/common/_layout/screen_main_menu.rpym", line 35, in _execute_python_hide
    ui.interact()
  File "C:\Users\Alumno\Desktop\renpy-7.3.5-sdk\renpy\ui.py", line 297, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "C:\Users\Alumno\Desktop\renpy-7.3.5-sdk\renpy\display\core.py", line 2702, in interact
    repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs)
  File "C:\Users\Alumno\Desktop\renpy-7.3.5-sdk\renpy\display\core.py", line 3518, in interact_core
    rv = root_widget.event(ev, x, y, 0)
  File "C:\Users\Alumno\Desktop\renpy-7.3.5-sdk\renpy\display\layout.py", line 998, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "C:\Users\Alumno\Desktop\renpy-7.3.5-sdk\renpy\display\layout.py", line 998, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "C:\Users\Alumno\Desktop\renpy-7.3.5-sdk\renpy\display\layout.py", line 998, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "C:\Users\Alumno\Desktop\renpy-7.3.5-sdk\renpy\display\screen.py", line 714, in event
    rv = self.child.event(ev, x, y, st)
  File "C:\Users\Alumno\Desktop\renpy-7.3.5-sdk\renpy\display\layout.py", line 998, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "C:\Users\Alumno\Desktop\renpy-7.3.5-sdk\renpy\display\layout.py", line 998, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "C:\Users\Alumno\Desktop\renpy-7.3.5-sdk\renpy\display\layout.py", line 998, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "C:\Users\Alumno\Desktop\renpy-7.3.5-sdk\renpy\display\behavior.py", line 962, in event
    return handle_click(self.clicked)
  File "C:\Users\Alumno\Desktop\renpy-7.3.5-sdk\renpy\display\behavior.py", line 897, in handle_click
    rv = run(action)
  File "C:\Users\Alumno\Desktop\renpy-7.3.5-sdk\renpy\display\behavior.py", line 320, in run
    return action(*args, **kwargs)
  File "renpy/common/00action_menu.rpy", line 100, in __call__
    raise Exception("%r is not a screen or a label." % orig_screen)
Exception: u'acerca de' is not a screen or a label.

Windows-8-6.2.9200
Ren'Py 7.3.5.606
my_question 1.0
Sun Apr 05 00:26:06 2020
This is the code I worked with

imagemap:
ground "GUI/mm/mm_ground.png"
idle "GUI/mm/mm_idle.png"
hover "GUI/mm/mm_hover.png"

# This is so that everything transparent is invisible to the cursor.

hotspot (#, #, #, #) action Start()
hotspot (#, #, #, #) action ShowMenu("load")
hotspot (#, #, #, #) action ShowMenu("preferences")
hotspot (#, #, #, #) action ShowMenu("bonus")
hotspot (#, #, #, #) action Help()
hotspot (#, #, #, #) action Quit(confirm=False)

And this is the code that I wrote in "screen.rpy"
imagemap:

ground "images/ground_lol.png"
idle "images/idle.png"
hover "images/hover.png"

# Esto es para que todo lo transparente sea invisible para el cursor.

hotspot (11, 156, 222, 61) action Start ()
hotspot (11, 232, 224, 56) action ShowMenu ("acerca de")
hotspot (14, 307, 220, 60) action ShowMenu ("Ayuda")
hotspot (11, 381, 218, 62) action Quit (confirm = False)


Everything is fine, the image changes when the cursor is over it, but it does not take me to the corresponding information.

I would seriously appreciate your help and guidance in this situation. I wait for your answers, I wish you good night <3

User avatar
korova
Veteran
Posts: 217
Joined: Sat Jun 27, 2009 5:15 pm
Completed: Ivy, Chocolate, Time, Clair Obscur
Projects: Writing exercises, The House [Nano18]
Tumblr: korova08
itch: korova
Location: Normandie, France
Contact:

Re: Problems with Imagemaps

#2 Post by korova »

Do you have a menu/screen or a label in your code called "Ayuda" or "acerca de" ? (that's what is complainig about I think)

User avatar
isobellesophia
Miko-Class Veteran
Posts: 979
Joined: Mon Jan 07, 2019 2:55 am
Completed: None
Projects: Maddox and Friends! (AI Teacher friend), Friendly Universities! (Soon)
Organization: Friendly Teachers series
Deviantart: SophBelle
itch: Child Creation
Location: Philippines, Mindanao
Contact:

Re: Problems with Imagemaps

#3 Post by isobellesophia »

make a label or a screen. That'll do easily.
I am a friendly user, please respect and have a good day.


Image

Image


rayminator
Miko-Class Veteran
Posts: 793
Joined: Fri Feb 09, 2018 12:05 am
Location: Canada
Contact:

Re: Problems with Imagemaps

#4 Post by rayminator »

this what it should look like and make sure you put the underline _ if there is a blank space

Code: Select all

hotspot (11, 232, 224, 56) action ShowMenu("acerca_de")

Code: Select all

label acerca_de: or screen acerca_de:

martinA123_05
Newbie
Posts: 5
Joined: Tue Mar 31, 2020 9:44 pm
Contact:

Re: Problems with Imagemaps

#5 Post by martinA123_05 »

korova wrote: Sun Apr 05, 2020 4:19 am Do you have a menu/screen or a label in your code called "Ayuda" or "acerca de" ? (that's what is complainig about I think)
I think there is not! Is that I copied as it was on the internet, could you explain me how to do it :(?

User avatar
isobellesophia
Miko-Class Veteran
Posts: 979
Joined: Mon Jan 07, 2019 2:55 am
Completed: None
Projects: Maddox and Friends! (AI Teacher friend), Friendly Universities! (Soon)
Organization: Friendly Teachers series
Deviantart: SophBelle
itch: Child Creation
Location: Philippines, Mindanao
Contact:

Re: Problems with Imagemaps

#6 Post by isobellesophia »

rayminator already explained above, along with the code.
I am a friendly user, please respect and have a good day.


Image

Image


rayminator
Miko-Class Veteran
Posts: 793
Joined: Fri Feb 09, 2018 12:05 am
Location: Canada
Contact:

Re: Problems with Imagemaps

#7 Post by rayminator »

this is also wrong by the way

Code: Select all

hotspot (11, 156, 222, 61) action Start ()
hotspot (11, 232, 224, 56) action ShowMenu ("acerca de")
hotspot (14, 307, 220, 60) action ShowMenu ("Ayuda")
hotspot (11, 381, 218, 62) action Quit (confirm = False)
there shouldn't be a space between

Start ()
ShowMenu ("acerca de")
ShowMenu ("Ayuda")
Quit (confirm = False)

should be like this

Code: Select all

hotspot (11, 156, 222, 61) action Start()
hotspot (11, 232, 224, 56) action ShowMenu("acerca_de")
hotspot (14, 307, 220, 60) action ShowMenu("Ayuda")
hotspot (11, 381, 218, 62) action Quit(confirm = False)

martinA123_05
Newbie
Posts: 5
Joined: Tue Mar 31, 2020 9:44 pm
Contact:

Re: Problems with Imagemaps

#8 Post by martinA123_05 »

rayminator wrote: Mon Apr 06, 2020 10:27 am this is also wrong by the way

Code: Select all

hotspot (11, 156, 222, 61) action Start ()
hotspot (11, 232, 224, 56) action ShowMenu ("acerca de")
hotspot (14, 307, 220, 60) action ShowMenu ("Ayuda")
hotspot (11, 381, 218, 62) action Quit (confirm = False)
there shouldn't be a space between

Start ()
ShowMenu ("acerca de")
ShowMenu ("Ayuda")
Quit (confirm = False)

should be like this

Code: Select all

hotspot (11, 156, 222, 61) action Start()
hotspot (11, 232, 224, 56) action ShowMenu("acerca_de")
hotspot (14, 307, 220, 60) action ShowMenu("Ayuda")
hotspot (11, 381, 218, 62) action Quit(confirm = False)


Ohh! thanks!

Post Reply

Who is online

Users browsing this forum: apocolocyntose, Bing [Bot], trailsiderice