Bug description:
A weird one.
When using the ‘neg’ operation on an LVar within an Asobo_GT_Update, the operation sometimes fails. I have tried -1 * and a variety of other workarounds, but always seem to reach the same wall. It appears other calculations carried out on that execution work correctly but the sign change has been skipped.
I am using this sign change to control custom vibration animations in the CAS J3, which uses more custom code in GT_Update than is sensible, but it also appears with the most basic instance below.
In the ‘Variables’ window of the ‘Behaviours’ window, observe that the sign change sometimes (in batches) fails, appearing as the sign change frequency reducing.
Please let me know if you have any trouble replicating this issue.
Thanks again for all your efforts and help, wishing you all a great holiday season.
Your (L:VAR) neg (>L:VAR) is flipping the sign on that L:VAR up to 60 times/sec so it might be random what you’re reading. Another minor technical detail that could become relevant is I’ve never checked in RPN whether +0 and -0 are the same value - sounds odd but it’s a common systems quirk that those can be different. I don’t think that matters with the code as-is though.
Minor additional point: I tend to keep the ASOBO_GT_Update simple with a single code block including the init and the update, as otherwise you’d need to look carefully at the Asobo templates source to work out what those simple-looking templates are actually doing. The underlying FSX/MSFS RPN capability is incredibly simple (and efficient) but that requires the templates to rely heavily on simple string substitution of your RPN code inside blocks of Asobo RPN code.
Thanks for your reply, your comment about the 60hz refresh on that update prompted me to investigate a bit more regarding the frequency. What I now believe is happening is not random sampling but the GT_update occasionally synchronising with the framerate (which in my case is around 35 FPS) such that it appears in the same position every time. Strange that this logical bug wasn’t noticeable in MSFS2020.
Thanks all, I’ll move this thread out of bug reports and into discussion.