Jump to content
The simFlight Network Forums

Axis assignment and command delayed


Recommended Posts

Hi Pete,

when I set up an axis in more zone on the right-hand of the "Axis assignment", I need that the command is produced only if the value of the axis remains for some time (for example 1/2 sec) in the range, otherwise any command should not come out.

Why in this section the LUA commands don't work?

Thanks

Fabio Grappasonni

Link to comment
Share on other sites

when I set up an axis in more zone on the right-hand of the "Axis assignment", I need that the command is produced only if the value of the axis remains for some time (for example 1/2 sec) in the range, otherwise any command should not come out.

The detection is based on normal polling rates on the joystick. but if the axis values are changing, any very small zone could be missed. You probably need to widen the zones. You could try increasing the poll rate (descrease the poll interval parameter) but take care or you risk affecting FS performance.

Why in this section the LUA commands don't work?

Please explain. Who says they don't? The internal handling is the same for assignments no matter where they are made.

Regards

Pete

Link to comment
Share on other sites

Please explain. Who says they don't? The internal handling is the same for assignments no matter where they are made.

Regards

Pete

[buttons.LSH MD-82 McDonnell Douglas]

0=P0,13,CL6:R,0

1=P0,14,CL7:R,0

[LuaFiles]

4=tcas+c

5=tcas+d

6=tcas+m

7=tcas+u

[Axes.LSH MD-82 McDonnell Douglas]

0=1Y,500

1=1Y,U,1000,5500,L7:R,0

2=1Y,U,5500,9500,L5:R,0

3=1Y,U,9500,13000,L4:R,0

4=1Y,U,13000,16383,L6:R,0

In this example, the LUA command work in the buttons , but it does not work in the axis. Why?

Link to comment
Share on other sites

[buttons.LSH MD-82 McDonnell Douglas]

In this example, the LUA command work in the buttons , but it does not work in the axis. Why?

I don't know. should be okay. i'll check here and get back to you.

Can you please tell me exactly what version of FSUIPC you are using, just in case there are differences?

Pete

Link to comment
Share on other sites

0=1Y,500

1=1Y,U,1000,5500,L7:R,0

2=1Y,U,5500,9500,L5:R,0

3=1Y,U,9500,13000,L4:R,0

4=1Y,U,13000,16383,L6:R,0

In this example, the LUA command work in the buttons , but it does not work in the axis. Why?

I've tried all sorts of combinations here with FSUIPC4 and it works fine there. I'm just loading up FS9 to try there ...

.. Yes, you are correct. There's a bug in what should be pretty much identical code in FSUIPC3!

I'll attend to it directly.

Regards

Pete

Link to comment
Share on other sites

The detection is based on normal polling rates on the joystick. but if the axis values are changing, any very small zone could be missed. You probably need to widen the zones. You could try increasing the poll rate (descrease the poll interval parameter) but take care or you risk affecting FS performance.

Please explain. Who says they don't? The internal handling is the same for assignments no matter where they are made.

Regards

Pete

[Axes.LSH MD-82 McDonnell Douglas]

0=1Y,500

1=1Y,B,1000,5500,L7:R,0

2=1Y,B,5500,9500,L5:R,0

3=1Y,B,9500,12500,L4:R

4=1Y,B,12500,16383,L6:R,0

In this setup, the command should go out only if the value of the axis remains inside for more than a certain time, otherwise it must be produced no command (i.e. axis value 6000 for 100 msec, no exit command; axixs value 6000 for 500 msec command LUA 5).

how can I do?

thanks

Fabio

Link to comment
Share on other sites

In this setup, the command should go out only if the value of the axis remains inside for more than a certain time, otherwise it must be produced no command (i.e. axis value 6000 for 100 msec, no exit command; axixs value 6000 for 500 msec command LUA 5).

how can I do?

I can only think of two ways to do this:

1. You could, in the Lua plugin, have an ipc.sleep for 100 mSecs, then, before doing the action, check one of the Lua flags for that plugin. If it is set, don't perform the action. In FSUIPC assignments program the exit from the zone to set that flag.

or

2.Just as above, but program the exit from the zone to Kill the Lua plug in.

The second isn't a "nice" way though, so try the first.

Regards

Pete

Link to comment
Share on other sites

I can only think of two ways to do this:

1. You could, in the Lua plugin, have an ipc.sleep for 100 mSecs, then, before doing the action, check one of the Lua flags for that plugin. If it is set, don't perform the action. In FSUIPC assignments program the exit from the zone to set that flag.

or

2.Just as above, but program the exit from the zone to Kill the Lua plug in.

The second isn't a "nice" way though, so try the first.

Regards

Pete

Thanks for the information, Pete.

I tried the "2" but not working well....

I want to try the "1" but I don't know the LUA command for read the axis.

In my case is: joy 1 axis Y. Can you give me an example of the LUA programming?

Thanks

Fabio

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.