Jump to content
The simFlight Network Forums

RESETTING FLAG Coding Problem.


Recommended Posts

Tried for long time but no luck.  Need help with a line of code to reset a flag on the X52 PRO PINKIE BUTTON to Off.

Background. X52 Pro. Running VRS Superbug/Tacpack.

  1. Button “C” on the stick.  It moves the TDC to the left DDI.  Uncages.  It sets the target. It designates.  All works fine. (See Lines 39  40  41)

  2. If I want to un-designate immediately or at a later stage, I want to use the same button, “C”, first by pressing the PINKIE, then Button “C” again. (see Line 42) Works fine up to here. 

  3. But I want to reset the Flag to be able to go to the target designations again if I need to without remembering to reset the Flag to “Clear” OFF by pressing the PINKIE. This instruction does not work!!!!!!

  4. I have one joystick which is “0”.   256 * 0 + 5 = 5.   ??

 

99=;#Code BELOW: TDC to RDDI, Uncage, Designate and Undesignate

39=P0,4,K39,10   -{Key press: ctl+Right}-

40=P0,4,K85,10 ; Uncage -{Key press: ctl+U}-

41=P0,4,K13,8     -{Key press: Rtn}-

42=CP(F+0,5)0,4,K46,9 ; Un-Designate         -{Key press: shft+Del}-

43=P0,5,C1004,5 ; Set Flag to OFF   ?????????????????????????????????????

99=;

 

Thank you

Charles Abela

------------------------

SPECS: Win 7 Premium - 64 BIT, Intel i7 5820, 16G Ram, NVIDIA GTX 970, Monitor 1920 x 1080 x 16.

VRS Superbug 1.4.3.4 + Tacpack.    EZDOK.    FSUIPC4 1.4.3.4 Paid Version.  X52 PRO.  FSX Acceleration.

Link to comment
Share on other sites

10 hours ago, Charles Abela said:
  • Button “C” on the stick.  It moves the TDC to the left DDI.  Uncages.  It sets the target. It designates.  All works fine. (See Lines 39  40  41)

  • If I want to un-designate immediately or at a later stage, I want to use the same button, “C”, first by pressing the PINKIE, then Button “C” again. (see Line 42) Works fine up to here. 

  • But I want to reset the Flag to be able to go to the target designations again if I need to without remembering to reset the Flag to “Clear” OFF by pressing the PINKIE. This instruction does not work!!!!!!

  • I have one joystick which is “0”.   256 * 0 + 5 = 5.   ??

You only have two lines related to the flag:

42=CP(F+0,5)0,4,K46,9 ; Un-Designate         -{Key press: shft+Del}-
43=P0,5,C1004,5 ; Set Flag to OFF   ?????????????????????????????????????

The first one tests the flag, and if set it sends a Shift+Del.
The second tries to toggle the flag and clear it at the same time!  Without checking the code I am not sure which will come first, but I think it is likely to clear it then toggle it (so turn it back on!). However, it is an odd thing to try to do,  and the results muct be considered indeterminate.

Oddly I see no line where you specifically SET the flag in the first place,!

And I think you missed or didn't understand this line in the description of flags in the Advanced Users guide:

 

Each time any button is pressed (goes from off to on) FSUIPC4 toggles its flag. This
makes the buttons flag a sort of “latching” switch.


If you want to use a button only for toggling a flag, just assign it to something which does nothing, e.g. keystroke K0,8. Or, more logically, use a flag which is not assocated at all with any device you have. As the manual says:

 

For every possible “normal” button (16 joysticks x 32 buttons = 512 buttons)
FSUIPC4 maintains a “Flag” (F).


So there are always 512 flags and you can set, clear, toggle and test any one of them.

 

However, I cannot support old versions of FSUIPC. If by " FSUIPC4 1.4.3.4" you do really mean 4.143d  which is VERY VERY old, dating back many years), or in fact anything earlier than 4.971, the currently supported version, then please update before coming back!

Pete

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

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