Jump to content
The simFlight Network Forums

Possible minor issue with compound statements


Hipp0

Recommended Posts

Hi,

I've been playing around with compound statements for the first time and was having an issue where they appeared to work for some airplanes and not others. After hours of frustration I think I tracked the cause down to not having any button definitions already created for the controller that the modifier button belongs to.

So for

[buttons.FSX Default C-172]

500=CP(-0,19)5,0,C65651,0

501=CP(+0,19)5,0,C65648,0

the command with (+0,19) doesn't work. It doesn't matter whether I hold down button 0,19 or not, C65651 is always sent; and the logger always shows the condition for (+0,19) as false.

But with

[buttons.FSX Default C-172]

0=P0,32,C65607,0

500=CP(-0,19)5,0,C65651,0

501=CP(+0,19)5,0,C65648,0

everything works as it should.

As I couldn't find a previous report of this or any mention in the manuals, I thought I'd post it here. I realise it's unlikely that not many people will have controllers to which they haven't assigned ANY functions to buttons - I'm afraid that I do.

Link to comment
Share on other sites

And since I'm here, I'd like to ask another question if it's not too much trouble. I would like to have the choice of two (or more) modifier buttons, so in the example I gave above I would like be able have button 19 and button 2 available as modifiers.

What would be the best way to do this?

This appears to do what I want but does require another line to be added.

500=CP(-0,19)(-0,2)5,0,C65651,0

501=CP(+0,19)5,0,C65648,0

502=CP(+0,2)5,0,C65648,0

(-0,19)(-0,2) appears to be an AND, maybe a similar syntax to do an OR could be added (or already exists and I've missed it), so that lines 501 and 502 could be combined into one line?

I've setup literally hundreds of commands with only one modifier button (19). Although it won't be too much trouble to change them all to the above, it would be nice to have a more efficient way of doing this with just two lines instead of three.

Link to comment
Share on other sites

500=CP(-0,19)5,0,C65651,0

501=CP(+0,19)5,0,C65648,0

the command with (+0,19) doesn't work. It doesn't matter whether I hold down button 0,19 or not, C65651 is always sent; and the logger always shows the condition for (+0,19) as false.

Yes, FSUIPC doesn't scan any joystick numbers which don't have any actual assignments. I suppose it should really look at all of the conditionals to set the list to scan too, but it never has done so, and this has never been a problem.

I'm not sure I want to change that -- certainly not in FSUIPC3 in any case. Maybe in FSUIPC4 if it is easy to do. Which are you using, you don't say?

Meanwhile, it is best to just assign a button to some dummy action which does nothing. Maybe I should add that note to the manual.

(-0,19)(-0,2) appears to be an AND, maybe a similar syntax to do an OR could be added (or already exists and I've missed it), so that lines 501 and 502 could be combined into one line?

No, I'm not messing further with the complexity already there. The "this or this or this" system has ALWAYS ben by havng multiple lines as you've found. It is much simpler that way, and surely easier to understand. Even if I derived some horrible new format for ands and ors in one line, the format internally would still involve separating them out into multiple entries for separate testing. Seems much more sensible to keep the parameters in line with the way they are processed.

If you really want to get into very complex logic with things, try using Lua plug-ins, please. The reason I implemented Lua was to avoid making the existing code for such things so horrendously over complex and with more and more arcane syntax for the parameters.

Regards

Pete

Link to comment
Share on other sites

All very reasonable and informative as usual - thanks for replying. I'm using 4.827.

4.827 is very much out of date and long unsupported in any case. The current main release is 4.853.

Version 4.857 is now available too, with this problem fixed. I have changed the code for FSUIPC3 too, but this won't be released until something more major needs a change.

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.