Help with conditionals

Hi!

I want to create an element that is visible between 15 and 45 minutes of every hour, so I want to combine 2 conditions:
($(#Dm#+(#Ds#/60))>=15?100:0$)
($(#Dm#+(#Ds#/60))<=45?100:0$)

Each of them on it’s own works, but when I combine them:
($(#Dm#+(#Ds#/60))<=45?($(#Dm#+(#Ds#/60))>=15?100:0$):0$)
They constantly give “0”.

Any ideas what I am doing wrong?

Hey Mellin I always melt my brain on those long string mult operator math statements (and they never work). I would just load your element twice. Have one appear at 15 and the other at 45.
John

But that is not what I want.
I want 1 (or whatever much more) element that is visible only between 15 and 45.
I already have other elements that show up 0-15 and 45-60.

Oh I see BETWEEN. I’m not in front of the docs right now but believe the double && if what you need. Something like

$#your-tag-math#>=15&&#your-tag-math#<=45?100:0$

Don’t use the outer parenthesis on these if-then’s with the dollar signs.

John

1 Like

I’ve done a similar thing, but with seconds. You can see how it works here Ray Hope - Fighter Jet HUD Moving Target - watch face for Apple Watch, Samsung Gear S3, Huawei Watch, and more - Facer

The 4 F-18 images cycle through in a minute

Here is the code I used:

$#Ds#>=15&&#Ds#<30?100:0$
$#Ds#>=30&&#Ds#<45?100:0$
$#Ds#>=45&&#Ds#<60?100:0$

Cheers
Ray

Hey @Mellin,

First of all, I believe (#Ds#/60) will always be between 0 and 1, so it doesn’t make much difference here (or did I miss something?

Anyways, on Creator, this seem to work (again, unless I missed the main purpose of your condition) :smile:
$(#Dm#+(#Ds#/60))>=15&&(#Dm#+(#Ds#/60))<=45?100:0$

Let me know if it helps,
Cheers,
P.

Thank you all for your ideas!

I used a simpler (in my opinion) way:
Rotation: $(#Dm#+(#Ds#/60))>=15?(((((#DK#+((#Dm#+(#Ds#/60))/60))-(floor(#DK#/1)*1))*120)-180)+120):180$
transparency: $(#Dm#+(#Ds#/60))<=45?100:0$

1 Like