flyboy340 Posted March 4 Report Posted March 4 I have been using the fantastic FSUIPC 7 in MSFS2020 for some time now and have managed to create lots of “commands” using LVARs in myevents.txt and then map them to buttons in the sim. After creating many commands for several other aircraft, toggles, on or off and dimmers etc, I am now having an issue with an Auto-reset LVAR in the Inibuilds A350 INI_CKPT_LT_DU_MASTER_BRT_INC or INI_CKPT_LT_DU_MASTER_BRT_DEC. I can’t seem to get anything to work as the code resets before altering anything. Any advice would be much appreciated
John Dowson Posted March 4 Report Posted March 4 So it looks like those lvars are acting like a control/event - you set it to 1, this triggers the brightness increase or decrease and then the lvar gets reset back to 0. If you want to inc / dec again, you can set it to 1 again. Does it not work like that? If not, ask on the Inbuilds forums on how those lvars are supposed to work. I don't have this aircraft so cannot take a look here, sorry. John
flyboy340 Posted March 4 Author Report Posted March 4 7 minutes ago, John Dowson said: So it looks like those lvars are acting like a control/event - you set it to 1, this triggers the brightness increase or decrease and then the lvar gets reset back to 0. If you want to inc / dec again, you can set it to 1 again. Does it not work like that? If not, ask on the Inbuilds forums on how those lvars are supposed to work. I don't have this aircraft so cannot take a look here, sorry. John Many thanks for the very quick reply. When I use it in myevents.txt, the line is DU_MasterBright_Bright# (>L:INI_CKPT_LT_DU_MASTER_BRT_INC, bool) and nothing happens, so I will try setting 1
John Dowson Posted March 4 Report Posted March 4 2 minutes ago, flyboy340 said: DU_MasterBright_Bright# (>L:INI_CKPT_LT_DU_MASTER_BRT_INC, bool) and nothing happens, so I will try setting 1 Yes, you will need to give it a value...probably also a good idea to use repeat when assigning to that preset as well.
flyboy340 Posted March 4 Author Report Posted March 4 13 minutes ago, John Dowson said: Yes, you will need to give it a value...probably also a good idea to use repeat when assigning to that preset as well. I have just tried that and unfortunately, it does not work (incl a repeat). When you turn the knob with a mouse you can see the LVAR go to 1 and straight back to zero. So in theory I thought a value of 1 would do it.
John Dowson Posted March 4 Report Posted March 4 35 minutes ago, flyboy340 said: When you turn the knob with a mouse you can see the LVAR go to 1 and straight back to zero. So in theory I thought a value of 1 would do it. Yes, that sounds correct, as that lvar is documented as a BOOL. I have no idea why it isn't controlling the brightness. When you inc/dev the brightness in the VC, do you see the lvar change value (and reset)? As I said earlier, you should ask on the InBuilds support forums as I do not have this a/c.
flyboy340 Posted March 4 Author Report Posted March 4 39 minutes ago, John Dowson said: Yes, that sounds correct, as that lvar is documented as a BOOL. I have no idea why it isn't controlling the brightness. When you inc/dev the brightness in the VC, do you see the lvar change value (and reset)? As I said earlier, you should ask on the InBuilds support forums as I do not have this a/c. Just to confirm the line in myevents.txt is DU_MasterBright_Bright#1 (>L:INI_CKPT_LT_DU_MASTER_BRT_INC, bool) & I tried DU_MasterBright_Bright# (>L:INI_CKPT_LT_DU_MASTER_BRT_INC, bool) 1 I also tried number instead of bool. I also tried the repeat checkbox. When I change the brightness using the mouse in the VC, with Dev Mode, behaviours window open, I can see the value go from 1 to 0 As you say, I will have to try the iniBuilds support forum
John Dowson Posted March 4 Report Posted March 4 52 minutes ago, flyboy340 said: When I change the brightness using the mouse in the VC, with Dev Mode, behaviours window open, I can see the value go from 1 to 0 Just from 1 to 0? Not from 0 to 1 to 0, or from 1 to 0 to 1? As it auto-resets, it should change to 1 value then back again (or to 0 then back again)... Maybe try: DU_MasterBright_Bright#(L:INI_CKPT_LT_DU_MASTER_BRT_INC, bool) ! (>L:INI_CKPT_LT_DU_MASTER_BRT_INC, bool)
flyboy340 Posted March 4 Author Report Posted March 4 16 minutes ago, John Dowson said: Just from 1 to 0? Not from 0 to 1 to 0, or from 1 to 0 to 1? As it auto-resets, it should change to 1 value then back again (or to 0 then back again)... Maybe try: DU_MasterBright_Bright#(L:INI_CKPT_LT_DU_MASTER_BRT_INC, bool) ! (>L:INI_CKPT_LT_DU_MASTER_BRT_INC, bool) Yeah, it works! Many many thanks
John Dowson Posted March 4 Report Posted March 4 14 minutes ago, flyboy340 said: Yeah, it works! Many many thanks 👍
flyboy340 Posted March 5 Author Report Posted March 5 16 hours ago, John Dowson said: Just from 1 to 0? Not from 0 to 1 to 0, or from 1 to 0 to 1? As it auto-resets, it should change to 1 value then back again (or to 0 then back again)... Maybe try: DU_MasterBright_Bright#(L:INI_CKPT_LT_DU_MASTER_BRT_INC, bool) ! (>L:INI_CKPT_LT_DU_MASTER_BRT_INC, bool) Many thanks for your help John. Just one last question to help me understand some very basic coding. What does the ! do in the above statement? As I understand the first part in brackets calls the LVAR and the 2nd part in brackets writes it, but still unsure what the clever little ! does? I really do appreciate your time as I know you are busy. I have tried internet searches and reading manuals, but to no avail.
John Dowson Posted March 5 Report Posted March 5 The ! symbol is the logical not operator so !TRUE is FALSE, and !FALSE is TRUE (or, in RPN, TRUE! is FALSE, and FALSE! is TRUE. So the expression (L:someLvar, bool) ! (>L:someLvar, bool) flips/toggles the value of the lvar, i.e. changes it from TRUE to FALSE or from FALSE to TRUE. John Also explained here: https://docs.flightsimulator.com/flighting/html/Additional_Information/Reverse_Polish_Notation.htm Quote Logical Operators !, NOT Logical NOT. 1 (L:Val) ! (>L:Val) Toggles the variable Val. &&, AND Logical AND. 2 (L:Val) 0xFF00 && (>L:Val) The variable Val is ANDed with the hexadecimal value 0xFF00 ||, OR Logical OR. 2 (L:Val) 135046 OR (>L:Val) The variable Val is ORed with 135046 1
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