PDA

View Full Version : MouseRects driving me nuts



Firebar
January 21st, 2016, 21:56
To anyone that could help me out by looking at some source files I'd be eternally grateful. I'm creating a vc for an aircraft I'm modelling for FSX but I'm having a problem with the mouse rectangles on the centre console. I can only get a couple of them to work, I've tried doing all the normal moving eyepoints, texturing, resetting scale and transform but nothing seems to work. I hope someone could take a look and give me a nudge in the right direction.

NB: the cockpit is at cm scale so it needs to be resized in MCX before use.

Cheers,
M


Modeldef.xml extracts:


<!-- added for CMC Leopard --> <Animation name="cylinder_wiskey_compass_bank" guid="A3943B22-82B7-4305-83C0-0F998990FEF9" length="40" type="Sim" typeParam2="cylinder_wiskey_compass_bank" typeParam="AutoPlay" />
<Animation name="cylinder_wiskey_compass_pitch" guid="6181FFBC-F784-4C97-9A5C-CF9C6150E549" length="40" type="Sim" typeParam2="cylinder_wiskey_compass_pitch" typeParam="AutoPlay" />
<Animation name="cylinder_wiskey_compass_heading" guid="37756421-1B4D-4DFC-8C08-DD8902A92C97" length="360" type="Sim" typeParam2="cylinder_wiskey_compass_heading" typeParam="AutoPlay" />
<Animation name="c_wheel100-200" guid="C2F63812-C927-48D5-9951-EDCF8C3CC1B6" length="200" type="Sim" typeparam2="c_wheel100-200" typeparam="AutoPlay" />
<Animation name="usr_rdr" guid="8BBB026A-3CC5-4E96-9B18-48F574CF97A8" length="100" type="Sim" typeParam2="usrvar" typeParam="AutoPlay" />
<Animation name="switch_leopard_xfeed" guid="F7535767-6675-4DC5-ABD5-F325EF34CBBF" length="50" type="Sim" typeParam2="switch_leopard_xfeed" typeParam="AutoPlay" />
<Animation name="switch_leopard_starter" guid="CD82B74F-8933-467F-852F-9C844AD0CEBF" length="50" type="Sim" typeParam2="switch_leopard_starter" typeParam="AutoPlay" />
<Animation name="switch_bussense" guid="93FE1953-8BEB-41C1-A76F-1613546AFBAB" length="50" type="Sim" typeParam2="switch_bussense" typeParam="AutoPlay" />
<Animation name="switch_bustie" guid="9E4C87EC-BCD2-420F-8DC3-563BCE2898A8" length="50" type="Sim" typeParam2="switch_bustie" typeParam="AutoPlay" />
<Animation name="T38_toggle_Flaps" guid="4FEA3ED3-7FC2-4A1B-88D0-A1206B492679" length="50" type="Sim" typeParam2="T38_toggle_Flaps" typeParam="AutoPlay" />

<!-- end CMC Leopard -->


