[SOLVED] Snowblossom plus imagemap on main menu using 6.12

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
World
Newbie
Posts: 3
Joined: Sat Feb 04, 2012 2:28 pm
Contact:

[SOLVED] Snowblossom plus imagemap on main menu using 6.12

#1 Post by World »

Hello, I seem to have royally confused the code of my game.

I started out making my game with an old version of Renpy with a different way of making screens and imagemaps. I decided to move everything over to stay updated (but mostly because I wanted a music room), and now I'm running into some problems getting used to the new ways of doing things...

First of all, my main menu has both an imagemap and snowblossom. With the new "Renpy screens" using the preset buttons, it obviously worked fine. But when I tried to use an imagemap like so:

Code: Select all

        hotspot (652, 318, 787, 365)action Start()
        hotspot (652, 368, 787, 421) action ShowMenu('load')
        hotspot (652, 426, 799, 514) action ShowMenu('preferences')
        hotspot (636, 472, 540, 353) action Help()
        hotspot (652, 516, 789, 553) action ShowMenu("music_room")
        hotspot (672, 559, 770, 594) action Quit(confirm=False) 
The imagemap worked great, but Snowblossom would no longer work.

I then tried to make parts of my imagemap transparent, but I couldn't get that to work either. It just showed the ground-level buttons with no menu picture in the background.

Finally, I checked this thread: http://lemmasoft.renai.us/forums/viewto ... f=4&t=4677 And did this:

Code: Select all

        mm_root = Fixed(
        Image("titlescreen.png"),
        SnowBlossom("snow3.png", count=70, xspeed=(15, 35), yspeed=(55, 75), start=10)),    layout.imagemap_main_menu("menunull.png", "menuhover.png", [
        (652, 318, 787, 365, "Start Game"),
        (652, 368, 787, 421, "Load Game"),
        (660, 423, 772, 466, "Preferences"),
        (643, 469, 798, 512, "Help"),
        (652, 516, 789, 553, "music_room"),
        (672, 559, 770, 594, "Quit"),
        ])
Imagemap and snowblossoms worked like an absolute charm! BUT... I can no longer get to my music room, the game just crashes and shuts down without a traceback, and all the Renpy help pages are centered around using the new code, not the old one. :(

If someone could tell me how to get snowblossoms to work, or how to get my music room imagemap function to work, that'd be swell.

Also, using this code above, no sound effect plays upon clicking the working buttons on the imagemap. If I continue to use this code, how do I give it a "clicking" sound?

Any help would be greatly appreciated. This is driving me crazy.
Last edited by World on Sat Feb 04, 2012 9:16 pm, edited 1 time in total.

Mild Curry
Regular
Posts: 107
Joined: Fri Jul 02, 2010 3:03 pm
Projects: That's The Way The Cookie Crumbles
Organization: TwinTurtle Games
Contact:

Re: Snowblossom plus imagemap on main menu using 6.12

#2 Post by Mild Curry »

Screen-based imagemaps cover everything else on screen by default. (makes them so difficult to work with >_<)

Try defining the animation inside the imagemap, like this.

Code: Select all

imagemap:
   
  add SnowBlossom("snow3.png", count=70, xspeed=(15, 35), yspeed=(55, 75), start=10))

  #define ground/hover images and hotspots

User avatar
World
Newbie
Posts: 3
Joined: Sat Feb 04, 2012 2:28 pm
Contact:

Re: Snowblossom plus imagemap on main menu using 6.12

#3 Post by World »

Just the way you had it?

Code: Select all

    imagemap:
        add SnowBlossom("snow3.png", count=70, xspeed=(15, 35), yspeed=(55, 75), start=10))
        ground 'menunull.png'
        hover 'menuhover.png'
        
        hotspot (652, 318, 787, 365)action Start()
        hotspot (652, 368, 787, 421) action ShowMenu('load')
        hotspot (652, 426, 799, 514) action ShowMenu('preferences')
        hotspot (636, 472, 540, 353) action Help()
        hotspot (652, 516, 789, 553) action ShowMenu("music_room")
        hotspot (672, 559, 770, 594) action Quit(confirm=False) 
No, it won't boot. Without "add Snowblossom(etc..)" it boots, but once it's added, it doesn't boot at all with no traceback. Are you sure "add" is the right code...?

-------
EDIT:

Wow, I'm not sure what happened, but when I added the # sign, it miraculously worked. Which confuses me and makes literally no sense, but hey. I have no idea what's going on but it does, music room and everything. That exact code. I promise it wasn't working before, but now it does, so there we go.

So... Thank you so much! :D I really, really appreciate it.

However, clicking noises still aren't working. Any ideas on how to fix it?

Mild Curry
Regular
Posts: 107
Joined: Fri Jul 02, 2010 3:03 pm
Projects: That's The Way The Cookie Crumbles
Organization: TwinTurtle Games
Contact:

Re: Snowblossom plus imagemap on main menu using 6.12

#4 Post by Mild Curry »

Hmm...toss this at the bottom of 'options.rpy'.

Code: Select all

style.hotspot.activate_sound = "mysound.wav"

User avatar
World
Newbie
Posts: 3
Joined: Sat Feb 04, 2012 2:28 pm
Contact:

Re: Snowblossom plus imagemap on main menu using 6.12

#5 Post by World »

Beautiful! Worked like a charm. Thank you so very much! :D

User avatar
gas
Miko-Class Veteran
Posts: 842
Joined: Mon Jan 26, 2009 7:21 pm
Contact:

Re: [SOLVED] Snowblossom plus imagemap on main menu using 6.

#6 Post by gas »

Maybe it doesn't worked before due to the DAMNED extra parenthesis at line end c_C? I say that just 'cause it's a very good resource, and do "past/copy" can mislead people :D. Tried with

Code: Select all

add SnowBlossom("snow3.png", count=70, xspeed=(15, 35), yspeed=(55, 75), start=10) 
and worked FINE from the start. The error was the double parenthesis after start=10. You can remove the #COMMENT safely.
If you want to debate on a reply I gave to your posts, please QUOTE ME or i'll not be notified about. << now red so probably you'll see it.

10 ? "RENPY"
20 GOTO 10

RUN

Post Reply

Who is online

Users browsing this forum: Sugar_and_rice