Jump to content
The simFlight Network Forums

Problems with multiple fsuipc.ini's


hm

Recommended Posts

Hi,

I have some problems when I want to use more than one fsuipc.ini (fsuipc_1.ini and fsuipc_2.ini, the files are containing a small difference in button programming). Therefore I have two shortcuts created to FS9, one is containing ...fs9.exe /CFG:FS9_1.CFG the other one ...fs9.exe /CFG:FS9_2.CFG. Both containing fs9x.cfg's are containing a section:

{FSUIPC} <-- brackets of course

ControlName=fsuipc_x where x is "1" or "2"

I have two problems: First of all there is no FSUIPC button programming anymore when running fs9 (the fsuipc_x.ini isn't read?) and secondly the section {FSUIPC} is disapeared from the fs9_x.cfg when FS9 is closed.

BTW something weird: the fs9x.cfg's have to be in the FS9 main folder or are created in the fs9 main folder; I had an error in the fs9.cfg name of the shortcut and FS9 started like a fresh installation and created the fs9xx.cfg file in the FS9 "root".

What is wrong or what am I doing wrong ?

hugo

Link to comment
Share on other sites

What is wrong or what am I doing wrong ?

Good catch! You've found a facility in FSUIPC which I'd forgotten all about, and which hasn't been changed to work with FS2004! Many apologies. I'll try to fix this for the next release.

This statement worries me though: "the section {FSUIPC} is disapeared from the fs9_x.cfg when FS9 is closed". If FS2004 is removing sections which it doesn't recognise, then I will have to find another way to specify these parameters.

Incidentally, you say "the files are containing a small difference in button programming". Couldn't you accomplish this difference at all using the conditional button programming, possibly using flags changed by a Key Press? I don't think there should be any need for separate configurations for buttons -- only for axis assignments (though that's an area I also want to tackle eventually).

Regards,

Pete

Link to comment
Share on other sites

Hi Peter,

If I could make AND functions between 3 or more buttons/flagsI think it is now limited to 2. Or maybe an

Button definitions

IF (flag)

Button definitions

.

.

ELSE

Button definitions

.

.

ENDIF

Button Definitions

.

.

in FSUIPC.INI ?

BTW My sincere congratulations with your award.

Hugo

Link to comment
Share on other sites

If I could make AND functions between 3 or more buttons/flagsI think it is now limited to 2.

You can have two conditions on each, which gives you four possible meanings for each button just from two flags. Or you can have N flags with only ever one set at a time, and hence have N possible results for each button with only one condition on each -- each one testing a different flag for "on".

What limitation are you seeing?

Regards,

Pete

Link to comment
Share on other sites

Hi Pete,

Sorry to bother you again. But I tried your advise with something like this

{Keyss}

;TAB-F1 toggles flag 10 (0 = Mig21, 1 = F104)

0=112,16,C1005,10

{Buttons}

; -7, +6 sets Flag 0,11

0=CP(-0,7)0,6,C1003,11

; reset flag

1=CU(-0,7)0,6,C1004,11

; -6, +7 sets Flag 0,12

2=CP(-0,6)0,7,C1003,12

; reset flag

3=CU(-0,6)0,7,C1004,12

.

.

; +5, +6 , -7 toggle airbrake;

19=CP(+F0,11)0,5,C65589,0

; toggle drag chute when 5 comes up again

; = tail hook on Mig21, wing fold on F104

20=CU(-F0,10)(+F0,11)0,5,C66391,0

21=CU(+F0,10)(+F0,11)0,5,C66390,0

It didn't work :cry: but while I am typing this I see a possible problem. I should place rules 1 and 3 last in the definition, isn't it :oops: ? But in any case it does not declare why rule 19 wouldn't work.

Can you point me to the problem?

hm

Link to comment
Share on other sites

{Buttons}

; -7, +6 sets Flag 0,11

0=CP(-0,7)0,6,C1003,11

; reset flag

1=CU(-0,7)0,6,C1004,11

; -6, +7 sets Flag 0,12

2=CP(-0,6)0,7,C1003,12

; reset flag

3=CU(-0,6)0,7,C1004,12

I'm confused. Are you pressing these buttons whilst doing something else? If you just press and release you are setting and clearing the flag, so nothing really happens. If you want to press and hold a button why bother to use a flag? Why not just use the button directly in the condition?

Second, you seem to be making them mutually exclusive -- neither does anything unless the other isn't pressed. I can understand that if you wanted a third condition to operate if they are both pressed at the same time, but you've not listed anything like that. And in any case it is practically impossible to press or release two buttons simultaneously unless its done by wiring and a third button (or position on a multi way switch).

You seem to be making things very complicated, so much so that I now don't understand what you want to do. I thought you had a few buttons which you originally wanted to have different actions for different *loads* of FS -- i.e. not even changing in one session.

Consequently, all you want are a set of Flags (one for each such "Mode"), which you set based on, probably, a set of KeyPresses. Say TAB+1 for flag 10, TAB+2 for flag 11Tab+9 for Flag 18 etc.

Then for each button you want to have multiple uses just define each such use with the appropriate Flag condition.

Once a Flag is set it remains set for the whole session unless you program a way to clear it, or use "toggle" for the key press.

I see a possible problem. I should place rules 1 and 3 last in the definition

The order only matters where things are dependent, and doesn't matter at all where the events are different. Since 1 and 3 are merely events of Releasing buttons 6 and 7 respectively, they would be ignored when such an event is not being processed. So it doesn't matter where they are.

Can you point me to the problem?

Well, I have no idea what you are trying to do there. It doesn't seem to bear much relation to what we were discussing. But certainly you don't need to use flags at all to mark that you are holding a button pressed -- the button itself is the flag!

Regards,

Pete

Link to comment
Share on other sites

HI Pete,

Sorry but it isn't complicated at all, I want to eliminate keyboard entries as much as possible. I have a MS joystick with 8 buttons; I use buttons 6 and 7 to give, depending on their combined state, up to 4 different functions to the each of the other 6 buttons. Thats easy to program thanks to the compound button programming. Untill a few days back all was allright but I purchased the CS F104. I had allready the CS MIG21. I programmed for the MIG that the combination of 7 down, 6 up and 5 going down toggles the Airbrake and when 5 goes up also the dragshute was activated. The last command is by the Mig21 coupled to "toggle tail hook", with the F104, however, the command toggles indeed the tailhook and the drag shute is coupled to "toggle wing fold". Therefore I use a flag which I programmed with TAB-F1, to make a difference between The Mig and the Starfighter.

In that case however I should program something like this for the drag shute:

20=CU(-0,6)(+0,7)(-F0,10)0,5,C66391,0

21=CU(-0,6)(+0,7)(+F0,10)0,5,C66390,0

That's invalid, so I decided to use a flag to follow the button combination:

0=CP(-0,7)0,6,C1003,11

1=CU(-0,7)0,6,C1004,11

IMHO this means: is button 7 up and 6 goes down, set flag 11, if button

7 is up and button 6 goes up, reset flag 11.

Maybe it is better to change this to:

0=CP(-0,7)0,6,C1003,11

1=CU(+F0,11)0,6,C1004,11

Now I have coupled the condition of both buttons to 1 flag and can I change this:

20=CU(-0,6)(+0,7)(-F0,10)0,5,C66391,0

21=CU(-0,6)(+0,7)(+F0,10)0,5,C66390,0

to:

20=CU(+F0,11)(-F0,10)0,5,C66391,0

21=CU(+F0,11)(+F0,10)0,5,C66390,0

which seems to me valid, or ...not? Why then?

hm

Link to comment
Share on other sites

I want to eliminate keyboard entries as much as possible.

That's fine. But we started this with you trying to use separate CFG and INI files altogether. So the whole FS session had one set of button interpretation or another. To replicate that with conditional buttons would be easy enough, and less wasteful of buttons by using a keypress (which you only have to ever use once per session, after loading FS) to select the appropriate interpretation.

If you wanted, you could for each such key press, set one flag and clear all the others. It's a lot of lines but then you could change the button configuration at any time.

0=CP(-0,7)0,6,C1003,11

1=CU(-0,7)0,6,C1004,11

IMHO this means: is button 7 up and 6 goes down, set flag 11, if button

7 is up and button 6 goes up, reset flag 11.

Yes, okay. You are meaning to hold the button, but you want three other cases (not shown) where you are pressing both 6 and 7, or not pressing either, or pressing 7 but not 6. I hadn't realised you wanted all your button modes to be active all the time, even pressing up to 3 buttons at the same timewell, not quite, you have to get the order correct every time unless you've provided multiple versions of these for the other orders of button pressings and releasings.

Sounds like for your 4 conditions you need a total of 8 pairs like those above, so you can press 6 or 7 in any order. Actually the two pairs with neither pressed would be identical or even redundant, of course, so that makes 6 pairs. This assumes you "main action" button is always pressed last.

Maybe it is better to change this to:

0=CP(-0,7)0,6,C1003,11

1=CU(+F0,11)0,6,C1004,11

Don't see why you'd need to, but go on ...

Now I have coupled the condition of both buttons to 1 flag and can I change this:

20=CU(-0,6)(+0,7)(-F0,10)0,5,C66391,0

21=CU(-0,6)(+0,7)(+F0,10)0,5,C66390,0

to:

20=CU(+F0,11)(-F0,10)0,5,C66391,0

21=CU(+F0,11)(+F0,10)0,5,C66390,0

Okay. Now I understand what you are wanting, it starts to make more sense. It doesn't seem at all to relate to the original problem you asked me about, hence my confusion. But I would be concerned about the order of your button operations. Remember that these lines are only scanned when a button changes, and that's the "active" button in the lines, not the conditions. Conditions changing don't do anything, the conditions are simply states which are tested when the active button changes.

which seems to me valid, or ...not? Why then?

Doesn't it work the way you thought? Is it simply the order of button operations which is mucking things up?

Regards,

Pete

Link to comment
Share on other sites

Pete,

Thanks for your patience and reactions.

Now I am at home and can test the discussion of above. My first question however was related to this solution with the flags because at first I wanted to use two different fsuipc.ini's, one for the Mig and another one for the F 104. But :wink:

In any case thanks again. Going back now to some "PLC programming" in fsuipc.ini :)

Hugo

Link to comment
Share on other sites

Hi Pete and all,

It works, however it was more complex than I assumed.

First of all I made my flag conditions wrong "(+F..." in stead of "(F+..." , the {Keyss} definition doesn't seem to work. But I am a little bit confused here because the combination for shift, alt, ctrl and tab seems different for "key input" as for "key output". If I use tab the second parameter has to be 8 + 16 (24), on the other hand if I want to generate TAB-F1 the 4th parameter would be 12 ??? ex. "0=P1,3,112,12"

I have programmed my key combinations as follows:

;[Keyss]

;0=112,24,C1003,10

[buttons]

;

;7 up, 6 down, set flag 11

;

0=CP(-0,7)0,6,C1003,11

;

; Is flag 11 set and 6 released, clear flag 11

;

1=CU(F+0,11)0,6,C1004,11

;

; 6 up, 7 down, set flag 12

;

2=CP(-0,6)0,7,C1003,12

;

; Is flag 12 set and 7 released, clear flag 12

;

3=CU(F+0,12)0,7,C1004,12

;

; Here is the trick: if we push 6 before 7 then flag 11 is

; set (because we pushed 6 first and satisfied rule 0), so if

; 6 is down and flag 11 set and 7 is down reset flag 11

;

4=CP(+0,6)(F+0,11)0,7,C1004,11

;

; Now set the flag 13 for the 6 and 7 down

;

5=CP(+0,6)0,7,C1003,13

;

; If flag 13 is set and we release button 7, reset flag 13, rule 9 will

; reset the flag if we release button 6 first :)

