March 30, 201016 yr fs9 - FSDS351 - Win XP I am doing the VC of a 4 piston engined aircraft. The Mixture levers control two engines each, left and right pairs. I have the cockpit view XML gauges working properly as I can set both the (K:..._SET ) values in the same line of code with a simple 'd' [duplicate] command.My problem is that I cannot do a similar thing in the 'MakeMDL <part>' gauge, something like this:- <mouserect> <cursor>Hand</cursor> <help_id>HELPID_GAUGE_THROTTLE_MIXTURE</help_id> <tooltip_id>TOOLTIPTEXT_THROTTLE_MIXTURE_PERCENT</tooltip_id> <mouse_flags>LeftSingle+LeftDrag</mouse_flags> <callback_dragging> <variable>GENERAL ENG MIXTURE LEVER POSITION:1</variable> <units>percent</units> <scale>163.84</scale> <yscale>163.84</yscale> <minvalue>4424</minvalue> <maxvalue>16384</maxvalue> d <event_id>MIXTURE1_SET</event_id> <event_id>MIXTURE2_SET</event_id> </callback_dragging> </mouserect> I have a <callback_code> routine that looked promising but after four days of tweaking I am unable to get an acceptable outputI cannot use an invisible lever since there is another pair of control levers that do a similar thing but for the outboard and inboard engines.Ted.
March 30, 201016 yr Moderator You cannot use two <EventID>s in a single mouse rectangle. You need to use <callback_code> instead: <callback_dragging> <variable>GENERAL ENG MIXTURE LEVER POSITION:1</variable> <units>percent</units> <scale>163.84</scale> <yscale>163.84</yscale> <minvalue>4424</minvalue> <maxvalue>16384</maxvalue> <callback_code> (>K:MIXTURE1_SET) (>K:MIXTURE2_SET) </callback_code> </callback_dragging> Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
March 30, 201016 yr Why not store the value into s0 before assigning it to the first event_id and re-load it with l0 before the second event? Probably the first event_id kills the stack completely, so your duplication would be gone as well... But Bill is right, callback_code is more powerful for this kind of thing.
April 2, 201016 yr Author Thanks for the fast reply. You cannot use two <EventID>s in a single mouse rectangle. You need to use <callback_code> instead: <callback_dragging> <variable>GENERAL ENG MIXTURE LEVER POSITION:1</variable> <units>percent</units> <scale>163.84</scale> <yscale>163.84</yscale> <minvalue>4424</minvalue> <maxvalue>16384</maxvalue> <callback_code> (>K:MIXTURE1_SET) (>K:MIXTURE2_SET) </callback_code> </callback_dragging> Can the <callback_code> tags be wrapped in <callback_dragging> tags ?I have had a look in the default MakeMdl.parts file but there is no part like that to examine.I have tried to get the value that is passed to the <event_id> to be passed into the <callback_code> but nothing happens. The cursor appears with the usual grabbing action but thats all.I am now trying to get a proper dragging action using a simple <callback_code> in the <mouserect> section.
April 5, 201016 yr Author I abandoned the <callback_dragging> route and finally had some success with this cunning code. 'LULU' is my test modelNote that I needed the minimum mixture to be 27% but it was developed using 0% as the minimum. Just change the 0.27 and 4424 values to 0. <part> <name>lever_double_mixture</name> <!-- LULU --> <animation> <rotation>Y</rotation> <parameter> <code> (A:GENERAL ENG MIXTURE LEVER POSITION:2,part) 0.27 max 1 min 100 * </code> </parameter> </animation> <mouserect> <cursor>Hand</cursor> <tooltip_text>Port mixtures</tooltip_text> <mouse_flags>LeftSingle+LeftDrag</mouse_flags> <callback_code> (M:Event) 'LeftSingle' scmp 0 != if{ (L:Pmixref, position) 0 != if{ (L:Pmixref, position) (M:Y) - 400 / /-/ (A:General eng mixture lever position:2,part) + 16384 * int 16384 min 4424 max d (>K:MIXTURE1_SET) (>K:MIXTURE2_SET) } } (M:Y) (>L:Pmixref, position) </callback_code> </mouserect></part>
Create an account or sign in to comment