Imagemap to Screen Converter

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
PyTom
Ren'Py Creator
Posts: 15893
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Imagemap to Screen Converter

#1 Post by PyTom » Sun Oct 10, 2010 1:53 pm

I've put together a quick web service that converts old-style imagemap-based Ren'Py layouts to new-style screens. You can access it at:

http://dev.renpy.org:6112

This is totally experimental - I don't have any imagemaps to test with, so I haven't even tried the generated code. It's also pretty fragile - it works on the examples I tried it on, but it will likely crash horribly on more complex code.

It's also running on my home PC - so it may go up and down. (Especially when I upgrade to the new ubuntu.) If you need it and it's not there, bug me.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
Mikan
Veteran
Posts: 364
Joined: Sun Dec 23, 2007 12:20 am
Contact:

Re: Imagemap to Screen Converter

#2 Post by Mikan » Sun Oct 10, 2010 1:58 pm

NO WAY! No more guessing coordinates???

User avatar
PyTom
Ren'Py Creator
Posts: 15893
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Imagemap to Screen Converter

#3 Post by PyTom » Sun Oct 10, 2010 2:45 pm

Well, the image location picker is what helps with guessing coordinates. I'm also considering a graphical screen maker, but that probably won't be for a while.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

Melkoshi
Regular
Posts: 156
Joined: Tue Jun 02, 2009 8:56 pm
Projects: Jewels of Sytinane
Location: U.s.a.
Contact:

Re: Imagemap to Screen Converter

#4 Post by Melkoshi » Sun Oct 10, 2010 5:28 pm

Seems to be down atm, but I really like this idea! I'm still having a hard time getting used to the new screen language, so this will kinda help me see how a > b.
--- My DeviantArt.
Game in Progress for demo-teaser:
story(script) = 45%
sprites = 100%
programming(interface) = 35%
CGs = 0%
Backgrounds = 5%
Music/sound = 0%

User avatar
PyTom
Ren'Py Creator
Posts: 15893
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Imagemap to Screen Converter

#5 Post by PyTom » Sun Oct 10, 2010 6:43 pm

Ah, I forgot to poke the hole in my firewall. It should be up now.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
mugenjohncel
Hentai Poofter
Posts: 2117
Joined: Sat Feb 04, 2006 11:13 pm
Organization: Studio Mugenjohncel
Location: Philippines
Contact:

Re: Imagemap to Screen Converter

#6 Post by mugenjohncel » Thu Oct 14, 2010 5:05 am

This very convenient... but I did encountered some bumps...

I have this code before...

Code: Select all

layout.imagemap_preferences(
        "gui/preferences_ground.png",
        "gui/preferences_idle.png",
        "gui/preferences_hover.png",
        "gui/preferences_selected_idle.png",
        "gui/preferences_selected_hover.png",
        [
            (340, 91, 434, 140, "Window"),
            (454, 91, 547, 140, "Fullscreen"),
            (340, 190, 434, 237, "None"),
            (454, 190, 547, 237, "All"),
            (73, 494, 255, 544, "Joystick"),
            (340, 289, 434, 366, "Stop Skipping"),
            (454, 289, 547, 366, "Keep Skipping"),
            (340, 388, 434, 435, "Seen Messages"),
            (454, 388, 547, 435, "All Messages"),
            (375, 456, 513, 516, "Begin Skipping"),
            (55, 84, 275, 111, "Music Volume"),
            (55, 146, 275, 173, "Sound Volume"),
            (55, 208, 275, 235, "Voice Volume"),
            (55, 393, 275, 419, "Auto-Forward Time"),
            (55, 326, 275, 353, "Text Speed"),
            (607, 244, 758, 289, "Return"),
            (607, 298, 758, 342, "Save Game"),
            (607, 352, 758, 397, "Load Game"),
            (607, 406, 758, 450, "Preferences"),
            (607, 460, 758, 504, "Main Menu"),
            (607, 514, 758, 559, "Quit"),
            ])  
Then I got this code...

Code: Select all