<!-- CMC Leopoard --> <PartInfo>
<Name>cylinder_wiskey_compass_bank</Name>
<AnimLength>40</AnimLength>
<Animation>
<Parameter>
<Sim>
<Variable>PLANE BANK DEGREES</Variable>
<Units>degree</Units>
<Bias>20</Bias>
<MinValue>-20</MinValue>
<MaxValue>20</MaxValue>
</Sim>
</Parameter>
</Animation>
</PartInfo>
<PartInfo>
<Name>cylinder_wiskey_compass_pitch</Name>
<AnimLength>40</AnimLength>
<Animation>
<Parameter>
<Sim>
<Variable>PLANE PITCH DEGREES</Variable>
<Units>degree</Units>
<Bias>20</Bias>
<MinValue>-20</MinValue>
<MaxValue>20</MaxValue>
</Sim>
</Parameter>
</Animation>
</PartInfo>
<PartInfo>
<Name>cylinder_wiskey_compass_heading</Name>
<AnimLength>360</AnimLength>
<Animation>
<Parameter>
<Code>
(A:PLANE HEADING DEGREES MAGNETIC, degree)
</Code>
</Parameter>
</Animation>
</PartInfo>
<PartInfo>
<Name>c_wheel100-200</Name>
<AnimLength>200</AnimLength>
<Animation>
<Parameter>
<Code>
(A:GEAR CENTER STEER ANGLE, grads) 0 &gt; if{ (A:GEAR CENTER STEER ANGLE, grads) 0.25 * 100 + } els{ (A:GEAR CENTER STEER ANGLE, grads) 0.25 * 200 + }
</Code>
</Parameter>
</Animation>
</PartInfo>
<PartInfo>
<Name>usr_rdr</Name>
<AnimLength>100</AnimLength>
<Animation>
<Parameter>
<Code>
(A:RUDDER DEFLECTION, grads) 0 &gt; if{ (A:RUDDER DEFLECTION, grads) 0.25 * } els{ (A:RUDDER DEFLECTION, grads) 0.25 * 100 + }
</Code>
</Parameter>
</Animation>
</PartInfo>
<PartInfo>
<Name>light_fuelpump0</Name>
<Visibility>
<Parameter>
<Code>
(A:GENERAL ENG1 FUEL PUMP ON,bool)
</Code>
</Parameter>
</Visibility>
<MouseRect>
<TooltipText>Left Fuel Pump Indicator</TooltipText>
</MouseRect>
</PartInfo>
<PartInfo>
<Name>light_fuelpump1</Name>
<Visibility>
<Parameter>
<Code>
(A:GENERAL ENG2 FUEL PUMP ON,bool)
</Code>
</Parameter>
</Visibility>
<MouseRect>
<TooltipText>Right Fuel Pump Indicator</TooltipText>
</MouseRect>
</PartInfo>
<PartInfo>
<Name>light_fuelcock0</Name>
<Visibility>
<Parameter>
<Code>
2 (A:GENERAL ENG1 FUEL VALVE, bool) (A:CIRCUIT GENERAL PANEL ON, bool) + ==
</Code>
</Parameter>
</Visibility>
<MouseRect>
<TooltipText>Left Fuel LP Cock Indicator</TooltipText>
</MouseRect>
</PartInfo>
<PartInfo>
<Name>light_fuelcock1</Name>
<Visibility>
<Parameter>
<Code>
2 (A:GENERAL ENG2 FUEL VALVE, bool) (A:CIRCUIT GENERAL PANEL ON, bool) + ==
</Code>
</Parameter>
</Visibility>
<MouseRect>
<TooltipText>Right Fuel LP Cock Indicator</TooltipText>
</MouseRect>
</PartInfo>
<PartInfo>
<Name>light_starter0</Name>
<Visibility>
<Parameter>
<Code>
2 (A:GENERAL ENG1 STARTER, bool) (A:CIRCUIT GENERAL PANEL ON, bool) + ==
</Code>
</Parameter>
</Visibility>
<MouseRect>
<TooltipText>Left Starter Indicator</TooltipText>
</MouseRect>
</PartInfo>
<PartInfo>
<Name>light_starter1</Name>
<Visibility>
<Parameter>
<Code>
2 (A:GENERAL ENG2 STARTER, bool) (A:CIRCUIT GENERAL PANEL ON, bool) + ==
</Code>
</Parameter>
</Visibility>
<MouseRect>
<TooltipText>Right Starter Indicator</TooltipText>
</MouseRect>
</PartInfo>
<PartInfo>
<Name>light_xfeedl</Name>
<Visibility>
<Parameter>
<Code>
<!-- Having some issues with this code, keep getting it backwards -->
-1 (L:XFeedToggle,enum) (A:CIRCUIT GENERAL PANEL ON, bool) * ==
</Code>
</Parameter>
</Visibility>
<MouseRect>
<TooltipText>Fuel Cross Feed Right to Left</TooltipText>
</MouseRect>
</PartInfo>
<PartInfo>
<Name>light_xfeedr</Name>
<Visibility>
<Parameter>
<Code>
2 (L:XFeedToggle,enum) (A:CIRCUIT GENERAL PANEL ON, bool) + ==
</Code>
</Parameter>
</Visibility>
<MouseRect>
<TooltipText>Fuel Cross Feed Left to Right</TooltipText>
</MouseRect>
</PartInfo>
<PartInfo>
<Name>light_gen0</Name>
<Visibility>
<Parameter>
<Code>
2 (A:GENERAL ENG1 GENERATOR ACTIVE, bool) (A:CIRCUIT GENERAL PANEL ON, bool) + ==
</Code>
</Parameter>
</Visibility>
<MouseRect>
<TooltipText>Left Generator Active</TooltipText>
</MouseRect>
</PartInfo>
<PartInfo>
<Name>light_gen1</Name>
<Visibility>
<Parameter>
<Code>
2 (A:GENERAL ENG2 GENERATOR ACTIVE, bool) (A:CIRCUIT GENERAL PANEL ON, bool) + ==
</Code>
</Parameter>
</Visibility>
<MouseRect>
<TooltipText>Right Generator Active</TooltipText>
</MouseRect>
</PartInfo>
<PartInfo>
<Name>light_busbattery_lv</Name>
<Visibility>
<Parameter>
<Code>
0
</Code>
</Parameter>
</Visibility>
<MouseRect>
<TooltipText>Battery Bus Low Voltage</TooltipText>
</MouseRect>
</PartInfo>
<PartInfo>
<Name>light_busleft_lv</Name>
<Visibility>
<Parameter>
<Code>
0
</Code>
</Parameter>
</Visibility>
<MouseRect>
<TooltipText>Left Bus Low Voltage</TooltipText>
</MouseRect>
</PartInfo>
<PartInfo>
<Name>light_busright_lv</Name>
<Visibility>
<Parameter>
<Code>
0
</Code>
</Parameter>
</Visibility>
<MouseRect>
<TooltipText>Right Bus Low Voltage</TooltipText>
</MouseRect>
</PartInfo>
<PartInfo>
<Name>light_bus_triple_lv</Name>
<Visibility>
<Parameter>
<Code>
0
</Code>
</Parameter>
</Visibility>
<MouseRect>
<TooltipText>Triple Bus Low Voltage</TooltipText>
</MouseRect>
</PartInfo>
<PartInfo>
<Name>light_battery_lv</Name>
<Visibility>
<Parameter>
<Code>
0
</Code>
</Parameter>
</Visibility>
<MouseRect>
<TooltipText>Battery Low Voltage</TooltipText>
</MouseRect>
</PartInfo>
<PartInfo>
<Name>light_groundpower</Name>
<Visibility>
<Parameter>
<Code>
0
</Code>
</Parameter>
</Visibility>
<MouseRect>
<TooltipText>Ground Power Enabled</TooltipText>
<!-- There is a toggle code to go here -->
</MouseRect>
</PartInfo>
<PartInfo>
<Name>light_unknown1</Name>
<Visibility>
<Parameter>
<Code>
0
</Code>
</Parameter>
</Visibility>
</PartInfo>
<PartInfo>
<Name>light_unknown2</Name>
<Visibility>
<Parameter>
<Code>
0
</Code>
</Parameter>
</Visibility>
</PartInfo>
<PartInfo>
<Name>light_unknown3</Name>
<Visibility>
<Parameter>
<Code>
0
</Code>
</Parameter>
</Visibility>
</PartInfo>
<PartInfo>
<Name>light_unknown4</Name>
<Visibility>
<Parameter>
<Code>
0
</Code>
</Parameter>
</Visibility>
</PartInfo>
<PartInfo>
<Name>switch_leopard_xfeed</Name>
<AnimLength>100</AnimLength>
<Animation>
<Parameter>
<Code>
50 (L:XFeedToggle,enum) 50 * +
</Code>
<Lag>200</Lag>
</Parameter>
</Animation>
<MouseRect>
<Cursor>Hand</Cursor>
<TooltipText>Flap Lever</TooltipText>
<MouseFlags>LeftSingle+RightSingle+LeftRelease+RightRelease</MouseFlags>
<CallbackCode>
(M:Event) 'LeftSingle' scmp 0 ==
if{ (L:XFeedToggle,enum) 0 == if{ -1 (>L:XFeedToggle,enum) (>K:CROSS_FEED_RIGHT_TO_LEFT) } els{ 0 (>L:XFeedToggle,enum) (>K:CROSS_FEED_OFF) } }
(M:Event) 'RightSingle' scmp 0 ==
if{ (L:XFeedToggle,enum) 0 == if{ 1 (>L:XFeedToggle,enum) (>K:CROSS_FEED_LEFT_TO_RIGHT) } els{ 0 (>L:XFeedToggle,enum) (>K:CROSS_FEED_OFF) } }
</CallbackCode>
</MouseRect>
</PartInfo>
<PartInfo>
<Name>switch_leopard_starter</Name>
<AnimLength>100</AnimLength>
<Animation>
<Parameter>
<Code>
50 (L:StarterToggle,enum) 50 * +
</Code>
<Lag>200</Lag>
</Parameter>
</Animation>
<MouseRect>
<Cursor>Hand</Cursor>
<TooltipText>Starter Switch</TooltipText>
<MouseFlags>LeftSingle+RightSingle+LeftRelease+RightRelease</MouseFlags>
<CallbackCode>
(M:Event) 'LeftSingle' scmp 0 ==
if{ -1 (>L:StarterToggle, enum) (>K:TOGGLE_STARTER1) }
(M:Event) 'LeftRelease' scmp 0 ==
if{ 0 (>L:StarterToggle, enum) (>K:TOGGLE_STARTER1) }
(M:Event) 'RightSingle' scmp 0 ==
if{ 1 (>L:StarterToggle, enum) (>K:TOGGLE_STARTER2) }
(M:Event) 'RightRelease' scmp 0 ==
if{ 0 (>L:StarterToggle, enum) (>K:TOGGLE_STARTER2) }
</CallbackCode>
</MouseRect>
</PartInfo>


