Jump to content
The simFlight Network Forums

Delaying button repeats?


Kosta
 Share

Recommended Posts

I am right now configuring newly my FSUIPC for my controls, and got one question:

PMDG MD11 doesn't like when an reverse is repeated just when button is pressed.

Meaning, if I press F2 once, and then after 1-2 seconds repeat it, that is the right procedure.

But if I configure my throttle quad (Saitek) with a button for reverse, I put Throttle 1 Decr and then repeat, which repeats when the button is pressed, causing a visual stuttering of the throttle in the cockpit - it would be cool if I could delay the repeat of the button for like 1 second or something.

Possible?

Thanks

Kosta

Link to comment
Share on other sites

But if I configure my throttle quad (Saitek) with a button for reverse, I put Throttle 1 Decr and then repeat, which repeats when the button is pressed, causing a visual stuttering of the throttle in the cockpit - it would be cool if I could delay the repeat of the button for like 1 second or something.

Never heard of a problem like that! One whole second? How weird!

You'd need to use a Lua plug-in unless you wanted such a slow repeat rate for all buttons. in the latter case you'd only need to change the parameter in the [buttons] section of the INI file ,

Pete

Link to comment
Share on other sites

It's actually more than 1 second. Probably some 2-3 seconds.

Hehe, it's not a problem per se, it's just how the aircraft works apparently. First you press F2, then it goes into REV, and then after a second or two, you can pull further.

Damn, I have very little experience with Lua or Linda, I was hoping to solve it easily. What parameter do I need to change? Can't I just put it in for this profile? Reversers in my configuration are all per-profile. Not general settings.

Link to comment
Share on other sites

It's actually more than 1 second. Probably some 2-3 seconds.

How weird!

You don't want an automatic repeat action for something like that. Just uncheck the repeat, and pull the throttle back against the switch 2-3 seconds later. Surely with such a repeat rate that isn't a hardship? i would think it more inconvenient to have to hold it back all the time!

Hehe, it's not a problem per se, it's just how the aircraft works apparently. First you press F2, then it goes into REV, and then after a second or two, you can pull further.

Simulating the lowering of the reverser shroud, presumably. Still, it shouldn't go wrong just because there are extra controls in the meanwhile.

What parameter do I need to change? Can't I just put it in for this profile? Reversers in my configuration are all per-profile. Not general settings.

No, the button repeat rate is universal, and in any case you couldn't specify a repeat rate of 0.33 presses per second, it only allows whole numbers!

I think you should simply uncheck repeat. it makes no sense in that case.

Pete

Link to comment
Share on other sites

If I uncheck repeat, I don't get reverse.

Either you didn't understand me correctly, or you don't know how Saitek functions?

Saitek has a normal lever, and below lever is a button, in the lever itself - meaning it has a detent on 0, and if you pull further down, it is not an axis but a button.

This button can be set to Throttle 1 Decr. Which means it would decrease incrementally, just like pressing F2 once. Holding F2 would pull the reverse further back, spooling it up.

In any other Boeing, you press and hold F2, to get the spooled up reverse.

But with MD11, you gotta press F2 once - then wait 2-3 seconds - then press and hold F2 to make the engine spool up in reverse. It says even so in the manual/tutorial.

Landing and rollout

Passing approx. 50ft the aircraft will go into flare mode and

retard the throttles to idle. This is indicated on the FMA by a

white ʻRETARDʼ (1) and a green ʻFLAREʼ (2).

• As soon as you hear the airplane touching down press the

F2-key once. This will activate idle reverse.

• Check the reverse activating on the EAD. First you will

see amber ʻU/Lʼ indications (3) while the reverse

mechanism unlocks.

• When unlocked the indication will change to a green

ʻREVʼ (4). Press and hold F2 until the engines are at full

reverse.

• Passing 60kts press the F1-key to deactivate reverse

thrust.

What you are suggesting would leave the reverse in the first stage, meaning no spool up. And not even able to, since there is no repeat.

Since this is a very unique option, would it maybe be possible to implement the delay as a parameter or an option?

Link to comment
Share on other sites

If I uncheck repeat, I don't get reverse.

Er ... that makes no sense. "Repeating" at intervals of 3 seconds is just lke not having repeat enabled and instead operating the button every three seconds.

Either you didn't understand me correctly, or you don't know how Saitek functions?

Saitek has a normal lever, and below lever is a button, in the lever itself - meaning it has a detent on 0, and if you pull further down, it is not an axis but a button.

Yes, I know, I have a couple of Saitek quadrants lying around here someplace.

But with MD11, you gotta press F2 once - then wait 2-3 seconds - then press and hold F2 to make the engine spool up in reverse. It says even so in the manual/tutorial.

