dwbarnett Posted May 6, 2015 Report Posted May 6, 2015 Hi Pete, Thank You so much for this powerful program. Your accolades are well deserved. I'm all set on my setup for the MU-2 from Flysimware. Thus far everything is working fine. Here's my thought and or questions. I have read the manual and advanced manual twice now. I just feel there is a way I could accomplish my goal. Caveat: I am not a programmer, so if it involves LUA stuff, most likely that will be it for me, I'll just use what I have setup now. OK here's the deal. The MU-2 has a TPE331 straight shaft turboprop engine. The way the FSW MU-2 is working now re sound files. If you keep the torque around 20-22% it will maintain it's taxi sound. If you increase torques above that, it shifts to the sound file for takeoff even if still in the ground idle range. Can be a little strange at times. After reading the manuals, I had the idea of marking on my Saitek quadrant were the ground idle range was on the actual sim MU-2. Then use FSUIPC to limit my max torque with in that range to not above 21% torque. Then the sound wouldn't shift to the different sound file used for flight idle-takeoff position. Is there a way I could accomplish this to not increase power above 21% torque, as long as I'm in the ground idle range up to the flight idle range on the plane. I guess also, at some point I would need to do the sync thing as well. It would really add some realism to the plane if possible Apologies Pete, I can be very verbose at times. IN a nutshell: 1. when my throttle is in the MU-2 ground idle range both in FSX and the Saitek quadrant, limit max torque to 21%. 2. When the throttle enters the flight idle range, it would allow the takeoff sound file to play I just have a feeling this would be doable in FSUIPC. Thanks for any "light" you can shed on the subject. Best, David
Pete Dowson Posted May 6, 2015 Report Posted May 6, 2015 After reading the manuals, I had the idea of marking on my Saitek quadrant were the ground idle range was on the actual sim MU-2. Then use FSUIPC to limit my max torque with in that range to not above 21% torque. By not asllowing the use of a Lua plug-in you are making it more difficult. The only other way I can think of doing it would be to assign the throttle on the right-hand side of the Axis Assignment tab. This allows assignment of controls to specific ranges instead of direct to an analogue axis. You could have three ranges set there, one operating the throttle axis from 0 to 21%, one keeping it at 21% over a sufficient range for you to be sure to make that work, and the other allowing it to increase normally. The problem with that approach is that you still really need to use the input from the axis as the parameter to send on. Therefore the part of the range you want to fix is lost. For example, if you needed a 5% zone of freedom at 21% you'd need to lose, say, an area from 19-23%. Whether this would notice would need testing, but you might notice a sudden jump. If your throttle axis is smoothly behaving, not varying very much from time to time, then there's really no reason why simply making your "notch" at the point where good calibration puts the 21% -- providing it predictably gives such a figure, why do anything complicated at all? Just assign and calibrate as normal! There would be no need for an limit or zone. Pete
dwbarnett Posted May 7, 2015 Author Report Posted May 7, 2015 Hello Pete, Thanks for the Info. When I mentioned the LUA stuff, I just meant I didn't know how to accomplish woth LUA script. If You would like to give me an idea of how to write the script I need, I would use a LUA script no problem I would really like to find a solution if possible Thanks again for all your kind assistance. Best, David
Pete Dowson Posted May 7, 2015 Report Posted May 7, 2015 Hello Pete, Thanks for the Info. When I mentioned the LUA stuff, I just meant I didn't know how to accomplish woth LUA script. If You would like to give me an idea of how to write the script I need, I would use a LUA script no problem You just have a Lua plug-in which uses event.param to receive values from your throttle axis. You would need to process that value and decide what to send on to the simulator -- using ipc.control with the control value for Axis throttleN set (N= engine number), or Axis throttle set for all engines. You need to work out some arithmetic to limit the result sent to FS to 21% until something happened (though what?) Maybe I don't fully understand your "problem". Have you yet tried just putting your "notch" on the position where things change? You seem to be wanting something very odd -- I don't know how much of the axis movement you want to waste! (Seems a little on the daft side to me, in fact, sorry to say).. Or do you simply want to limit it to 21% until you press a button? That would be much easier, and more sensible to me. Pete Pete
dwbarnett Posted May 8, 2015 Author Report Posted May 8, 2015 hi Pete., apologies I can' t explain this properly. I'll give it another go. Ok, essentialy I have the FSW MU 2 product. Due to FSX limitations, and sound file limitations; when throttle travel reached a certain point, approx 21% the sound file would shift to the takeoff sound even though still in ground idle range. I did some tweaking to the sound file to closer emulate the actual plane. If you keep the pwer around 20% or below, it will stay within the parameters needed to use the ground idle sound. anthing beyond that, the sound file for takeoff is used, even when still in ground idle range. I thought if i could note were it was located on my saitek throttle, when increasd reaches approx. 20-21% torque in the sim, I would retain my taxi sounds. and know were on the Saitek vs sim this point was located. I would then note in the sim were flight idle is located. I would mark this spot on the Saitek throttle quad. So, fom the point were I first hit approx 20-21%torque in the sim, marked on my actual Saitek throttle quad; up to were flight idle is in the sim also marked on the throttle quad, I want that range of movement to maintain 20-21% When I reach the mark i made for flight idle in sim and on Saitek, then the torque can increase above the 20-21%range. IE Increasing power for takeoff. This will then hit the area where the sound file changes from flight idle to takeoff sounds. As it is now when taxiing the plane, sometimes the sounds will shift from ground idle to flight idle, even though I'm not in the Flight Idle range. Does this explanation help. I'm simply trying to prevent my sound file changing, within a range of throttle movement. Best, David PS Pete, irregardless if you still don't understand my goal. I Thank You for taking the time to help, non the less.
Pete Dowson Posted May 8, 2015 Report Posted May 8, 2015 So, fom the point were I first hit approx 20-21%torque in the sim, marked on my actual Saitek throttle quad; up to were flight idle is in the sim also marked on the throttle quad, I want that range of movement to maintain 20-21% When I reach the mark i made for flight idle in sim and on Saitek, then the torque can increase above the 20-21%range. IE Increasing power for takeoff. This will then hit the area where the sound file changes from flight idle to takeoff sounds ... Does this explanation help. I'm simply trying to prevent my sound file changing, within a range of throttle movement. So, where I said this: "You could have three ranges set there, one operating the throttle axis from 0 to 21%, one keeping it at 21% over a sufficient range for you to be sure to make that work, and the other allowing it to increase normally.", way back when, you could have said, "yes, exactly", right? Except of course thar doing it by mere assignment is no good because above the fixed 21% mark it would suddenly jump to a higher value, depending on how wide a range at 21% you need -- as I also pointed out later. So, the only way is the way I suggested here: "You just have a Lua plug-in which uses event.param to receive values from your throttle axis. You would need to process that value and decide what to send on to the simulator -- using ipc.control with the control value for Axis throttleN set (N= engine number), or Axis throttle set for all engines. You need to work out some arithmetic to limit the result sent to FS to 21% until something happened (though what?)" except that now we know what the "something happening" is -- the incoming value being that where your "flight idle" notch is. Beyond that you'd need a formula to convert the remaining, higher, incoming values to the correct thrust range of 21-100% Pete
dwbarnett Posted May 9, 2015 Author Report Posted May 9, 2015 apologies again Pete. Inhad finished an 11:30 duty day. Should hage rested first before posting. To be more succint for you. All you said above......"yes, exactly", right! Thanks for your valuable time. I won' t bother you anymore regarding my issue. Best, David
Pete Dowson Posted May 9, 2015 Report Posted May 9, 2015 Thanks for your valuable time. I won' t bother you anymore regarding my issue. Why not? If you plan to write a Lua plug-in to do the job, and need help or get stuck, why not ask? I can help. I'm not about to do it for you, but I'm here to ask as you need. Your last reply seems to imply you;ve taken some sort of offence to what I've been advising. Why is that? I've only been trying to be clear about what you probably need to do from my understanding of what you describe. I don't really know why you thought I didn't understand in the first place. Pete
dwbarnett Posted May 10, 2015 Author Report Posted May 10, 2015 hi Pete not at all. Based on the respnse you gave me that I may interpreted wrong. I was trying to be thorough in my explanation. I felt that my verbosiity of explanation, may have frustrated you somewhat. Hence my impression I had more or less worn out my welcome on this issue. You know Pete, I fly 737's for a living. But, when it comes to trying to explain something in flight sim concept, I have difficulty. I take no offence to any of your help. If I was taliking to you personally, I could easily explain my goal.But I suck at trying to convey in this type media. Hence my verbosity. I would like nothing ,more than have your expertise to try and resolve my issue. I also know I have tried to either program and try and model. I decided it's best to give technical advice, or just fly pax from point A-B I will re- read the LUA stuff, so I can at least know what questions I may need to ask. Thank You again, for your valuable time Pete. No offence intended. Best, David
Pete Dowson Posted May 10, 2015 Report Posted May 10, 2015 also know I have tried to either program and try and model. I decided it's best to give technical advice, or just fly pax from point A-B I will re- read the LUA stuff, so I can at least know what questions I may need to ask. I can outline what the plug-in needs to do. You'll need to fill in the values. Here, it is short enough: x = fill in here the number read from the axis at the point where you get 21% thrust y = fill in here the number from the axis where you want normal thrust to continue z = fill in here the maximum value seen from the axis function throttle1(n) if n > x then if n > y then n = x + ((n - y) * (z - x) / (z - y) else n = x end end ipc.control(66420, n) -- 66420 is Axis throttle1 set (use 66423 for throttle2 end event.param("throttle1) Do one such plug in for each throttle, then, in FSUIPC axis assignments, assign each throttle axis to the relevant Lua plug in -- eg if the plug-in is called "mythrottle1.lua" the assgnment is to Lua mythrottle1. I might have made a mistake in the arithmetic, but I think it's okay. You'd need to test. But first you need to determine the values you need to match the positions on your throttle levers. Pete
dwbarnett Posted May 10, 2015 Author Report Posted May 10, 2015 Pete, Thank You so much for your assistance. I'm going to get this set up today. Will this work OK? Go into sim, adjust throttle for the 21%, then mark on quadrant. Enter FSUIPC, move throttle to my mark, note the axis output number at that position. Enter this number in the LUA script you created for me. I would do the same for the power increase area, mark, it,get the numbers. Seems like this should work. If I'm missing something, please let me know. Finally, once I get this working, with your kind patience and assistance. I would like to incorporate the condition levers as well. Would I use the same script? It would be pretty much identical to limiting as on the throttles Pete, Thank You for your patience and help. Apologies again, if you felt offended. Certainly, not my intent. Best, David
Pete Dowson Posted May 11, 2015 Report Posted May 11, 2015 Will this work OK? Go into sim, adjust throttle for the 21%, then mark on quadrant. Enter FSUIPC, move throttle to my mark, note the axis output number at that position. Enter this number in the LUA script you created for me. I would do the same for the power increase area, mark, it,get the numbers. Yes, should be okay. The axis output number you want is the one shown in the axis assignment tab. You won't be able to calibrate, so don't bother. Any calibration adjustment you find you need will have to be done using more arithmetic in the Lua plug-ins. I would like to incorporate the condition levers as well. Would I use the same script? You could do, but I don't think you need to -- this capability is already built into the FSUIPC calibration facilities. That has cut-off as minimum, and an idle zone above that. Just calibrate to your desired lever positions. The only reason it isn't like that for throttles is that the regions are usually reverse thrust -- idle - forward thrust. If you did want to do it the more complicated way, like the throttles, you'll need to look up the correct FS control numbers to use -- there's a complete list installed in your FSUIPC Documents folder. Pete
dwbarnett Posted May 11, 2015 Author Report Posted May 11, 2015 Thank You so much Pete. Your time and assistance, is greatly appreciated. Best, David
dwbarnett Posted May 11, 2015 Author Report Posted May 11, 2015 OK, Pete. I got rid of the first error. On the line 4, I believe it was looking for a ) after the formula. Now after checking the FSUIPC.log file, I get this message now: 108405 *** LUA Error: D:\1FSX\Modules\MU2throttle1.lua:12: unfinished string near '<eof>' 108405 *** LUA Error: D:\1FSX\Modules\MU2throttle2.lua:12: unfinished string near '<eof>' Hope this helps troubleshooting. Thank You Best, David
dwbarnett Posted May 11, 2015 Author Report Posted May 11, 2015 Ok, Pete...follow up. I think the issue with the last error message was the call for throttle1,2 didn't have an end quotation on event.parameter Original was:event.param("throttle1) Changed to: event.param("throttle1") same on throttle 2. Couple of things are happening now: 1. I load the MU2 from a saved flight file. 2. I then start FSUIPC to double-check the LUA setting per axis is correct. 3. When I first move throttle1, FSUIPC shows throttle2 and LUA script for throttle2. 4. After I do a re-scan, throttle 1 shows throttle 1 and LUA throttle1 on the axis menu. Same for throttle 2 Could my saved flight be messing my LUA script up somehow....still not functioning. 5. Exit FSX. Check FSUIPC.log file. 6. No errors on the LUA scripts.....yeah!! However, I don't see any indication they were loaded anymore. If they are loading/running automatically; does it still show in the log file. I searched the manual, did not see any reference on the LUA loading and log file. Finally checking the modules folder. After re-reading the LUA plug-ins manual again; it mentions 3 LUA plugins re ipc stuff. Looking in the LUA plug-ins folder, I see the debug plugin. I don't see the: ipcinit.lua, or the ipcready.lua pugins. Should they be in the modules folder? Hope this helps troubleshoot Pete. Best, David
dwbarnett Posted May 11, 2015 Author Report Posted May 11, 2015 Oh yeah, forgot to show my updated MU2throttle1.LUA function throttle1(n) if n > -11833 then if n > -4421 then n = -11833 + ((n - -4421) * (16383 - -11833) / (16383 - -4421)) else n = -11833 end end ipc.control(66420, n) -- 66420 is Axis throttle1 set (use 66423 for throttle2end event.param("throttle1") Best, David
Pete Dowson Posted May 11, 2015 Report Posted May 11, 2015 Ok, Pete...follow up. I think the issue with the last error message was the call for throttle1,2 didn't have an end quotation on event.parameter Yes, sorry about the typos. Trying to do things quickly -- away tomorrow for 2 weeks, and lots to do beforehand! 2. I then start FSUIPC to double-check the LUA setting per axis is correct. 3. When I first move throttle1, FSUIPC shows throttle2 and LUA script for throttle2. You've got some jitter on throttle 2 -- FSUIPC responds to the first axis change it sees. If it stops even the rescan finding the other axes you can temporarily tell it to ignore the misbehaving axis. It's all described inthe user guide. Could my saved flight be messing my LUA script up somehow....still not functioning. No. Nothing except you can change a Lua script. However, I don't see any indication they were loaded anymore. If they are loading/running automatically; does it still show in the log file. No, only if you opt for Button & Key logging, or enable the Lua debugging option. See the Logging tab. If this was not optional you'd get huge logs, entries every time! But, sorry, more errors in my original advice. I was in a hurry! It is using the event system, which means it should be loaded and stay resident. If you only need it for one Profile, add this section to the INI file: [Auto.name of profile] 1=Lua throttle1 2=Lua throttle2 If you always want it operating, just use [Auto] with no profile name. Then reassign the throttles to Luavalue throttle1 and Luavalue throttle2 Sorry about the original advice -- I was mixing up two different ways of doing things. Pete
Pete Dowson Posted May 11, 2015 Report Posted May 11, 2015 Oh yeah, forgot to show my updated MU2throttle1.LUA I expect "- -" to work okay, but it isn't good arithmetic and is in danger of looking like -- which Lua uses to denote a comment. Subtracting a negative number is the same as adding a positive one (elementary school arithmetic?), so you should have: function throttle1(n) if n > -11833 then if n > -4421 then n = -11833 + ((n + 4421) * (16383 + 11833) / (16383 + 4421)) else n = -11833 end end ipc.control(66420, n) -- 66420 is Axis throttle1 set (use 66423 for throttle2 end event.param("throttle1")
dwbarnett Posted May 11, 2015 Author Report Posted May 11, 2015 Hi Pete, Thank You for the follow up. Just for clarification. [Auto.name of profile] 1=Lua throttle1 2=Lua throttle2 I understand the single profile stuff. However, you named the lua different from my MU2throttle1.lua. Are you saying now to just use the above, since we changed to Luavalue throttle1 on the assignment of axis? Or do I still utilize the MU2throttle1.lua, but the assignment would be Luavalue MU2throttle1. Just wanted to clarify, I know the function and event.param is throttle 1. Thank You Best, David
dwbarnett Posted May 11, 2015 Author Report Posted May 11, 2015 Disregard Pete. I see how the luavalue is displayed in FSUIPC. Enjoy your trip. Best, David
dwbarnett Posted May 11, 2015 Author Report Posted May 11, 2015 Well Pete, just tried everything with your changes. Still no go. I'll reconnect with you when you return from your trip. Safe travels. Best, David
Pete Dowson Posted May 11, 2015 Report Posted May 11, 2015 Well Pete, just tried everything with your changes. Still no go. I'll reconnect with you when you return from your trip. I'm not off till the morning. Enable button/key logging, and lua debugging options in the Logging tab, then close FSX and restart it. Briefly try the throttle levers, at least once eacvh in each range, then close FSX. ZIP up the FSUIPC4.LOG file and send it to me at petedowson@btconnect.com. Pete
Pete Dowson Posted May 11, 2015 Report Posted May 11, 2015 I just noticed your post on AVSIM FSX forum asking for help, in which you say that the throttle input is "not limited at all". This seems to indicate that your assignment is still to the throttles, not purely to the plug-ins. If the Lua plug-ins weren't running you'd get nothing on the throttles because there's then no active assignment. Have you still got the controller enabled in FS? I'm waiting for the log file so I can help before I go. Pete
dwbarnett Posted May 11, 2015 Author Report Posted May 11, 2015 Hi Pete. I thought you were leaving on your trip today, that is why I posted on AVSIM I knew you were gone for 2 weeks. Hmmm I sent my logfile to you early this morn my time 6AM Used the Email address you gave me in an earlier post. Copy/Pasted the addy in the Email I'll double check the controls in FSX, about 99% sure disabled, and axis are deleted. Apologies, when I mentioned no go on the plug-ins, thought you knew I meant not working at all. I will be more specific from now on. Thanks for your patience Pete. Best, David
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now