• 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.

FSXA 3d Button code for AI selection in VC radar

Messages
2
Country
southafrica
I need some help with a code I am writing for use in MakeMDL.parts.xml and modeldef.xml.
I have designed a new glass cockpit gauge with various panels, and in particular a radar.
I have everything working in the 2d panel, AI shows up in a list, I can scroll the list and click on a particular vehicle. I have written code in the HUD to show info of the selected vehicle.

In the VC panel I have made some 3d buttons to activate the panel parts. I can scroll up and down the aircraft list, but I have problems writing the correct animation script for selected vehicles.

The mouse callback_code works as per the 2d mouse functions, but I just cannot get the correct code for the annimation code.

I have 8 buttons, each for a aircraft in the list, so 8 part entries in the makemdl.part.xml

This is one of the ways i tried, without success:

<part>
<name>Target_F</name>
<animation>
<parameter>
<code>(&gt;C:ITrafficInfo:SelectedVehicle:1, number)</code>
</parameter>
</animation>
<mouserect>
<cursor>Hand</cursor>
<tooltip_text>AI 1 </tooltip_text>
<callback_code>(L:ListFirstVis) 1 + (C:ITrafficInfo:ListSize) min (&gt;C:ITrafficInfo:SelectedVehicle)</callback_code>
</mouserect>
</part>

also
<code>(&gt;C:ITrafficInfo:SelectedVehicle 1, number)</code>
<code>(&gt;C:ITrafficInfo:SelectedVehicle, number) 1</code>
<code>(C:ITrafficInfo:SelectedVehicle 1, enum)

Any help will be welcomed.
 
If you want the button to depress, you'll have to use an L: var for the animation.

Code:
<part>
<name>Target_F</name>
<animation>
<parameter>
<code>(L:AI 1 Selected, bool)</code>
</parameter>
</animation>
<mouserect>
<cursor>Hand</cursor>
<tooltip_text>AI 1 </tooltip_text>
<callback_code>(L:AI 1 Selected, bool) ! (>L:AI 1 Selected, bool)  (L:ListFirstVis) 1 + (C:ITrafficInfo:ListSize) min (&gt;C:ITrafficInfo:SelectedVehicle)</callback_code>
</mouserect>
</part>

(Not sure if this will work without any animation length information.)
 
Thanks for your response. I have tried that as well, with animation, but it still does not work.

The xml gauge is a MFD PFD combination including a map page and separate radar page. The Radar works 100% in the VC, I get a list of the AI aircraft, I can select any aircraft in the list (mouse function)
and I get the relevant info of the AI on the Radar page as well as in the HUD.

I will eventually have just this gauge and the HUD as xml gauges, the rest of the VC is all 3d parts. I would love to get the 3d buttons to work in a similar way as the mouse function in the xml gauge.

My programming skills is limited to FSX xml gauges, so I will keep on trying. I will eventually succeed.
 
Back
Top