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

FS2004: 2D custom gauge-knobs to my VC!

bpahe

Resource contributor
Messages
335
Country
sweden
There are several ways this could be approached, but the simplest would be to simply animate the knobs and create mouse points to transmit the commands to the gauge.

This is done by using the same L:vars that your friend uses in the gauge, assuming that he's using XML code. For interfacing model XML to C guages is also possible, but considerably more complicated... ;)

Hi!

This message is a followup to a reply that n4gix gave me a while ago. Well, the time is here to dig a little deeper into this. I have the XML-code that the gauges are created with, and in some way I should use the L:vars from the XML-code. But how? For instance, look at the code posted below;

Code:
<!-- ============= ON - OFF Button ============= -->
<Area Left="8" Top="57" Width="10" Height="11">
<Cursor Type="Hand"/>
<Click>(L:EV97_RADIO_ON_OFF_button,bool) ! (&gt;L:EV97_RADIO_ON_OFF_button,bool) 0 (&gt;L:EV97_SQVLVX_button,enum) 0 (&gt;L:EV97_MHz_KHz_button,bool)</Click>
</Area>

This is not the entire gauge code, I just borrowed the on-off function button to have an example to work with. I asume that it is the code between the click-tags that somehow should be transfered to my makemdl.parts.xml?

/hans
 
Code:
<!-- ============= ON - OFF Button ============= -->
<Area Left="8" Top="57" Width="10" Height="11">
<Cursor Type="Hand"/>
<Click>(L:EV97_RADIO_ON_OFF_button,bool) ! (&gt;L:EV97_RADIO_ON_OFF_button,bool) 0 (&gt;L:EV97_SQVLVX_button,enum) 0 (&gt;L:EV97_MHz_KHz_button,bool)</Click>
</Area>

This is not the entire gauge code, I just borrowed the on-off function button to have an example to work with. I asume that it is the code between the click-tags that somehow should be transfered to my makemdl.parts.xml?

/hans

Yep. You've got it easy (relatively speaking), since the 2d gauges are XML. I work only with C gauges so it's a little more complex for me... ;)

Something like this should work:

Code:
   <part>
	<name>ev97_radio_on_off</name>
	<animation>
		<parameter>
			<code>
				(L:EV97_RADIO_ON_OFF_button,bool) 50 *
			</code>
			<lag>40</lag>
		</parameter>
	</animation>
	<mouserect>
		<cursor>Hand</cursor>
		<tooltip_text>Radio On/Off</tooltip_text>
		<callback_code>
			(L:EV97_RADIO_ON_OFF_button,bool) ! (&gt;L:EV97_RADIO_ON_OFF_button,bool) 
                          0 (&gt;L:EV97_SQVLVX_button,enum) 0 (&gt;L:EV97_MHz_KHz_button,bool)
		</callback_code>
	</mouserect>
   </part>

Keyframe animate the button or knob, 0-50 keyframes. If you want to make it move faster, increase the <lag> value.
 
Hi & thanks!

I´ll be back with more follow-ups soon, right now I have to figure out a proper code to make my elevator trim lever not to rotate several 360 degrees... ;)

/hans
 
Back
Top