Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hello all,

I'm about to finish my home cockpit, but I'm still missing some of the codes to make the momentary switches work. I understand some of the switches Carenado is using have their own code. Has anyone here had success using  L:Var Macro for the momentary buttons/switches like the test button for Engine Fire or INV1/2 START both in the overhead panel? By momentary switches I mean those that when pushed, return to the initial position. I have tried with Inc, Dec, Set, Toggle, etc, but it didn't work. Is it possible to make them work with L:Var Macro only?Another example is for the APU start, where I can move to position OFF and ON but can't move to the start position because it is only momentary.  Is it possible make the momentary switches work with L:Var Macro only?

Will post some of the L:Var Macros,

-Engine Fire Test:

1=L:ASD_BTN_TEST_FIRE_ENG1_850XP

-INV1 START

1=L:ASD_SWITCH_AC_INV1_850XP

-APU Start

 L:ASD_SWITCH_APU_MASTERSTART_DIR

 

Thank you all in advance,

 

Gustavo D R.

Posted

Gustavo,

Most, if not all the switches/buttons you are referring to have logic built in to the VC click spots, mainly timers. Much like interfacing the AP, there is no real way to do this via L:Var macros & lua is out of the question too.
Just returned home after some time away and continuing on your AP interface ( some FMC too 😉 ). If you take some screenshots highlighted with all the buttons & switches you need , I can add those too. (send via our PM thread)

Roman

P.S. Here's an example of the APU code needed just to make it work -

(M:Event) 'LeftSingle' scmi 0 == (M:Event) 'WheelUp' scmp 0 == or if{  
	(L:ASD_SWITCH_APU_MASTERSTART_DIR,number) 2 < if{ 
		1 (>L:ClickSoundCar,number) 
	} 	
	(L:ASD_SWITCH_APU_MASTERSTART_DIR,number) ++ 2 min (>L:ASD_SWITCH_APU_MASTERSTART_DIR,number) 
	(L:ASD_SWITCH_APU_MASTERSTART_DIR,number) 2 == if{ 
		(P:local time,seconds) 05 + (>L:ASD_SWITCH_APU_MASTERSTART_TIMER) 
	} 
}
		
(M:Event) 'RightSingle' scmi 0 == (M:Event) 'WheelDown' scmp 0 == or if{
	(L:ASD_SWITCH_APU_MASTERSTART_DIR,number) 0 > if{ 
		1 (>L:ClickSoundCar,number) 
	} 
	(L:ASD_SWITCH_APU_MASTERSTART_DIR,number) -- 0 max (>L:ASD_SWITCH_APU_MASTERSTART_DIR,number) }
	(L:ASD_SWITCH_APU_MASTERSTART_DIR,number) 2 == if{ 
		1 (>L:APU_START,number)	1 (>L:APU_GENERATOR_SWITCH,number) 0 (>L:APU_STOP,number) 
	}  
	(L:ASD_SWITCH_APU_MASTERSTART_DIR,number) 0 == if{ 
		0 (>L:APU_START,number)	0 (>L:APU_GENERATOR_SWITCH,number) 1 (>L:APU_STOP,number) 
	}
}

 

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.