FS2004: Tooltip trouble

bpahe

Resource contributor
#1
Hi!

I´ve created a dummy switch (yes, there are 5 of them in the actual panel, marked "unused") but the tooltip displays a text completly out of line...

I used "Herberts" code from the Avsim forum;

Code:
<part>
<name>VC_unused_switch</name>
<animation>
<parameter>
<code>(L:VC TEST SWITCH,bool) 100 *</code>
</parameter>
</animation>
<mouserect>
<cursor>Hand</cursor>
<tooltip_id>UNUSED SWITCH</tooltip_id>
<callback_code>(L:VC TEST SWITCH,bool) ! (>L:VC TEST SWITCH,bool)</callback_code>
</mouserect>
</part>
...in which I changed the name parameter to the above instead of VC_TEST_SWITCH, and also the actual tooltip_id to the above.

The switch works fine, but the tooltip displays "Engine 2 Oil Pressure (0 kg/sq cm)". Which is quite odd for a single engine aircraft. Is there anything missing in the code above?

/hans
 
#2
As posted in the FFDS forum, Fr. Bill suggested that you should use <tooltip_text>UNUSED SWITCH</tooltip_text> since tooltip_id is reserved for the specific tags.
 
#3
Sorry for Thread-Napping, but I have a question which is a bit similiar with this one. How is it possible to generate dynamic and user-defined tooltips?
Like, in Hans example, a tooltip which shows: "useless switch is currently switched ON"/useless switch is currently switched OFF"

@Hans: I had the same problem, so thanks for asking :rolleyes:

Best regards
Vitus
 

bpahe

Resource contributor
#5
Hi guys!

Glad to be of help. It took a while to find someone who had made available code for a thing which has no function... :) Note also that I have labeled mine Unused, not useless! :D

I can also expand my original question into a field that I have not yet researched - I´m designing my VC, but a friend is doing the panel/gauges. He has programmed a radio, which I´ll recreate in the VC. But since the knobs are not standard FS objects, how do I make a functioning object of his "2D-code"? Do I add his XML code to the gamepack ModelDef?

Thanks for all help!

/hans
 
Last edited:

n4gix

Resource contributor
#6
I can also expand my original question into a field that I have not yet researched - I´m designing my VC, but a friend is doing the panel/gauges. He has programmed a radio, which I´ll recreate in the VC. But since the knobs are not standard FS objects, how do I make a functioning object of his "2D-code"? Do I add his XML code to the gamepack ModelDef?
/hans
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... ;)
 

bpahe

Resource contributor
#7
Hi!

Well, luckily for me it´s XML we´re dealing with. A new field to explore then!

Thanks! I´ll flood a thread with questions later on.

/hans
 

bpahe

Resource contributor
#8
For the record - the corrected code is found below.

/hans

Code:
<part>
<name>VC_unused_switch</name>
<animation>
<parameter>
<code>(L:VC TEST SWITCH,bool) 100 *</code>
</parameter>
</animation>
<mouserect>
<cursor>Hand</cursor>
<tooltip_text>UNUSED SWITCH</tooltip_text>
<callback_code>(L:VC TEST SWITCH,bool) ! (>L:VC TEST SWITCH,bool)</callback_code>
</mouserect>
</part>
 
Top