Jump to content
The simFlight Network Forums

kaha

Members
  • Posts

    191
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by kaha

  1. I also tried to edit the .ini file, but it getss reverted. Karl
  2. I cannot find controls for external quickviews for Button and Switch Assignments. Here's what I mean displayed in MSFSs control options. THank you, Karl
  3. Test your input event with the button assignments and then take a look at the input events list from the log menu. Use this for the lua script. In my example I use input event ELECTRICAL_Battery_1. Here is the lua script: --[[ Battery 1 for Caribou 1 = on 0 = off ]] ipc.execInputEvent("ELECTRICAL_Battery_1", ipcPARAM) Is your input event really named B:LIGHTING_PANEL_1_Inc? The input events I see in my aircraft don't start with B: ... DHC4_ENGINE_Propeller_1<> DHC4_ENGINE_Propeller_2<> ELECTRICAL_Alternator_1<> ELECTRICAL_Alternator_2<> ELECTRICAL_Battery_1<;FLOAT64> ENGINE_Throttle_1<;FLOAT64> ENGINE_Magneto_1<> ...
  4. Was my fault, works now. The reason it didn't work was that I used a wrong parameter.
  5. I also cannot get it to work. Karl
  6. Also, sometimes the checkbox "Select for FS control" gets unchecked when looking at button assignments.
  7. One strange thing: When assigning a lua script to a button the Parameter is not saved, it goes back to 0. Other lua scripts work. Renaming the script does not cure it. Not sure what's the reason. Here is a video (Dropbox link): https://www.dropbox.com/scl/fi/aumkxe9n18ero2cl99eqo/FSUIPC.mp4?rlkey=oqxlh23b6fss1gglyvcto5uh3&dl=0 Anything I can do, John? Do you need any logs or anything else? Thank you, Karl
  8. kaha

    BVars support?

    Ah, ok, didn't know that.
  9. kaha

    BVars support?

    In 7.4.0 the file "Controls List for MSFS.txt" is missing. Is there a reason?
  10. kaha

    BVars support?

    Thank you for the explanation, John. Karl
  11. Hi, what's the state about BVar support in FSUIPC? Or are there any plans for future versions? Thx, Karl
  12. Ok, thank you.
  13. For buttons I can always add non profile specific entries to the [Buttons] section and all aircraft will utilize it. If I do that for an axis in the [Axes] section only aircraft that have no profile specific section will know about it.
  14. I understand that. but please let me explain. It works differently for axes and buttons. This is part of my .ini file: [Axes] PollInterval=10 RangeRepeatRate=10 0=BS,256,F,66162,66163,66164,66165 -{ TO SIM: COWLFLAP1_SET, COWLFLAP2_SET, COWLFLAP3_SET, COWLFLAP4_SET }- 1=CZ,256,F,x020025F2,0,0,0 -{ FSUIPC: offset word set, offset 25F2 }- [Buttons] PollInterval=25 ButtonRepeat=20,10 18=P72,19,C66080,0 -{GEAR_DOWN}- 19=P72,18,C66079,0 -{GEAR_UP}- I now make profile specific assignments for button and an axis for a specific aircraft. After that I have: [Axes] PollInterval=10 RangeRepeatRate=10 0=BS,256,F,66162,66163,66164,66165 -{ TO SIM: COWLFLAP1_SET, COWLFLAP2_SET, COWLFLAP3_SET, COWLFLAP4_SET }- 1=CZ,256,F,x020025F2,0,0,0 -{ FSUIPC: offset word set, offset 25F2 }- [Buttons] PollInterval=25 ButtonRepeat=20,10 18=P72,19,C66080,0 -{GEAR_DOWN}- 19=P72,18,C66079,0 -{GEAR_UP}- [Axes.Beaver] RangeRepeatRate=10 0=BS,256,F,66162,66163,66164,66165 -{ TO SIM: COWLFLAP1_SET, COWLFLAP2_SET, COWLFLAP3_SET, COWLFLAP4_SET }- 1=CZ,256,F,x020025F2,0,0,0 -{ FSUIPC: offset word set, offset 25F2 }- 2=KR,R0,F,67011,0,0,0 -{ TO SIM: ANTI_ICE_GRADUAL_SET }- [Buttons.Beaver] 1=PC,11,CL30:R,1 -{Lua Beav_TankSelect}- 7=PC,15,CL31:R,0 -{Lua Beav_FuelPump}- All the default axis assignments go into the Beaver axis section (which I don't want), but none of the default button assignments go to the Beaver button assignments. Now I change the default axis assignment from offset 25F2 to 25F4 and the button for gear down also changes from 19 to 13: [Axes] PollInterval=10 RangeRepeatRate=10 0=BS,256,F,66162,66163,66164,66165 -{ TO SIM: COWLFLAP1_SET, COWLFLAP2_SET, COWLFLAP3_SET, COWLFLAP4_SET }- 1=CZ,256,F,x020025F2,0,0,0 -{ FSUIPC: offset word set, offset 25F4 }- [Buttons] PollInterval=25 ButtonRepeat=20,10 18=P72,13,C66080,0 -{GEAR_DOWN}- 19=P72,18,C66079,0 -{GEAR_UP}- [Axes.Beaver] RangeRepeatRate=10 0=BS,256,F,66162,66163,66164,66165 -{ TO SIM: COWLFLAP1_SET, COWLFLAP2_SET, COWLFLAP3_SET, COWLFLAP4_SET }- 1=CZ,256,F,x020025F2,0,0,0 -{ FSUIPC: offset word set, offset 25F2 }- 2=KR,R0,F,67011,0,0,0 -{ TO SIM: ANTI_ICE_GRADUAL_SET }- [Buttons.Beaver] 1=PC,11,CL30:R,1 -{Lua Beav_TankSelect}- 7=PC,15,CL31:R,0 -{Lua Beav_FuelPump}- Now gear down still works for all aircraft. If I would want to have a different button for a specific aircraft I would assign it profile specific. The axis that now goes to offset 25F4 only works for aircraft that do not have profile specific axes assignments. I think the way it works for buttons is the better one.
  15. Yes, but the other way, if I want to change an axis assignment that is not profile specific, I have to load an aircraft that does not have any profile specific axis assingments. Then I change the axis assignment and it goes to the [AXIS] section. Now, all aircraft that do have profile specific axis assignments will not see the change, I have to manually update all [Axis.xx] sections in the .ini file.
  16. If I change an axis assignment which is not profile specific it gets updated in the [Axis] section. I then have to update all [Axes.xx] sections with manually in the .ini file? Or is there another way to do it from the GUI? Karl
  17. Thank you. I will inform you whenever I see irregularities. Best, Karl
  18. I saw the thread, there are wired things going on. Are you using this in a permanent lua script or in a button assignment? Maybe it's a timing matter? Life time of variables in Lua?
  19. Ok, I see. I am not familiar with this calc code language. I just thought, by looking at code in some .xml files, that this could work. But it'S strange, why does it work here and not for you? What was your code?
  20. This: value = 34 calc_code = value .. " (>A:GENERAL ENG THROTTLE LEVER POSITION:1, Percent) " .. value .. " (>A:GENERAL ENG THROTTLE LEVER POSITION:2, Percent) " .. value .. " (>A:GENERAL ENG THROTTLE LEVER POSITION:3, Percent) " ipc.execCalcCode(calc_code) results in the following string being executed: "34 (>A:GENERAL ENG THROTTLE LEVER POSITION:1, Percent) 34 (>A:GENERAL ENG THROTTLE LEVER POSITION:2, Percent) 34 (>A:GENERAL ENG THROTTLE LEVER POSITION:3, Percent) " This should be perfectly valid RPN code, isn't it? What do you mean when you say "using registers"
  21. Hello John, Doing calc_code = value .. " (>A:GENERAL ENG THROTTLE LEVER POSITION:1, Percent) " .. value .. " (>A:GENERAL ENG THROTTLE LEVER POSITION:2, Percent) " .. value .. " (>A:GENERAL ENG THROTTLE LEVER POSITION:3, Percent) " ipc.execCalcCode(calc_code) is the same as this, I think. At least it works perfectly: calc_code = value .. " (>A:GENERAL ENG THROTTLE LEVER POSITION:1, Percent)" ipc.execCalcCode(calc_code) calc_code = value .. " (>A:GENERAL ENG THROTTLE LEVER POSITION:2, Percent)" ipc.execCalcCode(calc_code) calc_code = value .. " (>A:GENERAL ENG THROTTLE LEVER POSITION:3, Percent)" ipc.execCalcCode(calc_code) But maybe I'm missing something concerning "ipc.execCalcCode()? This: value = value > 99.0 and 100 or value < 1.0 and 0 or value can be done due to the fact that true and false work differently in lua than in any other language. It makes sure that any value greater than 99.0 becomes 100.0 and any value smaller than 1.0 becomes 0.0 The construct x > y and a or b would in C/C++ read: x > y ? a : b;
  22. Thank you! Karl
  23. John, I've got a question: What's the better choice? To split code in seperate files like this: ------------ file 1 ---------------------------- function throttle1(offset, value) function throttle2(offset, value) event.offset (0x25F0, "SW", "throttle1") event.offset (0x25F2, "SW", "throttle2") ------------ file 2 ---------------------------- function mixture1(offset, value) function mixture2(offset, value) event.offset (0x2550, "SW", "mixture1") event.offset (0x2552, "SW", "mixture2") Or put everything in one file? Thank you, Karl
  24. I have 2 throttle levers and what I'm actually doing is controlling the left 3 and the right 3 seperately, or (by a switch) all 6 using the left throttle. event.offset (0x25F0, "SW", "throttle1") event.offset (0x25F2, "SW", "throttle2") function throttle1(offset, value) if user_aircraft_type:find(special_aircraft_names["BAE146"], 1, true) then ipc.control(67103, value) ipc.control(67110, value) if logic.And(ipc.buttons("C"), 8388608) == 8388608 then ipc.control(67117, value) ipc.control(67124, value) end elseif user_aircraft_type:find(special_aircraft_names["LATECOERE"], 1, true) then value = ((value + 16384) / 32767.0) * 100.0 value = value > 99.0 and 100 or value < 1.0 and 0 or value calc_code = value .. " (>A:GENERAL ENG THROTTLE LEVER POSITION:1, Percent) " .. value .. " (>A:GENERAL ENG THROTTLE LEVER POSITION:2, Percent) " .. value .. " (>A:GENERAL ENG THROTTLE LEVER POSITION:3, Percent) " ipc.execCalcCode(calc_code) if logic.And(ipc.buttons("C"), 8388608) == 8388608 then calc_code = value .. " (>A:GENERAL ENG THROTTLE LEVER POSITION:4, Percent) " .. value .. " (>A:GENERAL ENG THROTTLE LEVER POSITION:5, Percent) " .. value .. " (>A:GENERAL ENG THROTTLE LEVER POSITION:6, Percent) " ipc.execCalcCode(calc_code) end else ipc.control(67103, value) if logic.And(ipc.buttons("C"), 8388608) == 8388608 then ipc.control(67110, value) end end end function throttle2(offset, value) if user_aircraft_type:find(special_aircraft_names["BAE146"], 1, true) then if logic.And(ipc.buttons("C"), 8388608) ~= 8388608 then ipc.control(67117, value) ipc.control(67124, value) end elseif user_aircraft_type:find(special_aircraft_names["LATECOERE"], 1, true) then value = ((value + 16384) / 32767.0) * 100.0 value = value > 99.0 and 100 or value < 1.0 and 0 or value if logic.And(ipc.buttons("C"), 8388608) ~= 8388608 then calc_code = value .. " (>A:GENERAL ENG THROTTLE LEVER POSITION:4, Percent) " .. value .. " (>A:GENERAL ENG THROTTLE LEVER POSITION:5, Percent) " .. value .. " (>A:GENERAL ENG THROTTLE LEVER POSITION:6, Percent) " ipc.execCalcCode(calc_code) end else if logic.And(ipc.buttons("C"), 8388608) ~= 8388608 then ipc.control(67110, value) end end end Karl
  25. Thank you. I control throttles individually in a lua script using execCalcCode. This works from engine 1 to engine 6. calc_code = value .. " (>A:GENERAL ENG THROTTLE LEVER POSITION:1, Percent)" ipc.execCalcCode(calc_code) There are also variables for mixture and pitch: A:GENERAL ENG THROTTLE LEVER POSITION:1 and A:GENERAL ENG PROPELLER LEVER POSITION:1, but they only work for engines 1 to 4. Just wanted to be sure that those variables cannot be accessed somehow. Karl
×
×
  • 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.