Imagemap Question (after making a decision)

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
forsety
Newbie
Posts: 3
Joined: Mon Oct 26, 2015 6:07 am
Contact:

Imagemap Question (after making a decision)

#1 Post by forsety » Mon Oct 26, 2015 6:15 am

I know I'm going to get a lot of flack for being new to coding in general, but I just picked Ren'py up yesterday, and I really want to make this small visual novel to work.

My Problem: The caption background still appears when showing the imagemap on the 2nd time. The first time, there's no dark highlight. Clicking on it still works, but the background used for the main text or the character's dialogue annoys the heck out of me.

Code: Select all

   m "Why am I even complaining, though? It's already 7AM, and I should get going...the alarm just went off, it's about time to head to school."
    call screen schoolmap  
    window hide None
    window show None
    if _return == "Dorm":
        ">You went to the dorm." 
        
        
    m "Well, I don't know why I'm back at the dorm..."
    menu:
        "Look around":
            "I could stay in, but I shouldn't. I have a class to go to... Maybe, I should check my room one more time to see if I forgot anything."
        "Go back to school":
            m "Well, time to head back. That was pointless."
            m "I need to go to Mr. J's class. I don't need to be late, especially since I've been doing so well lately!"
            jump backtoschool
    
    label backtoschool:
    call screen schoolmap
    window hide None
    window show None
And here's what's bothering me to end any confusion:
Image

philat
Eileen-Class Veteran
Posts: 1853
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: Imagemap Question (after making a decision)

#2 Post by philat » Mon Oct 26, 2015 6:49 am

forsety wrote:

Code: Select all

    m "Why am I even complaining, though? It's already 7AM, and I should get going...the alarm just went off, it's about time to head to school."
    call screen schoolmap  ## call automatically dismisses the textbox. Unless you're doing something wonky, there's no need for window show/hide. The fact that you use window show here may actually be why the window isn't dismissed when it otherwise would be, although I haven't tested it to double check.

    if _return == "Dorm":
        jump wenttodorm ## I'm assuming that the player can choose other places, in which case it probably makes more sense to have all of the dorm related stuff under one label

label wenttodorm:
    ">You went to the dorm." 

    m "Well, I don't know why I'm back at the dorm..."

    menu lookatdorm: ## menus can be named and jumped to like labels
        "Look around":
            "I could stay in, but I shouldn't. I have a class to go to... Maybe, I should check my room one more time to see if I forgot anything."
            jump lookatdorm ## I'm assuming that you want to jump back to the menu after seeing this dialogue, rather than fall through to the next block
        "Go back to school":
            m "Well, time to head back. That was pointless."
            m "I need to go to Mr. J's class. I don't need to be late, especially since I've been doing so well lately!"
            call screen schoolmap ## rather than jumping to a label that doesn't seem to do anything else, I would think it makes more sense to just call the map here directly, although you can, of course, jump to a different label. As a tip, the way you have it set up, you did not need to jump to backtoschool, because the menu would fall through to that label anyway.
Comments in the code using hashtags. Your indentation is also slightly off in a lot of places, which can make things weird. Labels and screens should generally start at the top level (i.e., unindented).

forsety
Newbie
Posts: 3
Joined: Mon Oct 26, 2015 6:07 am
Contact:

Re: Imagemap Question (after making a decision)

#3 Post by forsety » Mon Oct 26, 2015 8:34 am

Thanks! I fixed it, but I also have a new question regarding the imagemap, again.
What if I want to have different dialogues at different points of time in the same area?
For example: If I clicked on Parking Lot, the mc doesn't want to go there, so she simply says "I don't want to go there."
After a few classes take place, she finally decides its time to go to the Parking Lot? And when you click on it it should take her to that area.

I've been using "Label Parkinglot:" two times, and obviously it won't let me define it 2x... So how can I go around that?

philat
Eileen-Class Veteran
Posts: 1853
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: Imagemap Question (after making a decision)

#4 Post by philat » Mon Oct 26, 2015 8:49 am

Use an if condition within the label. http://www.renpy.org/doc/html/condition ... -statement

Post Reply

Who is online

Users browsing this forum: Bing [Bot]