Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hi All,

I am trying to set joystick buttons for the A2A P47 as per a number of very helpful contributions here and elsewhere.

The simple on/off toggle switches operate fine when allocated to a button but I have difficulty setting, multi-position switches, for example, the fuel selector.

Can I set this up so that it cycles through the limited options ( main, aux etc) on each button press?

Many thanks for any help,

Best Regards.

Posted

The simple on/off toggle switches operate fine when allocated to a button but I have difficulty setting, multi-position switches, for example, the fuel selector.

Can I set this up so that it cycles through the limited options ( main, aux etc) on each button press?

Yes. It involves editing the INI file.

First, in FSUIPC, assign the button to "Offset byte cyclic increment". Set the offset field to x66C0 (a user offset, freely usable -- there's a range of them, from 66C0 to 66FF), and the parameter field to 1/n where n is the number of choices you want, less one. For instance a 4-way choice would be 1/3.

This command simply changes that offset by 1 every time you press it., cycling back to 0 after it reaches the maximum, 3 in this example.

Now OK out of FSUIPC options and load up the INI file in a normal text editor (e.g. Notepad -- not Wordpad). Find the line in the [buttons] section defining the action you just set (search for that '66C0' part). The line will be in the form

n=Pjoy,btn,Cx510066C0,x00030001

Now you have to add a line for each action, in the form:

m=B66C0=x Pjoy,btn,Ccontrol,0

m is incremented, it is a line number.

x goes from 0 to 3, 4 lines for 4 choices

"control" is the control number for the action you want -- look this up in the List of FS controls document installed by FSUIPC.

For more explanation please see the Advanced User's guide.

Regards

Pete

Posted

Hi Pete,

Many thanks for the very prompt reply and the excellent support.

I have tried what you suggested, it all seems logical.

In FSX/FSUIPC I set up the button to Offset Byte Inc, x66C0 with parameter 1/3 for the 4 way option, no event on release.

I used FSUIPC logging to track the commands as I make them with the mouse...extract below... so it looks like C65962 is the command I need in all 4 cases and the 4 positions had parameters 0, 5,6 and 7. Is this correct?

69157 *** EVENT: Cntrl= 66508 (0x000103cc), Param= 99 (0x00000063) PANEL_ID_CLOSE

69157 *** EVENT: Cntrl= 66507 (0x000103cb), Param= 100 (0x00000064) PANEL_ID_OPEN

69157 *** EVENT: Cntrl= 65962 (0x000101aa), Param= 0 (0x00000000) FUEL_SELECTOR_SET

69157 *** EVENT: Cntrl= 66488 (0x000103b8), Param= 1 (0x00000001) ANTI_ICE_SET_ENG1

69204 *** EVENT: Cntrl= 66508 (0x000103cc), Param= 99 (0x00000063) PANEL_ID_CLOSE

69204 *** EVENT: Cntrl= 66507 (0x000103cb), Param= 100 (0x00000064) PANEL_ID_OPEN

69204 *** EVENT: Cntrl= 65962 (0x000101aa), Param= 0 (0x00000000) FUEL_SELECTOR_SET

69204 *** EVENT: Cntrl= 66488 (0x000103b8), Param= 1 (0x00000001) ANTI_ICE_SET_ENG1

I edited FSUIPC.ini as below in the aircraft specific button section (also tried the general section) using the same button as I set up in FSUIPC/FSX originally

0=P2,1,Cx510066C0,x00030001

1=B66C0=0 P2,1,C65962,0

2=B66C0=1 P2,1,C65962,5

3=B66C0=2 P2,1,C65962,6

4=B66C0=3 P2,1,C65962,7

Unfortunately, nothing is activated on reloading but I notice that the button is now "grayed out" in FSUIPC.

Really grateful for any help,

Many thanks.

Posted

Unfortunately, nothing is activated on reloading but I notice that the button is now "grayed out" in FSUIPC.

Yes, when you have more than one assignment to a button, you cannot edit it in the options -- it would get too confusing and error prone since that dialogue can only handle one assignment and I didn't want to make it more complex for the 99.9% of uses and users.

Could you enable Button logging and try using the button. that should tell us what is happening. I'm not able to try it here at present -- at least not till tomorrow.

[LATER]

Ok, it is "tomorrow" now, and I've tried it, at least in FS9. The default 737 uses parameters 1, 14 and 15 for that control, and using those values instead of your 0, 5, 6, 7 works fine. I think the parameter values come from this list:

0=None, 1=All, 2=Left, 3=Right, 4=LeftAux,

5=RightAux, 6=Centre, 7=Centre2, 8=Centre3, 9=External1,

10=External2, 11=Right Tip, 12=Left Tip, 14=Crossfeed LtoR, 15=Crossfeed RtoL

so your selection should choose Off, Right Aux, Centre and Centre2, in turn. I have to ask, does that A2A P47 really have such an odd collection of fuel tanks? I think, possibly, that this is where you have things wrong? Or maybe the designers have simply re-used these Microsoft allocations differently?

Either way, there's nothing else wrong with the parameters.

Regards

Pete

Posted

Hi Pete,

Firstly, I want to thank you for all your help, FSUIPC is a great piece of software but the support is even better!

I started to read a bit more about LUA and so I used it to investigate my issue by trying to extract some data. I set up FSUIPC/LUA logging and when going through the positions with the mouse I discovered that the parameters for the relevant Lvar were in fact 0,1,2,3. I then wrote a short lua file for the button which I debugged by writing to the screen (a really useful tool!). Basically it's an if/then/else statement which is called on the button toggle, reads the state of the variable, increments by 1 and cycles 0-1-2-3. I haven't thoroughly tested it yet but so far it seems to work fine. I've done the same now for a set of radio switches, also seems to work fine.

The loose end I guess is the meaning of the FSUIPC logged parameters, 0,5,6,7 ???

In any case, I'm very impressed with the FSUIIPC/Lua combination, it seems really powerful and I'm looking forward to exploring and learning more.

Many thanks again for your help

Regards and best wishes.

Posted

The loose end I guess is the meaning of the FSUIPC logged parameters, 0,5,6,7 ???

I don't know -- FSUIPC only logs what it sees being passed through the FS controls system. If those were the parameters created by using the mouse on the switch then the same values sent by other means should have had the same effect.

Regards

Pete

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
×
×
  • Create New...

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.