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

bpahe

Resource contributor
#1
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
 

n4gix

Resource contributor
#2
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.
 

bpahe

Resource contributor
#3
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
 
Top