;

6=CU(F+0,13)0,7,C1004,13

;

; Now we use the same trick but we pushed button 7 before 6, so rule 2

; was satisfied first, so we need to reset flag 12

;

7=CP(+0,7)(F+0,12)0,7,C1004,12

8=CP(+0,7)0,6,C1003,13

9=CU(F+0,13)0,6,C1004,13

;

; We didn't use a flag for 6 and 7 up (difficult to program :( )

;

10=CR(-0,6)(-0,7)0,0,C65588,0

11=CP(-0,6)(-0,7)0,1,C65570,0

12=CR(-0,6)(-0,7)0,2,C65607,0

13=CR(-0,6)(-0,7)0,3,C65615,0

14=CP(-0,6)(-0,7)0,4,C65758,0

15=CP(-0,6)(-0,7)0,5,C65759,0

;

; So here we use flag 11 set as condition

;

16=CP(F+0,11)0,0,K192,1

17=CP(F+0,11)0,1,C65751,0

18=CR(F+0,11)0,2,C65771,0

19=CR(F+0,11)0,3,C65769,0

20=CP(F+0,11)0,4,C65589,0

;

; And we use flag 10 to make a different command if flag 10 is set or not

; toggle tail hook or toggle wing fold

;

21=CU(F+0,11)(F+0,10)0,4,C66390,0

