[Solved] World maps. Imagemap or screen with imagebuttons?

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
thomas_oak
Newbie
Posts: 19
Joined: Thu Oct 24, 2019 11:28 am
Contact:

[Solved] World maps. Imagemap or screen with imagebuttons?

#1 Post by thomas_oak »

At the moment I have a map of a village with several buildings showing as hotspots on an imagemap. Fairly straightforward.
I would like to have building become hoverable when certain story stages are met. As a novice at programming, I believe showif can only be used in screens. So should I be using imagebuttons for the buildings so as to hide them unless a variable if true? I assume this to be a common thing in games but has me confused.

Any pointers would be appreciated.
Last edited by thomas_oak on Sat Nov 02, 2019 8:51 am, edited 1 time in total.

User avatar
XxrenxX
Veteran
Posts: 267
Joined: Tue Oct 02, 2012 2:40 am
Projects: Chasing
Deviantart: bara-ettie
Location: Canada
Contact:

Re: World maps. Imagemap or screen with imagebuttons?

#2 Post by XxrenxX »

Something like this? If errors someone please comment, not sure if old or newer code since something I put in my project forever ago.

Code: Select all

#In Screen
imagemap:
    hotspot (468,248,114,114) clicked Jump("church") #name of label
    if pub_unlock:
            hotspot  (400,100,250,114) clicked Jump("pub")

init python:
     pub_unlock = False

#In Script before line of unlock
label map:
     $ pub_unlock = True

thomas_oak
Newbie
Posts: 19
Joined: Thu Oct 24, 2019 11:28 am
Contact:

Re: World maps. Imagemap or screen with imagebuttons?

#3 Post by thomas_oak »

Thank you XxrenxX. That was very helpful. I thought it would be something obvious.

Post Reply

Who is online

Users browsing this forum: Google [Bot]