While I was trying to bug fix some FT code with no avail, I turned to man himself--WNP78--and got some useful information that I felt you all might like to know.
Here's what he says about OR operator behavior:
If the first argument of an OR is true, it will just return true without checking the second argument
This implies that frame-update functions like that of sum, smooth, rate (i.e. time based functions) will NOT update if it is part of the second argument, leading to inconsistencies if you're trying to use the "same function" compared across multiple OR operators.
For example, in the code sum(Time) > 1 | sum(2*Time) > 1
, while sum(Time) > 1
, sum(2*Time)
will not update (not change). Keep this in mind while designing functions. If you need to use OR in conjunction, try to use boolean algebra instead, that is, try to figure a numerical comparison method instead of logic-based.
Hope this helps any stumped coders!
This is the same for and, ie if the first expression comes out as false, it knows the result will be false so doesn't waste time checking the second operand. The only other place similar behaviour place is observed is in the ternary operator - only the selected expression will be evaluated.
ok this makes sense now. I was trying to use smooth on something and it didnt work for a while
really useful info, this explains why my automated airbrakes didn't get overrid by manual control because the manual control was on the second bracket...
@SnoWFLakE0s it was like
(blah blah 1200 character funky tree code that works) * clamp(-Activate7, 0.5, 1)
and it ignored the clamp(-Activate7, 0.5, 1) at the end and it just did the (blah blah 1200 character funky tree code that works) bit like the last bit wasn't there@AN2Felllla
.
Check your brackets. FT tries to auto-complete if possible, sounds like that might be the case. Are you using implicit multiplication as well?
2 days ago I had an issue where I was trying to make a long equation activate at half with activate 7 on and operate at full with activate 7 off. (
clamp(-Activate7, 0.5, 1)
). For some reason, putting this at the end of the equation (which was surrounded in brackets) had no effect on the equation, but putting it at the start made it work fine, despite the only difference being the location...le thinking cap has arrived
Thank you for the flashbacks to my weedout CS class where we had to deal with this sort of stuff using C.
r/Simple Planes
Reddit/Simple Planes
Lets do that
So we can help pep
That are having trouble of
Coding
My answer: yes
I have no idea what that means but ok!
I long to be at a level in funky trees where this would be a problem I would come across
I am Kong Fused