• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

MSFS20 How to command control surfaces with the mouse for a Pre-Flight

Lagaffe

Resource contributor
Messages
986
Country
france
For the purposes of an inter-active pre-flight, I developed an interface accessible via the Toolbar (https://www.fsdeveloper.com/forum/t...ution-xml-gauge-or-html-js-ingamepanel.457162).

This interface allows me to click on a few points corresponding to camera views and move the point of view on these cameras. Everything that follows is associated with the interior model. The actual control surfaces (aileron, elevon, rudder) were moved from the Blender Exterior model into the Blender Interior model. Each surface control has a Mouse Zone defined (Ailerons, Elevator, Rudder) in order to click on it and select the action to do.
This aircraft used yet duplicated control surfaces fixed to illustrate Control Lock function.
=> All this has been validated and is functional.

When via a clickspot on the GUI, I move to a point of view, I wanted to manipulate via the mouse/scroll function :
- using WheelUp to change control surface from middle position to Max
- using WheelDown to change control surface from middle position to Min
- using LeftSingle to change the control surface to the middle position and validate the verification operation of this surface.
=> Currently, this works but not as I would like ...

I have try several codes but anything is perfect. I manage to control the surface via theses different controls but theirs movements are not maximum and seems to be limited.
I think it comes from the values or variables used but it’s a real headache !

Example for AiLERON, I have try :
- according the SDK:
AILERON POSITIONPercent aileron input left/right.Position
(-16K to 0)
-16K = full left
<CALLBACKCODE_DEFAULT_IM>
(M:Event) 'WheelUp' scmi 0 == if{ 100 (&gt;A:AILERON POSITION, percent) }
(M:Event) 'WheelDown' scmi 0 == if{ -100 (&gt;A:AILERON POSITION, percent) }
(M:Event) 'LeftSingle' scmi 0 == if{ 0 (&gt;A:AILERON POSITION, percent) 1 (&gt;L:CHECK_AILERON) }
</CALLBACKCODE_DEFAULT_IM>
or
- according the SDK:
AXIS_AILERONS_SET[0] Position (-16383 to 16384)Sets the aileron position.
<CALLBACKCODE_DEFAULT_IM>
(M:Event) 'WheelUp' scmi 0 == if{ 16383 (&gt;K:AXIS_AILERONS_SET) }
(M:Event) 'WheelDown' scmi 0 == if{ -16383 (&gt;K:AXIS_AILERONS_SET) }
(M:Event) 'LeftSingle' scmi 0 == if{ 0 (&gt;K:AXIS_AILERONS_SET) 1 (&gt;L:CHECK_AILERON) }
</CALLBACKCODE_DEFAULT_IM>

The other solution to create duplicated control surfaces and specific animations for this purpose has some cons:
- add more vertex (3 control surfaces if I include Control Lock ones)
- XML code to manage visibility of real ones and dummy control surfaces.

It is also possible to create 4 dummy which are each one parent of each control surfaces and make a specific animation for theses dummies. In theses conditions, Mouse Zone should be associated with theses dummies and
in the end we would have 2 animations for each control:
- one accessible via the dummy for validation step,
- one accessible via joystick normally.

That said the solution I stumble on is quite pleasant, is closer to reality and I think it would only take a few changes in the XML codes for it to be fully validated.
Sorry, if my english is not perfect :cool:
 
Last edited:
Today, I make some others tests and I remark one thing:
- before clicking on "LeftSingle", the "WheelUp" or "WheelDown" event allow a positive deflection
- once the click on "LeftSingle" is done, the scroll allows to have a negative deflection but no more positive.
Everything seems to behave as if a "LeftSingle" event was generated following just after a "WheelUp" or "WheelDown"

I tried to change scmi to scmp but without real change.

It’s really stupid because the function is almost operational: the desired behavior is there but it is not perfect. The solution is probably under my nose but I do not see it
 
Well, my last try was a step forward to the solution.
I change my code as :
<CALLBACKCODE_DEFAULT_IM>
(M:Event) 'WheelUp' scmi 0 == if{ 100 (&gt;A:AILERON POSITION, percent) }
(M:Event) 'WheelDown' scmi 0 == if{ -100 (&gt;A:AILERON POSITION, percent) }
</CALLBACKCODE_DEFAULT_IM>
In fact I assumed that each event of the type "WheelUp" or "WheelDow" had to follow a "LeftSingle" systematically to be able to explain that my old code allowed to act only the positive or negative part of the animation. By removing the third line I now get the whole animation.

By writing a template and setting the name of the animation (AILERON, ELEVATOR, RUDDER) I should have the code I wanted.
I just have to find how to send an order to reset the control surface to 0 and validate the operation in my Lvar
 
Back
Top