July 3, 200619 yr Hi all!I need to create a rotating knob on an ADF panel using the ADF Panel bitmap and the knob bitmap. The knob is supposed to have 4 positions:So far I managed to create only 2 positions:(G:Var1)Rotating Knob(G:Var1) ! (>G:Var1)Any ideas?
July 3, 200619 yr Yes :-)G:Var1) ! (>G:Var1) means you use G: Var1 as a boolean, so one 0 and 1.Also don't use a G:var, since under some circumstances (like going from Windowed to FullScreen mode, v.v.) but use an L:var instead.Like:(L:RotatingKnob,enum) ++ d (>L:RotatingKnob,enum)4 ==if{ 0 (>L:RotatingKnob,enum) }If you want two clickspots (like up and down), use (mind the xx and yy):Rotating Knob(L:RotatingKnob,enum) ++ 3 min (>L:RotatingKnob,enum)Rotating Knob(L:RotatingKnob,enum) -- 0 max (>L:RotatingKnob,enum)Cheers, Rob
July 9, 200619 yr Thanks, Rob! :) It works. I was a bit misled by Nick Pike's FS2004 XML Gauge Programming tutorial (1.4 and ) in which he is using G:Var for rotating.Now I'd like to add a sound to the knob with the dsd_xml_sound3.gau gauge. I configured the sounds.ini file as follows:---------------[Config]MaxSounds=1Lvar=dsd_xml_sound_idLvarStop=dsd_stop_sounds[sounds]Sound00=./THE_PATH/click.wav[LVars]Lvar00=dsd_xml_sound_id_00---------------Also I added the dsd_xml_sound_id_00 Lvar to the clickable areas:---------------Rotating Knob(L:RotatingKnob,enum) ++ 3 min (>L:RotatingKnob,enum) 1 (>L:dsd_xml_sound_id_00,number)Rotating Knob(L:RotatingKnob,enum) -- 0 max (>L:RotatingKnob,enum) 1 (>L:dsd_xml_sound_id_00,number)---------------I have the sound now but there is a little problem that you can still hear it when you click on extreme left and right positions (for (+) and (-) clickable areas). I have to change the logic so I can hear the sound only when rotating the knob. Any help would be appreciated. :)
July 9, 200619 yr Hi,Try for the sound:(L:RotatingKnob,enum) s0 0 >= l0 3 <= and if{ 1 (>L:dsd_xml_sound_id_00,number) } Jan"Beatus ille qui procul negotiis..." Jan "Beatus ille qui procul negotiis..."
July 10, 200619 yr >Hi,>>Try for the sound:>>(L:RotatingKnob,enum) s0 0 >= l0 3 <= and >if{ 1 (>L:dsd_xml_sound_id_00,number) } >>Jan>>"Beatus ille qui procul negotiis..."Hi, Looks like something wrong with the syntax because the gauge won't show up. Any ideas?
July 10, 200619 yr Hi,Possible(?);try:(L:RotatingKnob,enum) -- 0 max (>L:RotatingKnob,enum) (L:RotatingKnob,enum) 0 >= (L:RotatingKnob,enum) 3 <= && if{ 1 (>L:dsd_xml_sound_id_00,number) } (L:RotatingKnob,enum) ++ 3 min (>L:RotatingKnob,enum) (L:RotatingKnob,enum) 0 >= (L:RotatingKnob,enum) 3 <= && if{ 1 (>L:dsd_xml_sound_id_00,number) } Jan"Beatus ille qui procul negotiis..." Jan "Beatus ille qui procul negotiis..."
July 10, 200619 yr I think the problem is in using "<=" or in "and"I've never figured out when you could you these constructors like >, >=, < or <=. Hence, I always use:- ">" instead of ">"- "<" instead of "<"- "&&" instead of "and"That always works.Try it. At least the gauge loads now.But (sorry Jan if I'm wrong), it doesn't do what you what.If I understand correctly, you only want the sound if (L:RotatingKnob,enum) actually changes when you click the gauge, right ?So NOT with UP if it's already 3, or DOWN if it's already 0.If so, use:Rotating Knob(L:RotatingKnob,enum) 3 <if{ 1 (>L:dsd_xml_sound_id_00,number) }(L:RotatingKnob,enum) ++ 3 min (>L:RotatingKnob,enum)Rotating Knob(L:RotatingKnob,enum) 0 >if{ 1 (>L:dsd_xml_sound_id_00,number) }(L:RotatingKnob,enum) -- 0 max (>L:RotatingKnob,enum)Rob
July 10, 200619 yr Hi Jan,Using "<" as smaller-than" gives a syntax error.Which, come to think of it, is logical. Because "<" is the opening symbol of the next tag. Which also explains why ">" DOES work :-)Cheers, Rob
July 10, 200619 yr Hi,Totally correct.That is why i always use more click area's like:0 (>L:RotatingKnob,enum)1 (>L:dsd_xml_sound_id_00,number)1 (>L:RotatingKnob,enum)1 (>L:dsd_xml_sound_id_00,number)2 (>L:RotatingKnob,enum)1 (>L:dsd_xml_sound_id_00,number)3 (>L:RotatingKnob,enum)1 (>L:dsd_xml_sound_id_00,number)Jan"Beatus ille qui procul negotiis..." Jan "Beatus ille qui procul negotiis..."
July 10, 200619 yr Jan, did you also noticed my post above (#7) about "<" being illegal as "smaller-than" operator (gives a syntax error)??Cheers, ROb
July 10, 200619 yr Hi,I use this approach, works good when there is complex code embedded:Cant of positions : 3 (0-2)Up:(Lvar) ++ 3 min (>Lvar)If lvar = 1 then complex codeIf lvar = 2 then complex codeLVar 3 == if{ 2 (>Lvar) }Down:(Lvar) -- -1 max (>Lvar)If lvar = 0 then complex codeIf lvar = 1 then complex codeLVar -1 == if{ 0 (>Lvar) }Tom
July 10, 200619 yr Hi,I know, but the forum translates my > and < in the wrong characters.I use the right ones.Jan"Beatus ille qui procul negotiis..." Jan "Beatus ille qui procul negotiis..."
July 16, 200619 yr Thanks, guys! Now it's all right. I used Rob's solution. Now I need to create a pressed/released button on the panel. Its mechanics should work like a "mouse button". I put it as follows: (L:Button,bool)Button(L:Button,bool) ! (>L:Button,bool)Now the problem is that I'd like to add 2 sounds to it: when you press it you can hear L:dsd_xml_sound_id_03 (that sounds once) and when you release it you can hear L:dsd_xml_sound_id_04.Also when using the above code continuous button press/release actionshappen when you press & hold the mouse button. I have change the codeso that when you press the button it remains pressed. Any suggestions?
July 16, 200619 yr Hi,Play with:(M:Event) 'LeftSingle' scmp 0 == if{ 1 (>L:dsd_xml_sound_id_03,enum) 1 (>L:Button,bool) } (M:Event) 'Leave' scmp 0 == if{ 1 (>L:dsd_xml_sound_id_04,enum) 0 (>L:Button,bool) } Hope it helps,Jan"Beatus ille qui procul negotiis..." Jan "Beatus ille qui procul negotiis..."
July 17, 200619 yr Hi,Thanks, but when using your code you can hear the sounds but the bitmaps won't change. Also when you click & hold the mouse button the sounds come repeatedly. I rewrote the code as follows: Button (L:Button,bool) ! (>L:Button,bool) (L:Button,bool) 1 < if{ 1 (>L:dsd_xml_sound_id_03,number) } (L:Button,bool) 0 > if{ 1 (>L:dsd_xml_sound_id_04,number) } Now when you single click the button all seems perfect but when you hold the mouse button down the sounds and bitmaps start to change repeatedly and even change the order they apear and sound. Any ideas to solve this?
Create an account or sign in to comment