January 27, 20242 yr I have a situation where the aircraft developer has only created a mouse event to operate a switch (actually a few switches) in the virtual cockpit. The mouse event(s) trigger the animation and set an Lvar value. However, changing the Lvar value does not operate the switch or generate the condition in the code for the switch to be active. The "M:event" is not showing up in MSFS Input events when trying to assign a button. Finally, the event/component is not displaying any other variables in the "Behaviors" tool in the dev SDK. Below my questions is the actual code in question. My questions: - I am using TrackIR, how might that affect using virtual mouse to select the switch? - Is there other ways of triggering the swtich beside virtual mouse that you might recommend trying? Thanks PS tried searching this forum with no joy. <Component ID="inverter_switch" Node="inverter_switch"> <MouseRect> <MouseFlags>LeftSingle</MouseFlags> <Cursor>Hand</Cursor> <TooltipID>INVERTER %((L:inverter_switch,enum) 1 == )%{if}OFF%{else}ON%{end}</TooltipID> <CallbackCode><Code> (M:Event) 'LeftSingle' scmi 0 == if{ (L:inverter_switch,enum) 1 + 3 % (>L:inverter_switch,enum) } </Code></CallbackCode> </MouseRect> <WWISE_EVENT>button_switch_generic</WWISE_EVENT> </Component> Edited January 27, 20242 yr by hs118 My MSFS 2020 repaints: Flightsim.to - Profile of HStreet Working on MSFS 2024 versions.
January 27, 20242 yr Commercial Member How did you "change the LVar value"? This behavior code looks like it should be working when you replicate the same in AAO? Is that the entire code? What aircraft is this? (L:inverter_switch, Number) 1 + 3 % (>L:inverter_switch, Number) This looks like the switch has three positions? What the code actually does is counting up the LVar towards infinity and limit it to the desired range with the modulo operator. So setting the LVar to 0-1-2 from the outside might screw something else up, you have to use the same code in AAO as in the leftsingle mouse event. For components that use the Asobo default switch logic I made this: Solution for MSFS BR Norseman - Mouse-Only levers - AxisAndOhs Support - The AVSIM Community Edited January 27, 20242 yr by Lorby_SI LORBY-SI
January 27, 20242 yr Author 2 hours ago, Lorby_SI said: How did you "change the LVar value"? This behavior code looks like it should be working when you replicate the same in AAO? Is that the entire code? What aircraft is this? (L:inverter_switch, Number) 1 + 3 % (>L:inverter_switch, Number) The aircraft is the Sim Skunk Works SF-260. I was setting the Lvar with a simple script to set the value eg "1 (>L:inverter_switch, Number)". Thanks for the link to forum post. Will take a look at it. Edited January 27, 20242 yr by hs118 My MSFS 2020 repaints: Flightsim.to - Profile of HStreet Working on MSFS 2024 versions.
January 27, 20242 yr Commercial Member 1 hour ago, hs118 said: was setting the Lvar with a simple script to set the value eg "1 (>L:inverter_switch, Number)". That is not enough, this LVar has multiple values. You have to use the same code as the LeftSingle event. I've posted the RPN code above, just copy and paste it into a script and bind it to the button. (L:inverter_switch, Number) 1 + 3 % (>L:inverter_switch, Number) Edited January 27, 20242 yr by Lorby_SI LORBY-SI
Archived
This topic is now archived and is closed to further replies.