screen preferences:
    tag menu

    imagemap:
        ground 'gui/preferences_ground.png'
        idle 'gui/preferences_idle.png'
        hover 'gui/preferences_hover.png'
        selected_idle 'gui/preferences_selected_idle.png'
        selected_hover 'gui/preferences_selected_hover.png'

        hotspot (340, 91, 94, 49) action Preference('display', 'window')
        hotspot (454, 91, 93, 49) action Preference('display', 'fullscreen')
        hotspot (340, 190, 94, 47) action Preference('transitions', 'none')
        hotspot (454, 190, 93, 47) action Preference('transitions', 'all')
        hotspot (73, 494, 182, 50) action Preference('joystick')
        hotspot (340, 289, 94, 77) action Preference('after choices', 'stop')
        hotspot (454, 289, 93, 77) action Preference('after choices', 'skip')
        hotspot (340, 388, 94, 47) action Preference('skip', 'seen')
        hotspot (454, 388, 93, 47) action Preference('skip', 'all')
        hotspot (375, 456, 138, 60) action Preference('begin skipping')
        hotspot (55, 84, 220, 27) action Preference('music volume')
        hotspot (55, 146, 220, 27) action Preference('sound volume')
        hotspot (55, 208, 220, 27) action Preference('voice volume')
        hotspot (55, 393, 220, 26) action Preference('auto-forward time')
        hotspot (55, 326, 220, 27) action Preference('text speed')
        hotspot (607, 244, 151, 45) action Return()
        hotspot (607, 298, 151, 44) action ShowMenu('save')
        hotspot (607, 352, 151, 45) action ShowMenu('load')
        hotspot (607, 406, 151, 44) action ShowMenu('preferences')
        hotspot (607, 460, 151, 44) action MainMenu()
        hotspot (607, 514, 151, 45) action Quit()
The preferences is loading properly except the sliders are no longer functioning and when you attempt to click it or move it you get this error...

Code: Select all

I'm sorry, but an uncaught exception occurred.

TypeError: 'FieldValue' object is not callable

While running game code:
 - script at line 784 of renpy-6.11.0/common/00library.rpy
 - python at line 788 of renpy-6.11.0/common/00library.rpy.
 - script at line 11 of /home/tom/ab/renpy/common/_layout/screen_preferences.rpym

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

  File "F:\renpy-6.11.0\renpy\bootstrap.py", line 252, in bootstrap
  File "F:\renpy-6.11.0\renpy\main.py", line 310, in main
  File "F:\renpy-6.11.0\renpy\main.py", line 93, in run
  File "F:\renpy-6.11.0\renpy\execution.py", line 250, in run
  File "F:\renpy-6.11.0\renpy\ast.py", line 567, in execute
  File "F:\renpy-6.11.0\renpy\python.py", line 957, in py_exec_bytecode
  File "renpy-6.11.0/common/00library.rpy", line 788, in <module>
  File "F:\renpy-6.11.0\renpy\game.py", line 297, in call_in_new_context
  File "F:\renpy-6.11.0\renpy\execution.py", line 250, in run
  File "F:\renpy-6.11.0\renpy\ast.py", line 567, in execute
  File "F:\renpy-6.11.0\renpy\python.py", line 957, in py_exec_bytecode
  File "/home/tom/ab/renpy/common/_layout/screen_preferences.rpym", line 11, in <module>
  File "F:\renpy-6.11.0\renpy\ui.py", line 216, in interact
  File "F:\renpy-6.11.0\renpy\display\core.py", line 1607, in interact
  File "F:\renpy-6.11.0\renpy\display\core.py", line 2152, in interact_core
  File "F:\renpy-6.11.0\renpy\display\layout.py", line 651, in event
  File "F:\renpy-6.11.0\renpy\display\transition.py", line 45, in event
  File "F:\renpy-6.11.0\renpy\display\layout.py", line 651, in event
  File "F:\renpy-6.11.0\renpy\display\layout.py", line 651, in event
  File "F:\renpy-6.11.0\renpy\display\screen.py", line 287, in event
  File "F:\renpy-6.11.0\renpy\display\layout.py", line 651, in event
  File "F:\renpy-6.11.0\renpy\display\layout.py", line 651, in event
  File "F:\renpy-6.11.0\renpy\display\behavior.py", line 564, in event
  File "F:\renpy-6.11.0\renpy\display\behavior.py", line 364, in run
TypeError: 'FieldValue' object is not callable

While running game code:
 - script at line 784 of renpy-6.11.0/common/00library.rpy
 - python at line 788 of renpy-6.11.0/common/00library.rpy.
 - script at line 11 of /home/tom/ab/renpy/common/_layout/screen_preferences.rpym

Ren'Py Version: Ren'Py 6.11.0l
Please help...

"Puppy eyes" (Sits down like a good puppy)

