Jump to content
The simFlight Network Forums
Sign in to follow this  
dwilliams

[Solved] Newbie: How do I map to this existing script in FSX gauge file?

Recommended Posts

I want to execute  this "pfd NavKnob pressed" macro from the default G1000 gauge file with a key press. Here is an XML excerpt from the gauge file:

 

<MouseArea id="Push">

<FloatPosition>20.000,58.000</FloatPosition>

<Size>50,25</Size>

<CursorType>Hand</CursorType>

<MouseClick id="MouseClick">

    <Script>1 (>@g:pfd NavKnob pressed, bool) (L:SelectedNav2) 1 == if{ 0 } els{ 1 } (>L:SelectedNav2) </Script>

    <ClickType>LeftSingle</ClickType>

</MouseClick>

</MouseArea>

 

I think I read how to create my own macros, but how do you map to one that is already in the default gauge file?

 

Thanks - I know it's a newbie question. The end goal is to execute this via serial com.

 

-Dave

Edited by dwilliams

Share this post


Link to post
Share on other sites

OK, to suggest an answer to my own question, I expect I can make an FSUIPC mouse macro and assign it to a key without having to know what is in the gauge XML. But can I map directly to that g:pfd NavKnob pressed thing some way without having to make a macro?

 

Or am I trying to hard to do something simple?

 

-Dave

Share this post


Link to post
Share on other sites

OK, to suggest an answer to my own question, I expect I can make an FSUIPC mouse macro and assign it to a key without having to know what is in the gauge XML.

 

Mouse macros only work with gauges written to the standard Microsoft C/C++ gauges SDK.  They can't be used with XML gauges.

 

However, it may well work fine using the relevant local variable (L:Var) -- it looks like L:SelectedNav2 has something to do with it. Check using the FSUIPC assignable control to log L:Vars, or use the Lua plug-in provided to monitor them.

 

Pete

Share this post


Link to post
Share on other sites

Thanks, Pete. It does look like the LVAR gets toggled with the mouse press, so setting it directly should work. I'll let you know...

 

First, I have to buy the full-up FSUIPC - my "project" for the day.

 

Cheers,

 

Dave

Share this post


Link to post
Share on other sites

Bought the program, installed it, got the list of LVARs, made a macro, assigned it to a key --- works like a charm!  Thanks, Pete.

 

Now to learn the com stuff.

 

-Dave

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.