22=CU(F+0,11)(F-0,10)0,4,C66391,0

23=CP(F+0,11)0,5,C66224,0

;

; Here we use flag 12 as the condition

;

24=CP(F+0,12)0,1,C65858,0

25=CR(F+0,12)0,2,C65777,0

26=CR(F+0,12)0,3,C65775,0

27=CP(F+0,12)0,4,K83,8

28=CP(F+0,12)0,5,K83,1

;

; And here flag 13, until the Keyss entry is solved we have to push

; 5, 6 and 7 to toggle flag 10

;

29=CP(F+0,13)0,1,C66293,0

30=CP(F+0,13)0,5,C1005,10

Thats all :roll:

Hugo

Link to comment
Share on other sites

the {Keyss} definition doesn't seem to work. But I am a little bit confused here because the combination for shift, alt, ctrl and tab seems different for "key input" as for "key output". If I use tab the second parameter has to be 8 + 16 (24), on the other hand if I want to generate TAB-F1 the 4th parameter would be 12 ??? ex. "0=P1,3,112,12"

Sorry, I don't understand what you mean by "Key Input" and "Key Output"?

All uses of TAB add 16 (the 24 you use for TAB+X). The value 12 would generate an ALT, not really recommended (as FSUIPC loases control when the Menus open up). This is consistently true here, it doesn't matter what the other key is.