<PartInfo>
<Name>switch_bussense</Name>
<AnimLength>50</AnimLength>
<Animation>
<Parameter>
<Code>50 (L:Bus_Sense, bool) 50 * -</Code>
</Parameter>
</Animation>
<MouseRect>
<Cursor>Hand</Cursor>
<CallbackCode>(L:Bus_Sense, bool) ! (>L:Bus_Sense, bool)</CallbackCode>
<TooltipText>Bus Sense</TooltipText>
</MouseRect>
</PartInfo>
<PartInfo>
<Name>switch_bustie</Name>
<AnimLength>50</AnimLength>
<Animation>
<Parameter>
<Code>50 (L:Bus_Tie, bool) 50 * -</Code>
</Parameter>
</Animation>
<MouseRect>
<Cursor>Hand</Cursor>
<CallbackCode>(L:Bus_Tie, bool) ! (>L:Bus_Tie, bool)</CallbackCode>
<TooltipText>Bus Tie</TooltipText>
</MouseRect>
</PartInfo>
<PartInfo>
<Name>T38_toggle_Flaps</Name>
<AnimLength>100</AnimLength>
<Animation>
<Parameter>
<Code>
50 (L:FlapToggle,enum) 50 * +
</Code>
<Lag>200</Lag>
</Parameter>
</Animation>
<MouseRect>
<Cursor>Hand</Cursor>
<TooltipText>Flap Lever</TooltipText>
<MouseFlags>LeftSingle+RightSingle+LeftRelease+RightRelease</MouseFlags>
<CallbackCode>
(M:Event) 'LeftSingle' scmp 0 ==
if{ -1 (>L:FlapToggle, enum) (>K:FLAPS_INCR) (P:local time, seconds) 0.5 + (>L:Flap_reset) }
(M:Event) 'RightSingle' scmp 0 ==
if{ 1 (>L:FlapToggle, enum) (>K:FLAPS_DECR) (P:local time, seconds) 0.5 + (>L:Flap_reset) }
</CallbackCode>
</MouseRect>
</PartInfo>
<PartInfo>
<Name>T38_Logic</Name>
<Visibility>
<Parameter>
<Code>
<!-- RESET FLAP LEVER TO NEUTRAL -->
(L:Flap_reset) (P:local time, seconds) &gt;
if{ }
els{ 0 (>L:FlapToggle,enum) }
</Code>
</Parameter>
</Visibility>
</PartInfo>
<!-- End CMC Leopard Animations -->

