Hi! I ran into an issue when using the palettefade function, i don’t know if i’m calling it incorrectly or if it’s related to how it interacts with other parts of the script(s).
This is the relevant part (i think) of the deck-level script (the palettes are also defined at this level, i don’t think they’re the culprit since everything worked fine when i only used setpalette):
#changes palette depending on the time of day
if t.value=1
pf.setpalette[deck morningpalette]
elseif t.value=2
pf.palettefade[deck morningpalette noonpalette 60]
elseif t.value=3
pf.palettefade[deck noonpalette sunsetpalette 60]
else
pf.palettefade[deck sunsetpalette nightpalette 60]
end
t:choice.widgets.time
#makes time pass(called after spending time at any location)
on timepass do
t.value:t.value+1
end
and this is the script of one of the cards where the problem occurs:
on view do
if !visited.value
visited.value:1
sleep[60]
dd.open[deck (r).speed:3]
dd.say[scripts.widgets.city.value]
dd.close[]
end
end
The card’s script seems to run correctly, but something weird happens when i click on the button (on the same card) with the following script:
on click do
timepass[]
dd.open[deck (r).speed:3]
dd.say["Let's go back."]
dd.close[]
if city_seen.value & beach_seen.value & forest_seen.value
go["night" "SlideLeft"]
else
go["choice" "SlideLeft"]
end
end
i think something goes wrong as soon as timepass[] is called, because right after clicking the button nothing seems to happen but the script keeps running, it just stays like this until i stop it manually:
Am i accidentally creating some sort of event loop (possibly with the animate event)? (?)
Thanks in advance! :>