display narration text is working fine for me. I also employed the same loop as the text update for updating the time every 1 second. In theory I suppose you could use this action for updating the playtime in an external file too by reading the current time adding it into a value & then writing the new value plus 1. It's technically possible to split seconds into hh:mm format.
here's a little function I just wrote for converting seconds to hh:mm:ss format...
local h, m, s
function secs2hms(v)
h = math.floor(v / 3600)
m = math.floor(v % 3600 / 60)
s = math.floor(v % 3600 % 60)
-- + --
print( h .. ":" .. m .. ":" .. s )
end
...currently it just prints the value to the log file but you could simply replace the print line with a line that updates the value of a string. So technically you can use the same value for both the integer & string value. Inside of a loop you just have it increase said value by 1 every second & then have it update the string value straight after it, which will update the display narration text value on its next loop & voila you have a simple playtime counter.
![wink wink](https://images.siteface.net/_js/BBCEditor/icons/smiley-wink.png)
Also here's another function for converting time. This one converts seconds into dd:hh:mm:ss format.
local d, h, m, s
function secondsToTime(v)
d = math.floor(v / 86400)
h = math.floor(v % 86400 / 3600)
m = math.floor(v % 3600 / 60)
s = math.floor(v % 3600 % 60)
-- + --
print( d .. ":" .. h .. ":" .. m .. ":" .. s )
end
...mental note: there are 86400 seconds in a day (apparently) & there are 3600 seconds in an hour, as there are 60 seconds in a minute. Thank bugrit there are lots of conversion calculators & examples on the internet as my math skills are terrible!
![grin grin](https://images.siteface.net/_js/BBCEditor/icons/smiley-grin.png)