I'm using the formula for the progress bar (level time) formula:
However I'm struggling to adapt it to nightime... Any ideas?
If you can explain a bit what you want to see in the progress, in day and night, is best to try to help with this. You can create a Custom progress bar to see the progress of the light to darkness, but what you want is important to help.
I'm using the previous formula to see the progress bar of the sun.
However trying to obtain a same progress bar, but for the nighttime ONLY. So the bar will progress sincedsundown until the sunrise.
The issue is that if I try to reverse thw formula I get negative numbers ...
Basically what I'm asking is anyone can re-engineer this formula to get a night time until sunrise in the form of 0 to 100?
Hi I think that the most simple way to make this is using the light and the darkness in minutes ,and make the progress with the minutes to the Sunset and Sunrise.
With this in mind,I think this codes can work.
You need to create a progress bar, Custom, and put this :
$if(ai(isday)=0 , tf(ai(sunrise, a1d) - ai(sunset), M),tf(ai(sunset) - ai(sunrise),M))$
$if(ai(isday)=0,tf(ai(nsunrise), M),tf(ai(sunset), M))$
This are going to put in the Max the time of light and darkness, the level are moving by the time remaining to sunrise and sunset, because this is in reverse, you can adapt the progress bar by rotating it or playing with the colors.👍
Thank you for your reply.
Meanwhile I've been using the below formula successfully, for the level value. . With min 0 and max 100 along with hidden the layer during daylight and seems working well.
$100 / (ai(nsunrise) - ai(nsunset, r1d)) * (dp(a0d) - ai(nsunset, r1d))$
Good that you find a solution😃👍. I put this formula too, because no many users know that they can set the Min and the Max of a Progress Bar with formulas or codes, and don't need to divide and multiply by 100 every formula.👍👌
Thanks a lot for your help. 👍