Yes, but holding it to make it repeat is NOT the same as holding it and later releasing it. If the aircraft code really wants it held and later released it must be looking for a "button release" indication. How is it getting that? Or are you really saying that it MUST be the F2 key and the aircraft is reading the keyboard, not processing the throttle decrement controls?

No, I think it is wanting repeats, and you can certainly repeat it manually, by simply causing it to be pressed more than once. I'm sure that isn't a difficult thing to do at intervals like 3 seconds?

Landing and rollout

Passing approx. 50ft the aircraft will go into flare mode and

retard the throttles to idle. This is indicated on the FMA by a

white ʻRETARDʼ (1) and a green ʻFLAREʼ (2).

So you do not land it yourself, you use autoland?

What you are suggesting would leave the reverse in the first stage, meaning no spool up. And not even able to, since there is no repeat.

Why would you not repeat it? I don't understand your problem at all, evidently. Whatever FSUIPC can do for you, you can do for yourself. A button is a button no matter where it is mounted.

Since this is a very unique option, would it maybe be possible to implement the delay as a parameter or an option?

No, it is exactly for unique and obscure and strange needs that I added the Lua plug-in facilities for, to avoid further overcomplicating the main FSUIPC code. It would need to be a very generally used and sensible option, which so far this does not strike me as, to warrant being added as a built-in facility. Sorry.

Regards

Pete

Link to comment
Share on other sites

Uh, after reading this post, I don't understand anything any more :neutral: Except that it's not worth implementing due to complicating FSUIPC code.

Let me try this way:

http://youtu.be/p-UPLIfOWSQ

In the first part, you'll notice me using F2 - pressing once will put it to idle reverse, and then pressing again and holding, full reverse.

If I press singularily, you get steps - not a solution suggesting a keypress every 3 seconds.

In the 2nd part you'll see the behaviour I was describing - stuttering due to FSUIPC "pressing" Throttle 1 Decr, without a possible pause between "first click" and subsequent click.

So if there is no way how to make this in FSUIPC, is there anything known apart from FSUIPC - is this doable over Linda? I could look into that.

Link to comment
Share on other sites

Uh, after reading this post, I don't understand anything any more :neutral: Except that it's not worth implementing due to complicating FSUIPC code.

Not worth implementing inside FSUIPC, no, especially because it is the sort of thing Lua was implemented for. All these specialist little tricks.

In the first part, you'll notice me using F2 - pressing once will put it to idle reverse, and then pressing again and holding, full reverse.

But holding it is only getting you to full reverse because it is repeating. A repeated control can be obtained by a repeating button no matter whether it is repeated automatically or by the person pushing it.

I cannot see why you cannot understand this?

If I press singularily, you get steps - not a solution suggesting a keypress every 3 seconds.

But that is exactly what you said you wanted. A repeat rate of one every 3 seconds!

without a possible pause between "first click" and subsequent click.

So you only want a pause between first and subsequent clicks? That isn't how it came over, look what you said:

Meaning, if I press F2 once, and then after 1-2 seconds repeat it, that is the right procedure.

But if I configure my throttle quad (Saitek) with a button for reverse, I put Throttle 1 Decr and then repeat, which repeats when the button is pressed, causing a visual stuttering of the throttle in the cockpit - it would be cool if I could delay the repeat of the button for like 1 second or something

You later increased from 1-2 to 3.

Anyway, this is an ideal candidate for a simple Lua plug-in. In Lua you can send controls, you can insert delays ("sleeps"), you can loop testing a button, all these things.

I am going to bed now. I can help if you wish, but please have a look at some of the examples, both those saved in your FSUIPC documents folder and those in User Contributions. I like to help someone help themselves, but I will not do all the work. No one learns that way and then I still have to continue doing all the work.

I don't know LINDA I'm afraid.

Regards

Pete

Link to comment
Share on other sites

Pete, with a help of Guenseli, he showed me a MD11 Lua script, which had reversers set up for them.

So I attempted splitting them into single reversers, but now I get a break between each reverse, no matter how I pull them down. It's like the ipc.sleep is stopping the other throttles to work, only after the first one has completed the cycle, does the 2nd one start to go to the idle reverse. In no particular order, I guess depending which hardware key activated first.

Help?

-- ## Reverser ###############

function MD11_Throttle1_Reverser_inc ()

TH1 = ipc.readUW("088c")

if TH1 == 0 then

DspShow("Rev", "eng")

ipc.control(66635) -- THROTTLE1 DECR SMALL

ipc.sleep(3000)

end

DspShow("Rev", "on")

ipc.control(66635) -- THROTTLE1 DECR SMALL

end

function MD11_Throttle1_Reverser_incfast ()

TH1 = ipc.readUW("088c")

if TH1 == 0 then

DspShow("Rev", "eng")

