Mario Noriega Posted July 2, 2021 Report Posted July 2, 2021 Hello! So, I set up a more complex control setup for my buttons. It includes a macro to set som LVars that are then passed via the new WASM FSUIPC module. All works fine, except that if I press the same button again, nothing happens. In general terms, I have some buttons that set a L:variable to 1, then code inside the aircraft performs some actions and sets it back to zero. Pressing the button again results in the aircraft reverting what was done previously and resetting the L:Variable to zero. These are basically toggle buttons. The problem: FSUIPC ignores the second button press, unless I press another button (linked to a different L:Var) first. This also means that setting "repeat while held" does not work (as used for a pushbutton that disengages when released). That said, the flexibility of the system is excellent! This is mainly intended as a suggestion for future improvements. Best Regards, Mario N.
John Dowson Posted July 2, 2021 Report Posted July 2, 2021 Hi Mario, 1 hour ago, Mario Noriega said: All works fine, except that if I press the same button again, nothing happens. In general terms, I have some buttons that set a L:variable to 1, then code inside the aircraft performs some actions and sets it back to zero. Pressing the button again results in the aircraft reverting what was done previously and resetting the L:Variable to zero. These are basically toggle buttons. The problem: FSUIPC ignores the second button press, unless I press another button (linked to a different L:Var) first. I'm not sure I fully understand this. Could you explain an actual use case, i.e. which lvar and which aircraft? This may be due to the way client data areas function - if the data doesn't change (i.e. writing the same data, lvar +value) a second time won't be registered. There was a similar issue recently related to executing calculator code - if you executed the same code twice, the second would be ignored. I got around this by sending a dummy calc code request after each one requested, just to reset the CDA. I probably need to do something similar for the various other CDAs that FSUIPC uses, i.e. to set lvars and activate hvars. I will look into this next week, but a concrete example would help. Thanks, John
Mario Noriega Posted July 2, 2021 Author Report Posted July 2, 2021 Hello Again, Well, the aircraft is unreleased! It is C-22J Ventura for MSFS, currently available only for FS-X/P3D/FS9. (Do not try to investigate using the previous versions, as the MSFS edition is totally different!) Below a line from the macro: 1=L:LMAST_TOGGLE=Set,1 Every time (L:MAST_TOGGLE,bool) is set to 1, the aircraft code starts the L engine, or shuts it down depending on the current state. (L:MAST_TOGGLE,bool) is immediately reset to zero after starting the internal algorithm (programmed within the model behaviours XML). Another use case: 5=L:LVENT_PRESS=Set,1 This mtime, (L:LVENT_PRESS,bool) is supposed to operate a momentary button. Again, when set to 1, code in the A/C model behaviours XML is set into action. The code dry-cranks the engine until the LVar is released to zero. But since repeat does not work, it only flashes for an instant (I however could fix this by simply not having it reset in the code and having FSUIPC setting it to zero upon release). Hope this helps, however your description of how the CDAs work matches with my confusing description of an otherwise simple issue 🙂 Thanks again for all the hard work!
John Dowson Posted July 3, 2021 Report Posted July 3, 2021 Hi Mario, could you try the attached version please, v7.2.2b: FSUIPC7.exe Thanks, John
Mario Noriega Posted July 3, 2021 Author Report Posted July 3, 2021 Works a charm! THanks for the ridiculously fast update!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now