Help NCalc Formula
Hello, I need help for the "When formula is True" formula in NCalc. What should this formula look like? I would like to display a checkered flag with the help of this formula in order to control an LED with "animation". But I can't find a solution. I tried the following formula:
"if ([Flag_Checkered] = 1,1,0)" and also
"if ([Flag_Checkered], 1,0)"
however, neither work. How does the formula have to be correct?
if ([Flag_Checkered], 1, 0)
if ([Flag_Checkered] == 1, 1, 0)
Would both correct syntax wise, but actually do nothing as the property value is already 0 or 1.
many thanks for your response.
But unfortunately I don't understand, I'm too stupid. Which effect should I combine that with?
I use RGB Leds. There is no [Flag_Checkered] option under "Add Effect" (only other flags such as "BlueFlag on" for example). So I wanted to create a "Custom formula", here "When formula is true" (you can choose this effect there).
But this is not possible with any "if" formula. Unfortunately, [Flag_Checkered] alone does not work either.
Please show me an example for the application of the "When formula is true" effect, or how I can use the formula you mentioned [Flag_Checkered] for RGB Leds.
"When the formula is true" is a group. You need to put at least one effect (static led, gradient or animation) inside.
The visisibility of the contained effect(s) will be controlled by the formula of the "When the formula is true" group.
Alternatively, for a single and simple effect you can use "Custom fomulas status led" or "Custom fomulas gradient" and have the formula directly in the effect.
Also note that the [Flag_Checkered] property does not work with every game. It depends on the data offered by the game.
I know that an effect under the "When formula is true" must be used, but the formula still does not work. I have now tried both of the solutions you gave (here with a white flag because it can be checked in the Test Data Editor) Both options do not work! There is no reaction with the Test Date Editor!
This is not a valid test.
The data tester is meant to test built in effects.
It doesn't affect the property value itself.
If a custom flag effect doesn't trigger, try monitoring the property value while in game to see if it updates.
Not all properties work with every game.
I will test ist!
the application of a "Custom Formulas Status LED" has now worked.
Still nothing can be created with "When Formula is True". Nothing at all. There is absolutely no output that can be achieved using this formula. Not even the subsequent effect. There is just no reaction no matter what I do.
Therefore the question again, how is this formula used correctly? Maybe someone has an example in which he uses the formula.
many thanks for the examples and the file. It works now. 👍
Although I don't understand why! I did everything exactly as in your example. Only I didn't have the "When formula is true" as a group.
Still, thank you very much for your help! 😀