3419834199

hairyspin
January 23rd, 2016, 12:53
Sorry, you're using a newer version of Max than I have.

Firebar
January 23rd, 2016, 13:17
Dang, unfortunately it was the only legal copy I could get that fit a gamepack. Bit of hard work though, I had to download a torrent and then activate that with my student version key as the downloader wouldn't work! Though it's something of a mashed mix of the p3d 2.5 and 1.4 packs. I'm really bemused by the bit where some areas work, but others, on directly copied but re tagged parts don't.

You our wouldn't mind testing the model and seeing if the mouserects on the console between the seats work for you? Or waiting until Sunday evening when I can do a save as previous if you let me know your version.

hairyspin
January 25th, 2016, 10:54
Too much going on yesterday. For what it's worth, I use Max 2008. You might get a taker on FSDeveloper, we have some Max 2015 users there. :wavey:

I'm puzzled at the need to rescale in MCX: the System Unit is at 1 unit to 1 Metre in Max, surely? It doesn't matter what units the viewports are set to, or have you built it at 1% size? Oops...

Firebar
January 25th, 2016, 11:36
Yeah the Sunday thing was just as I was away from my desktop over the weekend, I'm in no rush really, I've been fiddling with this off and on for about 5 years now after all.

I can't remember my FSDeveloper login ............ :P it's probably Firebar?


