After various tests, the variable and the array seem to work. The variable changes from 0 to 1 when I use the button, and the array displays morning, afternoon, and evening if I manually put in the numbers 0, 1 or 2. But, if I use "time_day"[timevar]" it doesn't refresh, it always stays in the morning(if I manually change the timevar to start at 1 it displays the afternoon).
This is the array and variables of the time and the script to change it.
Code: Select all
define timevar = 0 ## These are time of the day - 1 = Morning, 2 = Afternoon, 3 = Evening
define time_day = ["Morning","Afternoon","Evening"]
################################################################################
# SCRIPT
################################################################################
label time_change:
if timevar == 2: #This change the day
$ timevar = 0
else:
$timevar +=1
Code: Select all
screen map_screen():
add "map.png" # This is the town map image
modal True # Clicking won't advance the dialogue
vbox:
xpos 14
ypos 17
vbox:
text time_day[timevar] #This doesn't update when timevar changes it
text "[timevar]" #This does change when I click the button
text [time_day[1]] #This displays afternoon but if I change it it can display everything
hbox:
xalign 0.99
ypos 5
if timevar == 0:
imagebutton auto "gui/map/store_%s.png" action [Jump("shop_prologue")] xpos 679 ypos 170 #This is the button that changes the time on the next code
Code: Select all
label start:
$ map_return = "start"
call screen map_screen
with fade
window hide
pause
label shop_prologue:
$ map_return = "shop_prologue"
call time_change
"Hi"
jump start
return