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

Help

#1 Post by Skyleft »

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 loop, 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.
Last edited by Skyleft on Sun Dec 22, 2019 1:05 pm, edited 1 time in total.

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

Re: Help

#2 Post by deliciumartis »

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

Re: Help

#3 Post by Skyleft »

I'm pretty sure that's what I want.
Could you please explain it to me?
Last edited by Skyleft on Sun Dec 22, 2019 1:05 pm, edited 1 time in total.

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

Re: Help

#4 Post by deliciumartis »

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

Re: Help

#5 Post by Skyleft »

When I try that it keeps saying that name 'location' is not defined
Last edited by Skyleft on Sun Dec 22, 2019 1:06 pm, edited 1 time in total.

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

Re: Help

#6 Post by deliciumartis »

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

Re: Help

#7 Post by Skyleft »

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