Help

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
Skyleft
Newbie
Posts: 23
Joined: Wed Feb 11, 2015 4:52 pm
Contact:

Help

#1 Post by Skyleft » Wed Feb 11, 2015 4:55 pm

Hello.
I'm using imagemap to create a map of a city.
I want to make the possible choice to go to somewhere, witch I already did.
But now I have a problem.
If I pick park, on the park I want another button to go back to the map.
I could make the same, and if you click the go back button, the map image appears. But that would create an infinite bucle, because in that map I'd have to program everything again.
So my question is, how do I make to when I pick the go back button, go back to the first map.

User avatar
deliciumartis
Regular
Posts: 30
Joined: Mon Feb 09, 2015 11:32 am
Location: shadowland
Contact:

Re: Help

#2 Post by deliciumartis » Wed Feb 11, 2015 5:14 pm

You could set up a label and clicking the "go back" button resets the switch and switches the view back the map. I'm not familiar with how you've set your calls up so I'm not sure on an exact answer.
"What bothers me is, nothin' does."
--The dixie flatline

Skyleft
Newbie
Posts: 23
Joined: Wed Feb 11, 2015 4:52 pm
Contact:

Re: Help

#3 Post by Skyleft » Wed Feb 11, 2015 5:24 pm

Sorry I'm a complete noob to this, but I'm pretty sure that's what I want.
Could you please explain it to me?..

User avatar
deliciumartis
Regular
Posts: 30
Joined: Mon Feb 09, 2015 11:32 am
Location: shadowland
Contact:

Re: Help

#4 Post by deliciumartis » Wed Feb 11, 2015 5:35 pm

Okay, easy enough. Start with your variable.

Code: Select all

$ location == "None"
then in your label that gets called after the button is clicked and $ location is supposed to change you can put:

Code: Select all

##stuff before the variable change
$ location == "Park"
##stuff after the variable change, such as calling the new screen or label or image or what have you.
finally, on your go back button:

Code: Select all

##setting the location variable back to it's base so it can be changed again.
$ location == "None"
##then whatever else you have in your label function that happens, such as the call or jump back to the label or screen with your map.
"What bothers me is, nothin' does."
--The dixie flatline

Skyleft
Newbie
Posts: 23
Joined: Wed Feb 11, 2015 4:52 pm
Contact:

Re: Help

#5 Post by Skyleft » Wed Feb 11, 2015 6:10 pm

I'm sorry to sound this noob, but when I try that (I've been trying for a few time) it keeps saying that name 'location' is not defined

User avatar
deliciumartis
Regular
Posts: 30
Joined: Mon Feb 09, 2015 11:32 am
Location: shadowland
Contact:

Re: Help

#6 Post by deliciumartis » Wed Feb 11, 2015 6:15 pm

okay, put your code segments in between the code tags and I'll have a closer look, or you can pm them to me. I'll see if I can find the issue.
"What bothers me is, nothin' does."
--The dixie flatline

Skyleft
Newbie
Posts: 23
Joined: Wed Feb 11, 2015 4:52 pm
Contact:

Re: Help

#7 Post by Skyleft » Wed Feb 11, 2015 6:46 pm

I PMd you, but anyway

Code: Select all

$ result = renpy.imagemap("p1.png", "p2.png", [
        (46, 392, 132, 471, "left"),
        (370, 307, 444, 379, "pass"),
        (682, 394, 756, 464, "right"),
        ], focus="imagemap")
        
if result == "pass":
    show bg 2
 #I'd like to here, put a image and when you click on it, it goes back to the beginning to choose left, pass and right again.
elif result == "left":
    $ result2 = renpy.imagemap("pp1.png", "p111.png", [
        (85, 51, 220, 204, "poster"),
        (307, 324, 429, 385, "suitcase"),
        (516, 315, 662, 388, "pass"),
        ], focus="imagemap")
if result2 == "pass":
    y "text"
elif result == "right":
  "

Post Reply

Who is online

Users browsing this forum: No registered users