I am very new at renpy and I am trying to create scenes that change with the time of day along with a map on each scene that allows the player to navigate from a part of a town to another in a first person style.
For example, one scene is a train station and has up to four representations: dawn, dusk, day and night. From there the player can go to main street or enter the hotel across the street.
Here are two of these images: .
Now that works very well in my code. The image gets picked depending on the time of the day. However when I hover over a "gate" to another part of the town. I will get this on the first hover:
Notice that the scene is dawn as it should be here. But the hotspots are still displayed with the night image. After the first hover everything gets back to normal and the image is good again. Currently I am using the same image for the "hover" and the "ground" and it might stay that way.
-Is there a way to assign a null image to the "hover" or a blank fully transparent one that will not need to be updated?
-Is this cache related and if so can that hover be pushed out of the cache in any way?
-any other suggestion to fix this?
Here's the code:
Code: Select all
screen trainstation_map:
#default tt = Tooltip("No button selected.")
default map_info = ""
imagemap:
ground "bg trainstation [dayperiod].jpg"
hover "bg trainstation [dayperiod].jpg"
hotspot (394, 333, 147, 160) hovered SetScreenVariable('map_info',"Main St") unhovered SetScreenVariable('map_info',"") clicked Return("mainstreet")
hotspot (209, 358, 112, 131) hovered SetScreenVariable('map_info',"Hotel") unhovered SetScreenVariable('map_info',"") clicked Return("hotel")
hbox:
xalign 0.5
yalign 0.5
text map_info
label train_station:
call dayp(0.5) #increment the time and figure out if it is day or night
$renpy.scene()
$renpy.show('bg trainstation ' + dayperiod)
if "trainstation" not in visited:
"The hotel is right in front of a small deserted train station. A few steps back, running parallel to the track, is what looks like mainstreet"
$ visited.add("trainstation")
$ roundedtime=int(math.floor(time))
"I am by the hotel and the train station, The time is [roundedtime], you have been here for [day] days"
call screen trainstation_map
$whereto = _return
if whereto == "mainstreet":
jump main_street
jump train_station
Florent