ipc.control(65966) -- THROTTLE1 DECR

ipc.sleep(3000)

end

DspShow("Rev", "on")

ipc.control(65966) -- THROTTLE1 DECR

end

function MD11_Throttle1_Reverser_off ()

TH1 = ipc.readUW("088c")

while TH1 > 16500 do

ipc.control(65964) -- THROTTLE1 INCR

TH1 = ipc.readUW("088c")

DspShow("Rev", "off")

end

ipc.control(65967) -- THROTTLE1 CUT

end

function MD11_Throttle2_Reverser_inc ()

TH2 = ipc.readUW("0924")

if TH2 == 0 then

DspShow("Rev", "eng")

ipc.control(66636) -- THROTTLE2 DECR SMALL

ipc.sleep(3000)

end

DspShow("Rev", "on")

ipc.control(66636) -- THROTTLE2 DECR SMALL

end

function MD11_Throttle2_Reverser_incfast ()

TH2 = ipc.readUW("0924")

if TH2 == 0 then

DspShow("Rev", "eng")

ipc.control(65971) -- THROTTLE2 DECR

ipc.sleep(3000)

end

DspShow("Rev", "on")

ipc.control(65971) -- THROTTLE2 DECR

end

function MD11_Throttle2_Reverser_off ()

TH2 = ipc.readUW("0924")

while TH2 > 16500 do

ipc.control(65969) -- THROTTLE2 INCR

ipc.sleep(50)

TH2 = ipc.readUW("0924")

DspShow("Rev", "off")

end

ipc.control(65972) -- THROTTLE2 CUT

end

function MD11_Throttle3_Reverser_inc ()

TH3 = ipc.readUW("09bc")

if TH3 == 0 then

DspShow("Rev", "eng")

ipc.control(66637) -- THROTTLE3 DECR SMALL

ipc.sleep(3000)

end

DspShow("Rev", "on")

ipc.control(66637) -- THROTTLE3 DECR SMALL

end

function MD11_Throttle3_Reverser_incfast ()

TH3 = ipc.readUW("09bc")

if TH3 == 0 then

DspShow("Rev", "eng")

ipc.control(65976) -- THROTTLE3 DECR

ipc.sleep(3000)

end

DspShow("Rev", "on")

ipc.control(65976) -- THROTTLE3 DECR

end

function MD11_Throttle3_Reverser_off ()

TH3 = ipc.readUW("09bc")

while TH3 > 16500 do

ipc.control(65974) -- THROTTLE3 INCR

ipc.sleep(50)

TH3 = ipc.readUW("09bc")

DspShow("Rev", "off")

end

ipc.control(65977) -- THROTTLE3 CUT

end

Link to comment
Share on other sites

Pete, with a help of Guenseli, he showed me a MD11 Lua script, which had reversers set up for them.

So I attempted splitting them into single reversers, but now I get a break between each reverse, no matter how I pull them down. It's like the ipc.sleep is stopping the other throttles to work, only after the first one has completed the cycle, does the 2nd one start to go to the idle reverse. In no particular order, I guess depending which hardware key activated first.

That Lua surely is not complete? It is a set of functions. Where is the code calling the functions?

You have all the throttles controlled separate in the one Lua plug-in? A single plug-in can only run sequentially, doing one thing at a time. You'd need to split it into one for each throttle. You can have up to 255 Lua plug-ins all running at the same time, but each one can only follow its instructions in one place at a time, each one isn't multi-threaded inenally!

Pete

Link to comment
Share on other sites

OK, are we talking about the .lua file itself? .lua is one plugin you are talking about?

So, if I were to split each throttle to one plugin and list them in the fsuipc.ini, it should be able to run simultaneously?

Erm, sorry, I think I found what you ment: Linda.lua is a code. Something I don't understand.

Then there is an actions.lua file inside of Linda itself, which is much longer than what I wrote above. What I pasted is only a part of actions.lua file that loads in Linda.

Link to comment
Share on other sites

OK, are we talking about the .lua file itself? .lua is one plugin you are talking about?

"Plug-ins" are just other programs plugged into another to enhance its behaviour, to add facilities. FSUIPC has plug-in facilities by Macro files and by Lua programs. So yes, a Lua file, placed in the Modules folder, is a plug-in.

Sorry, I didn't realise we had to define words too. Did you think Lua files were one thing and a plug-in something else?

So, if I were to split each throttle to one plugin and list them in the fsuipc.ini, it should be able to run simultaneously?

You don't do ANYTHING in the INI file. Please stop confusing yourself. Otherwise, yes, each Lua file in the modules folder is potentially a separate plug-in and every loaded plug-in runs simultaneously with every other.

Could i ask you, please, to at least read the Lua introductory document in the FSUIPC Documents folder on your PC?