User avatar
sake-bento
Eileen-Class Veteran
Posts: 1909
Joined: Sat Jan 26, 2008 5:58 pm
Completed: http://sakevisual.com/games.html
Projects: Every Sunrise, Shinsei
Organization: sakevisual
Tumblr: sakevisual
Deviantart: sakevisual
itch: sakevisual
Contact:

Re: Imagemap to Screen Converter

#7 Post by sake-bento » Sat Oct 16, 2010 8:31 pm

I tried converting the main menu, and it worked beautifully save for the "Help" button. It calls action Start('Help') instead of opening up the help file that comes packaged with the default game.
Figured out you need to change the line to action Help()

The preferences screen doesn't seem to use the "ground" image supplied. If I access the preferences from the main menu, things like "save" and "main" use the idle image instead of the ground image.
Edit: Added as a bug report, since I think it's Ren'py and not the converter.

Is there a way to make a background image for the main menu that sticks when I access other screens? My yes_no screen doesn't cover the entire screen (it looks like a popup window), so when I try to close the game from the main menu, the background defaults to the grey checkerboard. I'd like the background for main menu to stay when the yes_no prompt appears.

And a quick bug report for the converter: it outputs

Code: Select all

Preference('begin skipping)
instead of

Code: Select all

Preference('begin skipping')
Works in such a lovely way on everything else, and this has made things so much easier on me. Thank you very much!

User avatar
DaFool
Lemma-Class Veteran
Posts: 4171
Joined: Tue Aug 01, 2006 12:39 pm
Contact:

Re: Imagemap to Screen Converter

#8 Post by DaFool » Sun Oct 24, 2010 2:44 am

I have a silly question... why is it when I replace my layout.imagemap_main_menu (which works) with the screen main_menu, the game just ignores the menu and proceeds directly to start? I have removed all reference from theme roundrect and have tried init:, init-2, and just plain top-level indentations for screen main_menu.


tpgames
Regular
Posts: 53
Joined: Wed Jun 16, 2010 11:29 pm
Projects: Jade Universität
Contact:

Re: Imagemap to Screen Converter

#10 Post by tpgames » Thu Feb 10, 2011 3:05 pm

It may be that he upgraded to the new Ubuntu and the link no longer works. I tried it just now because I found some code that uses the old ren'py I think, but not sure, as I can't remember what the old stuff looked like. I'm just not running on all cylinders which was why I was going to try it in the first place. I miss Ubuntu and hope to get my Ubuntu computer with the new used mobo as soon as the weather warms up a little.
Kyteroo jaunting off....(won't add website until I've finished 1 Ren'Py game)
WIP: Jade Universität - A RPG puzzle game.

User avatar
PyTom
Ren'Py Creator
Posts: 15893
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Imagemap to Screen Converter

#11 Post by PyTom » Thu Feb 10, 2011 5:44 pm

I've put this back up. The problem is stupid - I don't really want to find a permanent place to host this, so it just runs on my desktop, and when I reboot, it stops working until I restart it.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

tpgames
Regular
Posts: 53
Joined: Wed Jun 16, 2010 11:29 pm
Projects: Jade Universität
Contact:

Re: Imagemap to Screen Converter

#12 Post by tpgames » Thu Feb 10, 2011 7:10 pm

Thanks for putting it back up. I realized that I was looking at lines I forgot to delete which made my code 100% new with a couple lines of old in two different places that didn't belong at all. But, I'm sure others still trying to get their scripts caught up, will find it useful. :lol:
Kyteroo jaunting off....(won't add website until I've finished 1 Ren'Py game)
WIP: Jade Universität - A RPG puzzle game.

User avatar
chensterrain
Veteran
Posts: 225
Joined: Sun Oct 26, 2008 2:01 am
Completed: Lucky Rabbit Reflex!, Dusk ~A Moonlight Romance~
Projects: Edge of Elsewhere
Organization: Super63
Tumblr: supersixthree
Deviantart: chensterrain
Location: London, UK
Contact:

Re: Imagemap to Screen Converter

#13 Post by chensterrain » Sun Jun 12, 2011 3:19 am

Sorry for bumping an old topic, but is there any way this could be put back up? (unless it already is up, and it's just down because it's late in the US :( sorry!)

User avatar
PyTom
Ren'Py Creator
Posts: 15893
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Imagemap to Screen Converter

#14 Post by PyTom » Sun Jun 12, 2011 9:21 am

It's back up.

(Memo to self, for next time - this lives in /home/tom/2010/imconvert)
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

Post Reply

Who is online

Users browsing this forum: Google [Bot]