plane icon Welcome to Microsoft Flight Simulator’s SDK Q&A Platform!

You have questions regarding the SDK? DevMode Tools? SimConnect? You would like to submit an idea for future improvements, seek help or exchange knowledge? You’re in the right place.


Please take a moment to read the platform’s guidelines before you get started!


question

MV-JimStewart avatar image
MV-JimStewart asked DA40CGDFQ edited

Request for more Interaction/Input Event tutorials

So, the current tutorial in the docs that covers adding interactions with input events is a good start, but it's rather incomplete. For example, it doesn't address the fifth Interaction_Type (joystick), and it lacks a fair bit of clarity on what options are allowed for customizing each type of interaction. This leaves one to search through files on your own, looking for parameters that can be set, and experimenting from there - which is not a great use of development time.

To be more specific: I'm trying to determine the method (via the interactions/input events) to have a proper 3 position momentary switch, where the switch can be held in a specific state to have a value increase or decrease continuously as long as the switch is held.

One can do this easily via direct use of the GT Switch templates such as ASOBO_GT_Switch_XStates, but this method seems to go against the current direction towards the use of input events. In addition, I was hoping to take advantage of nested input events, so that I could allow the user the convenience of a 'reset trim' option on a trim switch, for example.

I have found in various input event examples 3 state 'momentary' switches that allow the user to put a switch in one state but not hold in that state... the sim 'forces' the switch to the middle state after a short length of time. This does not work nicely for a trim switch where the user is expected to hold the switch for a length of time to achieve a desired value.

defaultdocumentationgaugestutorial
10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

FlyingRaccoon avatar image
FlyingRaccoon answered

Hello @MV-JimStewart

That's right, the joystick interaction type was added recently but not yet in the doc. Our tech writer will fix this.

The doc doesn't go very deep into the parameters because there are a lot of those in the subtemplates and it's changing a lot so the would quickly become obsolete.
We are focusing on higher lever doc at the moment and browsing the template files is the only way to understand how it works.
But we want to improve this as well, either with better tools or doc if we end up having enough resources for it.

As for the trim switch you're trying to implement, look for ASOBO_HANDLING_Switch_ElevatorTrim_Template, it already has that logic implemented.
If you want to create your own, you can have an InputEvent with a 3 states switch, you just need do use the MONOMENTARY_SWITCH, STATE0_TIMER and STATE_MAX_TIMER

Regards,
Sylvain

10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

DA40CGDFQ avatar image
DA40CGDFQ answered DA40CGDFQ edited

I'd like to bump this post. I am having trouble understanding input events in general. The tutorial gives me just enough to get simple things working, however more complex stuff like three position switches and 3 and 5 position knobs, 3 position switch with momentary push spring back. Could you please expand the tutorial for more complex things. I am trying to use the

ASOBO_GT_Switch_3States_IncDec


switch. I am having trouble with understanding, code_pos_#, set_state_external, set_state_#, get_state.

I am looking for a more low level explanation, on how input events interact with a usetemplate template, Bvars, Ovars.

My animation works as expected, the tooltips even work, but getting the sim to set lvars, or simvars. The code snippets are difficult to figure out.

The user clicks on a node in the aircraft, the mouserectangle reacts and ..... triggers the input event?? But what is happening?

10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 5 attachments (including images) can be used with a maximum of 19.1 MiB each and 23.8 MiB total.