I'm puzzled at the need to rescale in MCX: the System Unit is at 1 unit to 1 Metre in Max, surely? It doesn't matter what units the viewports are set to, or have you built it at 1% size? Oops...

The idea was to build at a larger scale to get the accuracy / precision for typing points in when I needed to, I'm not sure about doing it like that, it does work but it's a hassle, though I'm looking at a .bat that does the whole "compile>scale>move" process with one click.

Might have to attempt to get into FSDeveloper, as it looks like Max 2015 will only export back to Max 2012. Exceedingly annoying!

hairyspin
January 26th, 2016, 11:43
The idea was to build at a larger scale to get the accuracy / precision for typing points in when I needed to...

Matt, you can work in feet and inches, fractional inches, metres, millimetres, centimeters or even kilometres (!) whenever you like, as long as the System Unit is correct. If I want to adjust positions in fractions of a millimetre, I set the Display Unit Scale to millimetres. Having done that and wanting to build a major extension to Heathrow's fifth runway (I jest...) then kilometres may be more appropriate. Gmax does exactly the same, although it buries the System Unit Scale away in the Preferences: the only plus point over Max I know of...

Firebar
January 26th, 2016, 14:45
Yeah I may have got a bit carried away, and slightly forgotten that feature. I'm going to have to bite the bullet and rescale it all at some point I know though! :O on the other hand looking to fix my problem there lead me to MCX which didn't exist last time I was looking at this stuff! I hadn't had a copy of FSX until it got a steam release and my FS9 had been gathering dust for a fair few years! This just started because I wanted something to amuse myself with in the evenings after work!

On on the mouse rect problem I've found a temporary work around, planes with the see through side up. It looks like I've got to do the same for the panel as the click spots have gone from there too. Oddly even the ones from the 2D gauges.

M