Erm, sorry, I think I found what you ment: Linda.lua is a code. Something I don't understand.

Sorry, what do you mean "Linda lua is a code"? What is this to do with Linda? You are confusing me now! If you are using LINDA you need to talk to Guenseli. I'm sorry, I do not know it.

Regards

Pete

Link to comment
Share on other sites

I left Linda alone. I talked to Guenseli, and he said Linda is basically abandoned project.

I read the document. So as I understand it, FSUIPC automatically loads any lua plugin that is found in FSUIPC folder.

Also I need 3 different files to control the engines simultaneously.

As I understand Linda, it acts as an "inbetween" - it has it's main code (the part you mentioned is missing), then also a hardware part, and in the end what I pasted, a profile, or whatever one would call it.

But apart from Linda:

No matter how much I read those PDFs, and yes I've browsed through them couple of times already, but I simply do not understand this stuff. Maybe to you this is like drinking water, but for me a completely unknown world. I wouldn't even know where to begin.

Anyway, thanks for your help, apparently I gotta learn to live with it.

Link to comment
Share on other sites

I left Linda alone. I talked to Guenseli, and he said Linda is basically abandoned project.

Really? So I should remove that pinned thread of his?

I read the document. So as I understand it, FSUIPC automatically loads any lua plugin that is found in FSUIPC folder.

Not 'loads', but it certainly lists them so you can assign to them in Buttons, Keys or Axes. It uses the name, and for each youget a Lua control (to run it), and LuKill, LuaValue, LuaSet, LuaClear, LuaToggle and LuaDebug controls to do other things with them.

They only get loaded automatically if loaded from the optional "ipcReady.lua", or more usually via [Auto] sections, probably aircraft- or profile- specific, in the INI -- same as auto-executed macros.

Also I need 3 different files to control the engines simultaneously.

Because it's a three engined plane.

No matter how much I read those PDFs, and yes I've browsed through them couple of times already, but I simply do not understand this stuff. Maybe to you this is like drinking water, but for me a completely unknown world. I wouldn't even know where to begin.

But a lot of folks who've never done any programming have managed small examples, and that's all you need. For each engine you want a sequence in Lua which does this:

sends THROTTLEn_DECR -- that's an ipc.control(...) line, with the number of that control (you have a list in your FSUIPC Documents folder)

sleeps 3 seconds (3000 miilliseconds) -- thet's an ipc.sleep(3000) line

loops sending THROTTLEn_DECR every say, 200 mSecs till you release the button

The last is a little more complicated, not one line but three or four. Let's try putting it together:

ipc.control(...) -- you look up the number. I don't see why I should do all the work
ipc.sleep(3000)
while ipc.testbutton(joynum, btn num) do -- you fill in the joystick number or letter and the button number, same as assigned
ipc.control(...) -- same control number as before
ipc.sleep(200) -- so it doesn't repeat too often
end[/CODE]

There, that's it. I've gone and done most of the "hard" work for you. I didn't want to, but you seem not to want to do any work at all.

Just make three of those with the correct three controls and three buttons, name them say Reverse1.lua, Reverse2.lua, Reverse3.lua, save in the Modules folder.

Then load FS, go into FSUIPC, assign the correct buttons to "Lua reverse1" etc as appropriate. Do [i]NOT[/i] have them repeating!

Anyway, thanks for your help, apparently I gotta learn to live with it.

Because you can't be bothered to try a little harder? Come on, show some enthusiasm. What's a hobby without a little challenge? ;-)

Pete

Link to comment
Share on other sites

The examples I looked into were way more complicated than examples you wrote here. I didn't realize that simplicity is the key here! Honestly Pete, I didn't get - call me stupid if you want here.

Anyway, I get it now, I'll get to work creating correct files and see if it works in the end.

Link to comment
Share on other sites

Because you can't be bothered to try a little harder? Come on, show some enthusiasm. What's a hobby without a little challenge? ;-)

Definitely nothing. But Pete, in all seriousness, don't you know me at all? I mean, I'm one of those guys that went through testing and all while you were doing the g3d.dll fix...

I'm NOT the one who is not going to do any work.

The thing you wrote in the middle of the post is totally enough for me to get it... I did get everything with ipc.* and would have used it as you wrote. But I didn't know where to start.

So thanks for the headsup (and could've done it way earlier! -_- )

Anyway... gonna get to work now...

Link to comment
Share on other sites

Okay Pete, thanks for your help.

Result is a success.

ipc.control(66635)

ipc.sleep(3000)

while ipc.testbutton(1,7) do

ipc.control(65966)

ipc.sleep(100)

end

And I also wasn't aware that Lua Plugins can be selected in the list of assignments.

I thought I'll have to assign Controller HIDs into Lua Plugin directly, as was done in some examples.

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.