May 28, 201016 yr Moderator I have a vintage GNS430 scripted in FS9 syntax XML that's been working fine as a 2d and VC gauge for years.Now I've need to interface 3d buttons in a VC to interact with the GNS430...Okay, I've long noted the list of key_events such as GPS_ENTER_BUTTON in the SDK, and thought this would do the trick nicely!Included in the GNS430 XML script is the section for <Keys>: <Keys> ............... <On Event="GPS_ENTER_BUTTON">@ENTButton</On> ............... </Keys> However, all attempts so far have failed miserably... <sigh>I've created a custom entry for modeldef.xml as follows: <Animation name="GPS2_ENTER_BUTTON" guid="38ada83c-57b7-44ae-8b4e-379b5f915661" length="50" type="Sim" typeParam2="GPS2_ENTER_BUTTON" typeParam="AutoPlay" /> <PartInfo> <Name>GPS2_ENTER_BUTTON</Name> <MouseRect> <Cursor>Hand</Cursor> <TooltipText>Enter</TooltipText> <EventID>GPS_ENTER_BUTTON</EventID> </MouseRect> </PartInfo> The tooltip displays, but clicking on the button does precisely nothing...I've tried various combinations all to no avail. <CallbackCode> 1 (>K:GPS_ENTER_BUTTON)</CallbackCode><CallbackCode> (>K:GPS_ENTER_BUTTON)</CallbackCode> If anyone call tell me how to get this working, I'd be very, very grateful! :( Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
May 29, 201016 yr Bill, I know you're trying to do this 3d VC style - here's some code from the FS9 stock GPS500. It looks like the GPS has an internal variable just to be used for enter button down -- (@g:entButtonDown) Here's the code snippets not including the actual function of the enter button. Maybe will help-- maybe not... Here goes. Roman <!-- The actual 2 bitmap movement --><Element><Position X="398" Y="226"/><Select><Value>(@g:entButtonDown) 0 !=</Value><Case Value="0"><Image Name="gps_500_ent_out.bmp"/></Case><Case Value="1"><Image Name="gps_500_ent_in.bmp"/></Case></Select></Element><!-- The mouse command --><Area Name="ENT Button" Left="405" Top="232" Width="34" Height="21"><Click Kind="LeftSingle+Leave">(M:Event) 'LeftSingle' scmp 0 == (@g:entButtonDown) 0 == and if{ 1 (>@g:entButtonDown) @ENTButton }(M:Event) 'Leave' scmp 0 == (@g:entButtonDown) 1 == and if{ 0 (>@g:entButtonDown) }</Click><Cursor Type="Hand"/><Tooltip ID="TOOLTIPTEXT_GPS_ENTER_BUTTON"/></Area> FS RTWR SHRS F-111 JoinFS Little Navmap
May 29, 201016 yr Ahh, I see the problem now, disregard past...Can you use L:vars in modeldef.xml ? If so maybe try to send a boolean from the 3D button to the actual GNS430 code to activate the @ENTButton macro then reset the bool to 0. Kinda seems the same as using the stock >K:GPS_ENTER_BUTTON.. But that doesn't work :-( Roman FS RTWR SHRS F-111 JoinFS Little Navmap
May 29, 201016 yr Author Moderator Ahh, I see the problem now, disregard past...Can you use L:vars in modeldef.xml ? If so maybe try to send a boolean from the 3D button to the actual GNS430 code to activate the @ENTButton macro then reset the bool to 0. Kinda seems the same as using the stock >K:GPS_ENTER_BUTTON.. But that doesn't work :-( RomanRoman, the problem seems to stem from the simple fact that all of the @Macros used in the <Mouse> section are inaccessible from "outside" the <Mouse> section......in other words, even calling for @ENTButton macro from the "main gauge" section of the XML script will not work!I tried setting an (L:GPS2_ENTER_BUTTON,bool) variable from the 3d button (via embedded modeldef.xml script).In the "main gauge" section of my GNS430 I successfully detected the (L:GPS2_ENTER_BUTTON,bool) variable's value, but the call for @ENTButton macro was ignored.<Update> <!-- //////////////// 3D MODEL INTERFACE SCRIPTS /////////////// --> (L:GPS2_ENTER_BUTTON,bool) if{ 1 (>@g:entButtonDown) @ENTButton 0 (>L:GPS2_ENTER_BUTTON,bool) } (L:GPS2_DTK_BUTTON,bool) if{ @DTOButton2 0 (>L:GPS2_DTK_BUTTON,bool) }</Update> Moving the @ENTButton macro to the "main gauge" section will not work, because then the <Mouse> section can't find the darned @Macro! and the sim will crash with a "panel.dll" error... :( BTW, the only working example I have at hand is David Brice's brilliant Iris DA42 3d model. The only difference is that he's scripted their G1000's using the FSX XML schema... Looking at the embedded XML in the model clearly shows that the XML script used is:<EventID>G1000_MFD_ENTER_BUTTON</EventID>In the MFD's script I see that the FSX XML schema allows the mouse section's @Macros to be placed in the "main gauge" area, which makes them accessible to both the <Mouse> section as well as the "main gauge" section...For much the same reason, even trying to use @g:entButtonDown variable won't do the job, because while anything in the "main gauge" section that uses the @g:entButtonDown variable will respond, anything in the <Mouse> section using the @g:entButtonDown variable will be ignored...It's as though in the FS9 XML schema that everything within the <Mouse> area runs in it's own little closed "universe" and that communications is strictly a one-way street from the "Mouse Universe" to the "Real Universe..." :( Round and round I go... :( Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
May 30, 201016 yr Bill, Very, very strange. I thought I'd give it a test on your first version try. I assigned the keyboard controls to have the GPS enter button work with CTRL-SHFT-E. It worked! I then made a small gauge with a click spot to have (>K:GPS_ENTER_BUTTON). That worked too! Then cleared the keyboard assignment, still worked. Between each test I swapped 2 aircraft. No idea what the problem is now, as you said round & round. Roman FS RTWR SHRS F-111 JoinFS Little Navmap
May 30, 201016 yr Author Moderator Bill, Very, very strange. I thought I'd give it a test on your first version try. I assigned the keyboard controls to have the GPS enter button work with CTRL-SHFT-E. It worked! I then made a small gauge with a click spot to have (>K:GPS_ENTER_BUTTON). That worked too! Then cleared the keyboard assignment, still worked. Between each test I swapped 2 aircraft. No idea what the problem is now, as you said round & round. RomanInteresting that the XML scripted gauge works, but the same command issued from embedded XML script in the model file won't... :(Actually, I've just thought of a possiblity I haven't tried yet...<Update> <!-- //////////////// 3D MODEL INTERFACE SCRIPTS /////////////// --> (L:GPS2_ENTER_BUTTON,bool) if{ (>K:GPS_ENTER_BUTTON) 0 (>L:GPS2_ENTER_BUTTON,bool) } (L:GPS2_DTK_BUTTON,bool) if{ (>K:GPS_DIRECTTO_BUTTON) 0 (>L:GPS2_DTK_BUTTON,bool) }</Update> Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
May 30, 201016 yr Author Moderator SOLUTION FOUND!!!Ding, ding ding!The "solution" has turned out to be quite simple in retrospect, but it took a very long time for this aged, weary and simple soul to find... In the XML GNS430 gauge itself, monitor for custom L:var input from the model's XML scripted buttons, then instead of trying to execute the @Macro directly, simply issue the stock K:Event required: <Update> <!-- //////////////// 3D MODEL INTERFACE SCRIPTS /////////////// --> (L:GPS2_ENTER_BUTTON,bool) 1 == if{ 1 (>@g:entButtonDown) (>K:GPS_ENTER_BUTTON) 0 (>L:GPS2_ENTER_BUTTON,bool) } (L:GPS2_DTK_BUTTON,bool) 1 == if{ (>K:GPS_DIRECTTO_BUTTON) 0 (>L:GPS2_DTK_BUTTON,bool) }</Update> It took me awhile to realize that it was working, because I'd quite forgotten that I have a "boot routine" that requires the user to press the ENT button twice on initial startup.Since I wasn't sending the @g:entButtonDown command, the boot screen would never execute, thereby "masking" that the DTK button was being recognized, but couldn't be seen!DUH!!!So this is what the expression "hoisted on his own petard" means... :( :( :( Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
June 1, 201016 yr Bill, Glad you got this one... I see there, in other threads, that all may not be good in this project. Sorry, no help in the X format. Get 'er done..Roman FS RTWR SHRS F-111 JoinFS Little Navmap
June 1, 201016 yr Author Moderator Bill, Glad you got this one... I see there, in other threads, that all may not be good in this project. Sorry, no help in the X format. Get 'er done..RomanWell, as of yesterday I finally got everything working, albeit not without a great deal of pain.Certain of the <Keys> simply do not work at all, and at least two are reversed (terrain and flightplan).I ultimately wound up assigning the faces of the 3d buttons to the $VC_01 material, and adjusting the bitmap graphics to better match the hi-res textures used on the rest of the mesh. Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
Create an account or sign in to comment