Thats all :roll:

Phew! Well done! I must admit my brain is boggling a bit at all this. Would you care to write it up with just a little more explanation as to what you are doing, and why, so I can add it as an example (to boggle other Advanced User's brains too! :) ) in the Advanced Users Guide? With full credit (or blame? :) ) if you like?

Thanks for solving it. But I'm still puzzled about your Key press problem.

Regards,

Pete

Link to comment
Share on other sites

HI Pete,

I have taken the two sections of the "advanced". Surely it must be a typo.

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

220 \ | is in the 4th row down, to the left of all the alpha keys

188 , < is also in the 4th row down, to the right of the alpha keys

190 . > is to the right of 188

191 / ? is to the right of 190

The value is a combination (add them) of the following values, as needed:

1 Shift

2 Control

4 Tab

8 Normal (add this in anyway)

16 Alt (take care with this one—it invokes the Menu)

If only “normal” is needed, the whole parameter and the preceding comma can be omitted. Usual values are:

9 for shift+ …

10 for control+ …

11 for shift+control+ …

For FS controls the is a number from 65536 upwards, denoting the specific FS control number. Lists of these can be found in my various FS controls documents. In the FSUIPC Buttons page the controls are shown by

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

Keyboard Programming

FSUIPC’s options dialogue provides a page for programming keypresses to assign specific single FS controls. Here we look at how this programming is encoded in the FSUIPC.INI file, and how the programming can be extended to provide multiple controls for a single keystroke combination.

FORMAT OF KEY DEFINITIONS

The key programming is saved in a section in the INI file called [Keyss]. Up to 256 separate entries defining key actions can be included in this section, normally numbered sequentially from 0.

The format of each entry in the Keys section is as follows:

n=key,shifts,control,parameter

for a key press action only, or

n=key,shifts,control1,parameter1,control2,parameter2

for a key with press (1) and release (2) actions.

Here n can run from 0 to 255 (i.e. maximum 256 different keystroke actions can be added),

key virtual keycode, as in the FS CFG file (see list above, in the section about Buttons).

shifts 8 normal

+1 shift

+2 control

+4 alt (not really very useful)

+16 tab (an added "shift" to give more combinations)control FS control number (as in my lists), or special FSUIPC number for additional controls (these range from 1000 to 3000 at present: see list below).

parameter value to go with control, for "SET" types and some special FSUIPC controls.

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

I made a mistake too, and much worse :oops: because it locks the computer. In my previous message

7=CP(+0,7)(F+0,12)0,7,C1004,12

must be:

7=CP(+0,7)(F+0,12)0,6,C1004,12

Pete, I surely will make a better description of what I have done, but please correct my text then to make it more "english". English isn't my mother tongue.

Hugo

Link to comment
Share on other sites

I have taken the two sections of the "advanced". Surely it must be a typo.

Aaaarrrggghhh! Ouch! No, it isn't a typo. It is actually implemented like that! Oh, how horrible! I don't dare fix than now, it will muck up 'button to keypress' assignments or keypress programming.

The Hotkey definitions and the Button keypress conversion use 4=ALT, 16=TAB, whilst the Key press programming (the 'input' as you say) uses these bits the other way around.

I really must have had a bad hair day when I programmed one of those! Sorry. It'll just have to stay like that now. Stupid. :oops: :oops: :oops:

Pete, I surely will make a better description of what I have done, but please correct my text then to make it more "english". English isn't my mother tongue.

Thank you very much! I surely won't need to make many changes, as your English is pretty good already. :D

Regards,

Pete

Link to comment
Share on other sites

  • 2 weeks later...

Hi Hugo,

Sorry to have taken so long over this, and I know we've discssed other ways of solving your original problems now, but I just came to fix the problem you found, and I cannot find it. I think it all works as intended.

Just to refresh:

I have some problems when I want to use more than one fsuipc.ini (fsuipc_1.ini and fsuipc_2.ini, the files are containing a small difference in button programming). Therefore I have two shortcuts created to FS9, one is containing ...fs9.exe /CFG:FS9_1.CFG the other one ...fs9.exe /CFG:FS9_2.CFG. Both containing fs9x.cfg's are containing a section:

{FSUIPC} <-- brackets of course

ControlName=fsuipc_x where x is "1" or "2"

I have two problems: First of all there is no FSUIPC button programming anymore when running fs9 (the fsuipc_x.ini isn't read?) and secondly the section {FSUIPC} is disapeared from the fs9_x.cfg when FS9 is closed.

I think you are misinterpreting two things which are happening:

1. If you tell FSUIPC to use a different control name, say "TESTME" then a number of filename changes are assumed:

The INI file is now TESTME.INI

The LOG file is now TESTME.LOG

The KEY file is now TESTME.KEY

I think in your cae you didn't make a copy of your KEY file with the new name, so that load of FSUIPC wasn't registered. Because it wasn't registered you got no key and button mapping.

2. The [FSUIPC] section isn't being deleted from the FS9 CFG file. All that's happening is that other sections are being re-written after it. If you do a search you will find it still, buried amongst other FS stuff.

Finally, for all this, I have only tested it with the default FS9.CFG in the C:\Documents and Settings\\Application Data\Microsoft\FS9 folder. I haven't had to to check the /CFG: facility for loading FS9, but I would think it would still look for the CFG files in the same folder?

Regards,

Pete

Link to comment
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
×
×
  • 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.