I definetely don't find the mistake. I spent the afternoon on it but it still doesn't work. Same problem : the numbers scroll almost instantly from 9 to 0 (or 5 to 0), and they loop very fast (reset to their max value when they reach 0). The result is fun but not as expected :p
If you can find some time someday to help, it would be great.
No need to hurry on this, I'll work on something else.
This is what I did :Copied the .lua file in a [scripts] folder of my project.
(file Timer_display.lua)
I checked it, read it several times, didn't change anything.
---
Scripts :added the following Definition script
function loadScripts()
local f, cerror
f, cerror = loadfile("./scripts/timer_display.lua")
if f == nil then
print("cerror: " .. cerror)
else
print("Load external scripts")
f()
end
end
---
Scenes :In my first scene, i added these 2 conditions, set to false :
timer_is_on?
timer_is_paused?
---
Interfaces :I want to display the timer in my Options interface.
set to class Options Interface
I have created my own numbers sequence from 0 to 9 (png)
Creation of the following buttons :
day_single
hour_double
hour_single
minute_double
minute_single
second_double
second_single
Creation of the following Values :
sin_day_val
dbl_hour_val
sin_hour_val
dbl_min_val
sin_min_val
dbl_sec_val
sin_sec_val
Each Button :
- is set to Action area
- contains the numbers sequences in the animation tab (dsa, hda, hsa, mda, msa, sda, ssa), from 0 to 9 or 0 to 5 depending on the digit.
(Animations setting : pauses [msec] = 0, infinite loop)
---
Character :Interfaces :
I checked my Options interface
I created 2 new actions :
Action 1 : Load_timer_settings
(called by other action)
>Change condition timer_is_paused? to false
>Change condition timer_is_on? to true
>Execute script load_Scripts()
>Execute script startCountdown()
Action 2 : Check_time
(called by other action)
>If condition timer_is_paused? is false
if condition timer_is_on? is true
pause for 1 second
execute script check_ssd_val()
jump to action part, jump relative, value -4
else
play video YouLose.avi
end if
>end if
---
Scenes :at beginning of the scene, load action :
load_timer_settings