• 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 Cockpit clickables - with .mdl

Messages
25
Country
india
Hello, I'm quite new here, so my bad if this is the wrong category, I don't know where this should go.
Moving that aside, I need help, figuring out how to make levers in the 3d cockpit (virtual cockpit) interactable? Like you can click and drag or scroll wheel to change it
Currently working with a landing gear lever, and this virtual cockpit is ancient to say the least, somehow this IL-62 loads and works in MSFS, after a lot of modifications like increasing of lift_scalar and thrust_scalar, I also figured out how to animate the levers finally and got the landing gear lever into model converter X, and inserted it into the virtual cockpit (earlier it was soldered solid to the central panel). Now from here on, im confused asto how to make it interactable, just like the a320-neo that comes pre installed, where you can click and drag (pretty sure you can also use scroll wheel) to change the gear state

I've tried mouse rect (became inactive), <behaviours> in modeldef.xml (doesn't really do anything somehow), is it the .MDL format? And if yes, how do I export to .gltf and not have to sit and animate 50+ switches/levers/3d gauges?

P.s. the copyright on this model says it's free to modify / distribute as long as no paywall is put, which I don't plan to put either

Any help is appreciated
 
Last edited:
Hello,
MCX doesn't allow you to preserve animations when exporting MDL files to GLTF for MSFS.
Personally, I export MDL files (FS9, FSX, or P3D) to DAE and then redo all the animations in Blender before creating the new GLTF files.
It's indeed a lot of work.
 
I don't understand the question:
MDL files don't support MSFS clickables.
What MSFS clickables are there?
 
The ones we define in the <Behaviours> section of the modeldef.xml
Like for example the A320 has a landing gear lever you can click and drag to change its state in the virtual cockpit
Edit: also, why DAE? Does that preserve the hierarchy the best? Cuz I export to obj and suddently everything's grouped into solid meshes idk why
 
Last edited:
OK,
I don't usually use Behaviors codes.
It's faster for me to use all the MDL codes from the ModelDef.xml accessible in MCX to create the external and internal XML files.
But you can use them in your own behaviors codes.
 
The only reason I'm using behaviors codes is because I want them clickable in the virtual cockpit, just like the a320 (as an example)
 
It's the same with the codes from Modeldef.xml.
In Blender, you assign the animation name to the clickable element.
Example:
<Animation name="custom_anim_com2_MHz1" guid="15A66DE6-6DC9-43A8-B3AA-6486B04B4181" length="360" type="Sim" typeParam2="custom_anim_com2_MHz1" typeParam="AutoPlay" />
<PartInfo>
<Name>custom_anim_com2_MHz1</Name>
<AnimLength>360</AnimLength>
<Animation>
<Parameter>
<Code>(A:COM ACTIVE FREQUENCY:2, MHz) 10% int 36 * </Code>
</Parameter>
</Animation>
</PartInfo>
 
Yea I did that, but you can't click on it or click + drag to set when it's done like that
But that does make it react to the changes when done via keybings
Eg: gear raised via pressing g, the animation plays
 
Im going for something like this
Click to interact
Not my screenshot!
Link: Found here
 

Attachments

  • a3a7c273cebd0cd8367d12682c1e904e2a3657e1.jpeg
    a3a7c273cebd0cd8367d12682c1e904e2a3657e1.jpeg
    33.9 KB · Views: 122
Of course, you can click on it, as long as the click area is on the object.
For example, if the element's origin isn't directly on it, it won't work because the click area is on the origin point.
You must therefore check the positioning of the element's origin and that the area doesn't overlap that of another clickable element.
In this case, you must cheat by incorporating a smaller object into the clickable element and choosing it to become the click area.

In the example in your screenshot, it seems that the code doesn't allow for the use of clicking, scrolling, or dragging, but only the use of the keyboard key "?"
 
well, the animation for it is based on rotation, and it rotates where the origin is (inside the central panel), and the screenshot I shared is from somewhere else
1753009835156.png

heres what im dealing with
 
ive tested the animation before, it does react to change in sim vars, like when I raise the gear, the animation does play, its just not interactable if I want to do it with my mouse aka like how we can in the A320
 
<PartInfo>
<Name>lever_landing_gear</Name>
<AnimLength>100</AnimLength>
<Animation>
<Parameter>
<Sim>
<Variable>GEAR HANDLE POSITION</Variable>
<Units>percent</Units>
</Sim>
<Lag>200</Lag>
</Parameter>
</Animation>
<MouseRect>
<Cursor>Hand</Cursor>
<HelpID>HELPID_GAUGE_GEAR_LEVER</HelpID>
<TooltipID>TOOLTIPTEXT_GEAR_LEVER</TooltipID>
<MouseFlags>LeftSingle+LeftDrag+Wheel</MouseFlags>
<CallbackJumpDragging>
<YMovement>
<Delta>50</Delta>
<EventIdInc>GEAR_DOWN</EventIdInc>
<EventIdDec>GEAR_UP</EventIdDec>
</YMovement>
</CallbackJumpDragging>
</MouseRect>
</PartInfo>

<PartInfo>
<Name>lever_landing_gear_reversed</Name>
<MouseRect>
<Cursor>Hand</Cursor>
<TooltipID>TOOLTIPTEXT_GEAR_LEVER</TooltipID>
<MouseFlags>LeftSingle+LeftDrag+Wheel</MouseFlags>
<CallbackJumpDragging>
<YMovement>
<Delta>50</Delta>
<EventIdInc>GEAR_UP</EventIdInc>
<EventIdDec>GEAR_DOWN</EventIdDec>
</YMovement>
</CallbackJumpDragging>
</MouseRect>
</PartInfo>

^ this is the mouse rect code I had tried, all it did was display "Microsoft Flight Simulator X" at the top left corner, even when the gear lever was at the centre

current code uses <behaviours> section, which just doesnt want to active, probably cuz im using .mdl format
 
My code for animating a landing gear lever:

<Animation>
<Parameter>
<Code>
(A:GEAR HANDLE POSITION,bool) 100 *
</Code>
<Lag>200</Lag>
</Parameter>
</Animation>
<MouseRect>
<Cursor>Hand</Cursor>
<TooltipText>Train%((A:GEAR HANDLE POSITION,bool))%{case}%{:0} in %{:1} out %{end}</TooltipText>
<MouseFlags>LeftSingle</MouseFlags>
<CallbackCode>
(A:SIM ON GROUND,bool)! (A:GEAR EMERGENCY HANDLE POSITION, bool)! &amp;&amp; if{ (&gt;K:GEAR_TOGGLE) }
</CallbackCode>
</MouseRect>
</PartInfo>
 
Back
Top