guenseli 76 Posted November 11, 2009 Share Posted November 11, 2009 Hello, with the help and patience of Pete Dowson I managed a round round of some helpful commands for the CAT: All you have to do is copiing the code below into an empty wordpad/editor file and name this Catalina.lua ... the name doesn't matter, jus the LUA is important. Of course you should remember your choosen name ;-) Save this file in your FS MODULES Folder Now got to the FSUIPC menu and look into the pull down menu for all the FSX commands. Here you find the entry "Lua Catalina" and choose it. (the red field) There's a parameter field nearby (the green field) (This picture is from my J41 screenshots; so you have of course in the red field Lua Catalina) Now, the number for the parameter corresponds to a function in this list: -- param nr -- 1 = floats down -- 2 = floats up -- 3 = Carb Heat L up -- 4 = Carb heat L neutral -- 5 = Carb Heat L down -- 6 = Carb Heat L up -- 7 = Carb heat L neutral -- 8 = Carb Heat L down note: you have to play around how the carb heat fits the best for you I have e.g. on one "button pressed" param. 6 (carb up), ("Control to repeat") and on "control sent when button released" param. 7 (carb neutral). So I have total control over my carbheat as the heating up stops when I release the button. On an other button I have param. 8 and 7 for cooling down. So all in all I need 4 buttons for Carbheat, but I can manage carbheat as it is in the CAT. -- 9 = Primer L toggle -- 10 = Primer R toggle -- 11 = Starter L toggle -- 12 = Starter R toggle -- 13 = Mixture Levers Full Rich -- 14 = Mixture Levers Auto Rich -- 15 = Mixture Levers Auto Lean -- 16 = Mixture Levers Cutoff Oh yes, you can assign now a mixture lever with FSUIPCs lever range -- 17 = Both Fuel selectors OFF -- 18 = Both Fuel selectors ON - Both I have made there just two states - on and both for both selectors because normally I don't need anything else. -- 19 = Gyro Pilot (AP) toggle -- 20 = Gyro Pilot (AP) ON -- 21 = Gyro Pilot (AP) OFF -- 24 = Sperry Gain Elevator ON/OFF (value 3.5) -- 27 = Sperry Gain Aileron ON/OFF (value 3.5) -- 30 = Sperry Gain Rudder ON/OFF (value 3.5) -- 31 = Ignition ON and Magnetos both -- 32 battery toggle Latest Version of FSUIPC is needed!!! If you have questions, feel free to ask. But I expect that you know a little bit about FSUIPC, how to assign buttons and keys and where your modules folder is With the power of FSUIPC and this list of keycommands I can completely control the CAT without mouse (Attention: wordplay) Have fun Günter And here's the first little correction: I have to say that I would not change any parameters when I correct things. So there's no danger that people have to reassign everything new when an updated code comes up... Just copy and paste and everything works well.... November, 13th: Update (Oh my god its Friday the 13th today ) I have had several freezes in FSX when using the rotary knobs for HDG, bank and pitch. The reason is unknown. I have completely removed this functions out of my code. For the users (if there even any users?) theres no reassignment necessary. Just copy and paste the code below. New function is toggle battery AND: with the help of Finn now Sounds are added!!! -- param nr -- 1 = floats down -- 2 = floats up -- 3 = Carb Heat L up -- 4 = Carb heat L neutral -- 5 = Carb Heat L down -- 6 = Carb Heat L up -- 7 = Carb heat L neutral -- 8 = Carb Heat L down -- 9 = Primer L toggle -- 10 = Primer R toggle -- 11 = Starter L toggle -- 12 = Starter R toggle -- 13 = Mixture Levers Full Rich -- 14 = Mixture Levers Auto Rich -- 15 = Mixture Levers Auto Lean -- 16 = Mixture Levers Cutoff -- 17 = Both Fuel selectors OFF -- 18 = Both Fuel selectors ON - Both -- 19 = Gyro Pilot (AP) toggle -- 20 = Gyro Pilot (AP) ON -- 21 = Gyro Pilot (AP) OFF -- 24 = Sperry Gain Elevator ON/OFF (value 3.5) -- 27 = Sperry Gain Aileron ON/OFF (value 3.5) -- 30 = Sperry Gain Rudder ON/OFF (value 3.5) -- 31 = Ignition ON and Magnetos both -- 32 = toggle master battery -- Floats down if ipcPARAM == 1 then ipc.writeLvar("L:Cat_float", 2) ipc.sleep(3000) ipc.writeLvar("L:Cat_float", 0) -- Floats up elseif ipcPARAM == 2 then ipc.writeLvar("L:Cat_float", 1) ipc.sleep(3000) ipc.writeLvar("L:Cat_float", 0) -- Carb heat L up elseif ipcPARAM == 3 then ipc.writeLvar("Carbheat_pos_L", 1) -- Carb heat L neutral elseif ipcPARAM == 4 then ipc.writeLvar("Carbheat_pos_L", 0) ipc.writeLvar("L:CAT_SWITCH_OFF", 1) -- Carb heat L down elseif ipcPARAM == 5 then ipc.writeLvar("Carbheat_pos_L", 2) -- Carb heat R up elseif ipcPARAM == 6 then ipc.writeLvar("Carbheat_pos_R", 1) -- Carb heat R neutral elseif ipcPARAM == 7 then ipc.writeLvar("Carbheat_pos_R", 0) ipc.writeLvar("L:CAT_SWITCH_OFF", 1) -- Carb heat R down elseif ipcPARAM == 8 then ipc.writeLvar("Carbheat_pos_R", 2) -- Primer L Toggle elseif ipcPARAM == 9 then Cat_prime = "L:Cat_prime" val = 0 if ipc.readLvar(Cat_prime) == 0 then val = 2 end ipc.writeLvar(Cat_prime, val) ipc.writeLvar("L:CAT_SWITCH_ON", 1) -- Primer R Toggle elseif ipcPARAM == 10 then Cat_prime = "L:Cat_prime" val = 0 if ipc.readLvar(Cat_prime) == 0 then val = 1 end ipc.writeLvar(Cat_prime, val) ipc.writeLvar("L:CAT_SWITCH_ON", 1) -- Starter L Toggle elseif ipcPARAM == 11 then Cat_starter = "L:Cat_starter" val = 0 if ipc.readLvar(Cat_starter) == 0 then val = 2 end ipc.writeLvar(Cat_starter, val) ipc.writeLvar("L:CAT_SWITCH_ON", 1) -- Starter R Toggle elseif ipcPARAM == 12 then Cat_starter = "L:Cat_starter" val = 0 if ipc.readLvar(Cat_starter) == 0 then val = 1 end ipc.writeLvar(Cat_starter, val) ipc.writeLvar("L:CAT_SWITCH_ON", 1) -- Both Mixture Lever Full Rich elseif ipcPARAM == 13 then ipc.writeLvar("L:Cat_mixture_L_pos", 0) ipc.writeLvar("L:CAT_LEVER", 1) ipc.sleep(50) ipc.writeLvar("L:Cat_mixture_R_pos", 0) ipc.writeLvar("L:CAT_LEVER", 1) ipc.sleep(50) ipc.writeLvar("L:A_MIX_MODE_L", 0) ipc.sleep(50) ipc.writeLvar("L:A_MIX_MODE_R", 0) -- Both Mixture Lever Auto Rich elseif ipcPARAM == 14 then ipc.writeLvar("L:Cat_mixture_L_pos", 25) ipc.writeLvar("L:CAT_LEVER", 1) ipc.sleep(50) ipc.writeLvar("L:Cat_mixture_R_pos", 25) ipc.writeLvar("L:CAT_LEVER", 1) ipc.sleep(50) ipc.writeLvar("L:A_MIX_MODE_L", 1) ipc.sleep(50) ipc.writeLvar("L:A_MIX_MODE_R", 1) -- Both Mixture Lever Auto Lean elseif ipcPARAM == 15 then ipc.writeLvar("L:Cat_mixture_L_pos", 50) ipc.writeLvar("L:CAT_LEVER", 1) ipc.sleep(50) ipc.writeLvar("L:Cat_mixture_R_pos", 50) ipc.writeLvar("L:CAT_LEVER", 1) ipc.sleep(50) ipc.writeLvar("L:A_MIX_MODE_L", 2) ipc.sleep(50) ipc.writeLvar("L:A_MIX_MODE_R", 2) -- Both Mixture Lever Cutoff elseif ipcPARAM == 16 then ipc.writeLvar("L:Cat_mixture_L_pos", 75) ipc.writeLvar("L:CAT_LEVER", 1) ipc.sleep(50) ipc.writeLvar("L:Cat_mixture_R_pos", 75) ipc.writeLvar("L:CAT_LEVER", 1) ipc.sleep(50) ipc.writeLvar("L:A_MIX_MODE_L", 3) ipc.sleep(50) ipc.writeLvar("L:A_MIX_MODE_R", 3) -- Both Fuel selectors OFF elseif ipcPARAM == 17 then ipc.control(66516) ipc.sleep(100) ipc.control(65955) -- Both Fuel selectors ON - Both elseif ipcPARAM == 18 then ipc.control(66517) ipc.sleep(100) ipc.control(65956) -- Gyro Pilot (AP) toggle elseif ipcPARAM == 19 then AP_Lever = "L:Cat_AP_Lever" val = 0 if ipc.readLvar(AP_Lever) == 0 then val = 1 end ipc.writeLvar(AP_Lever, val) ipc.writeLvar("L:CAT_LEVER", 1) -- Gyro Pilot (AP) ON elseif ipcPARAM == 20 then ipc.writeLvar("L:Cat_AP_Lever", 1) ipc.writeLvar("L:CAT_LEVER", 1) -- Gyro Pilot (AP) OFF elseif ipcPARAM == 21 then ipc.writeLvar("L:Cat_AP_Lever", 0) ipc.writeLvar("L:CAT_LEVER", 1) -- Sperry Gain Elevator ON/OFF (value 3.5) elseif ipcPARAM == 24 then gain_elev = "L:Sperry_gain_elevator" val = 0 if ipc.readLvar(gain_elev) <= 0 then val = 44 end ipc.writeLvar(gain_elev, val) -- Sperry Gain Aileron ON/OFF (value 3.5) elseif ipcPARAM == 27 then gain_aileron = "L:Sperry_gain_aileron" val = 0 if ipc.readLvar(gain_aileron) <= 0 then val = 44 end ipc.writeLvar(gain_aileron, val) -- Sperry Gain Rudder ON/OFF (value 3.5) elseif ipcPARAM == 30 then gain_rudder = "L:Sperry_gain_rudder" val = 0 if ipc.readLvar(gain_rudder) <= 0 then val = 44 end ipc.writeLvar(gain_rudder, val) -- Ignition ON and Magnetos both elseif ipcPARAM == 31 then ipc.control(66026) ipc.writeLvar("L:CAT_SWITCH_OFF", 1) ipc.sleep(300) ipc.control(66535) ipc.writeLvar("L:CAT_SWITCH_ON", 1) elseif ipcPARAM == 32 then Cat_master = "L:Cat_master_batt_OFF" val = 0 if ipc.readLvar(Cat_master) == 0 then val = 1 end ipc.writeLvar(Cat_master, val) ipc.writeLvar("L:CAT_SWITCH_ON", 1) end Link to comment Share on other sites More sharing options...
Finn 873 Posted November 12, 2009 Share Posted November 12, 2009 Great work Guenseli !! Is is Ok if I pin it ? Finn Link to comment Share on other sites More sharing options...
guenseli 76 Posted November 12, 2009 Author Share Posted November 12, 2009 Yes, of course... on one condition : Do you have a idea how I can get acces to the sounds of the switches? My hole programming works, but without sound, what is very pity. I know from PMDG that they have a special parameter for their switch sounds, but I haven't found smilar with the cat.... could you help me...? And: it could be from time to time that I chnage, or rework some codes. Could we make it that I post here the whole code and you just copy and paste it into the pinned then with a little remark? thanks a lot! Link to comment Share on other sites More sharing options...
guenseli 76 Posted November 12, 2009 Author Share Posted November 12, 2009 Thread is not needed any longer. Update is in the original thread... Link to comment Share on other sites More sharing options...
Mykonian 0 Posted December 18, 2012 Share Posted December 18, 2012 I did everything you say but i cant make it work!!! I putted catalina.lua in fs modules but when i open fsuipc i dont find the menu with lua catalina. Link to comment Share on other sites More sharing options...
Shaun Fletcher 571 Posted January 7, 2013 Share Posted January 7, 2013 I did everything you say but i cant make it work!!! I putted catalina.lua in fs modules but when i open fsuipc i dont find the menu with lua catalina. Maybe you have not followed it absolutely as written. Link to comment Share on other sites More sharing options...
MarkHurst 173 Posted January 15, 2013 Share Posted January 15, 2013 This file has been a fantastic resource for mapping things to the buttons and levers on my Saitek throttle quads (especially the carb heat switches!) but I have so far been defeated by this line: Oh yes, you can assign now a mixture lever with FSUIPCs lever range Can anyone give me a pointer, even if it's just to the relevant section of the FSUIPC manual? Link to comment Share on other sites More sharing options...
Peter Lürkens 30 Posted January 15, 2013 Share Posted January 15, 2013 Hi Mark, You need a licensed instance of FSUIPC. Then go to the axis mapping and map certain ranges to the appropriate LUA calls in Günthers library, for setting the desired mixture positions. Simply move the lever to the begin of a range and press "From" then to the end and press "To". Then choose from the drop-down list your Lua script for the PBY-Mixture setting. It's recommended to have a bit dead band between the ranges, which avoids constant triggering of the adjacent commands when the lever readout is jittering around a boundary position. Be careful not to define overlapping ranges. The selected command is issued when a range is entered in the direction indicated with "Up" and "Down". The whole thing is a bit like Sudoku, and its best to make your self a plan, what you want to do and how to implement. In the left area I have mapped the lever to (Unused) which de-maps its function from my FSUIPC default profile, where it is assigned to the mixtures of standard twins. Otherwise it would interfere with the PBY's hidden mixture management, which is responsible for many realism effects as the sparc plug fouling, icing, and so on. best regards, Peter Link to comment Share on other sites More sharing options...
MarkHurst 173 Posted January 15, 2013 Share Posted January 15, 2013 go to the axis mapping... Holy cow, I never noticed that, I was looking in the joystick calibration screen! Thanks again Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.