Alfa Posted June 3, 2012 Share Posted June 3, 2012 Very interesting! :) JJ Link to comment Share on other sites More sharing options...
Silver_Dragon Posted June 3, 2012 Share Posted June 3, 2012 a question? That file structure has aplicable for a helo / vehicle / ship? or need expecific files for that? Link to comment Share on other sites More sharing options...
42 Posted June 4, 2012 Share Posted June 4, 2012 Thanks Alex! Link to comment Share on other sites More sharing options...
Haddock Posted June 4, 2012 Share Posted June 4, 2012 Great topic! Thanks! Link to comment Share on other sites More sharing options...
ED Team NineLine Posted June 5, 2012 ED Team Share Posted June 5, 2012 So can I use this if I am wanting to add a custom ground vehicle with custom cannon/shell? Forum Rules • My YouTube • My Discord - NineLine#0440• **How to Report a Bug** Link to comment Share on other sites More sharing options...
Sceptre Posted June 10, 2012 Share Posted June 10, 2012 (edited) Great posts!! But do you know how I can get the MiG-29A cockpit model from FC2? Where is it in my FC2 folder? Thanks! EDIT: I am using DCS: World. Edited June 10, 2012 by Sceptre RTX 2070 8GB | 32GB DDR4 2666 RAM | AMD Ryzen 5 3600 4.2Ghz | Asrock X570 | CH Fighterstick/Pro Throttle | TM MFDs | TrackIR 5 Link to comment Share on other sites More sharing options...
Krebs20 Posted June 10, 2012 Share Posted June 10, 2012 Kabina MIG29a I don't remember the exact name off the top of my head. Something like that. [sIGPIC][/sIGPIC] Link to comment Share on other sites More sharing options...
Sceptre Posted June 11, 2012 Share Posted June 11, 2012 Okay thanks I found the 2 files but how do I implement this as my default cockpit for the MiG-29A? This is how my mods\aircrafts\MiG-29A folder is structured and my entry.lua: I basically structured it the same way as the Su-25T folder in DCS world. But how do I get this MiG-29A to use its own cockpit and radar etc from Flaming Cliffs 2? Thanks in advance. RTX 2070 8GB | 32GB DDR4 2666 RAM | AMD Ryzen 5 3600 4.2Ghz | Asrock X570 | CH Fighterstick/Pro Throttle | TM MFDs | TrackIR 5 Link to comment Share on other sites More sharing options...
SilentEagle Posted June 11, 2012 Share Posted June 11, 2012 (edited) I have three needles on the altimeter (10000 ft, 1000 ft, and 100 ft). I am trying to use the gauge: base_gauge_BarometricAltitude, but it appears that it only sends one number, the full altitude value (Ex: 11532 m), so I can only define the 10000 ft needle correctly. By extension, two needles will work below 10000ft and all three needles will work below 1000 ft. How can I use this base gauge to define all three needles? I notice the other DCS aircraft all pull from the *_common.dll files for their altimeter gauges through FM_PROXY. My code is below. If you could please advise on how I can use this gauge or how I can take it's value and perform a math modification on it to get the value I need to send to each gauge. Thanks! -- Altimeter --10000 ft needle base_gauge_BarometricAltitude = CreateGauge() base_gauge_BarometricAltitude.arg_number = 52 base_gauge_BarometricAltitude.input = {0.0, 30480.0} base_gauge_BarometricAltitude.output = {0.0, 1.0} base_gauge_BarometricAltitude.controller = controllers.base_gauge_BarometricAltitude --1000 ft needle base_gauge_BarometricAltitude = CreateGauge() base_gauge_BarometricAltitude.arg_number = 53 base_gauge_BarometricAltitude.input = {0.0, 3048.0} base_gauge_BarometricAltitude.output = {0.0, 1.0} base_gauge_BarometricAltitude.controller = controllers.base_gauge_BarometricAltitude --100 ft needle base_gauge_BarometricAltitude = CreateGauge() base_gauge_BarometricAltitude.arg_number = 51 base_gauge_BarometricAltitude.input = {0.0, 304.8} base_gauge_BarometricAltitude.output = {0.0, 1.0} base_gauge_BarometricAltitude.controller = controllers.base_gauge_BarometricAltitude Edited June 11, 2012 by SilentEagle Link to comment Share on other sites More sharing options...
SilentEagle Posted June 11, 2012 Share Posted June 11, 2012 (edited) Okay, we've made some progress! Followed your guide, Alex, and wrote this Altimeter.lua to do what I said I needed in the last post: local Altimeter = GetSelf() local update_rate = 0.1 -- 1/10 sec, or 10 times per second make_default_activity(update_rate) local sensor_data = get_base_data() local baro_alt10000 = get_param_handle("baro_alt10000") local baro_alt1000 = get_param_handle("baro_alt1000") local baro_alt100 = get_param_handle("baro_alt100") baro_alt100:set(0) baro_alt1000:set(0) baro_alt10000:set(0) function update() baro_alt100:set(sensor_data.getBarometricAltitude() % 1000) -- 12345 % 1000 = 345 baro_alt1000:set(sensor_data.getBarometricAltitude() % 10000) -- 12345 % 10000 = 2345 baro_alt10000:set(sensor_data.getBarometricAltitude()) end However, my 1000 ft needle still doesn't work above 10000 ft and my 100ft needle has a mind of its own and only moves in certain altitude ranges. Here is my addition to devices.lua: devices["ALTIMETER"] = counter()--6 Here is my addition to device_init.lua: creators[devices.ALTIMETER] = {"avLuaDevice" ,LockOn_Options.script_path.."Altimeter.lua"} And finally, here is my addition to mainpanel_init.lua: -- Altimeter --10000 ft needle Altimeter_10000m_Gauge = CreateGauge("parameter") Altimeter_10000m_Gauge.parameter_name = "baro_alt10000" Altimeter_10000m_Gauge.arg_number = 52 Altimeter_10000m_Gauge.input = {0.0, 30480.0} Altimeter_10000m_Gauge.output = {0.0, 1.0} --1000 ft needle Altimeter_1000m_Gauge = CreateGauge("parameter") Altimeter_1000m_Gauge.parameter_name = "baro_alt1000" Altimeter_1000m_Gauge.arg_number = 53 Altimeter_1000m_Gauge.input = {0.0, 3048.0} Altimeter_1000m_Gauge.output = {0.0, 1.0} --100 ft needle Altimeter_100m_Gauge = CreateGauge("parameter") Altimeter_100m_Gauge.parameter_name = "baro_alt100" Altimeter_100m_Gauge.arg_number = 51 Altimeter_100m_Gauge.input = {0.0, 304.8} Altimeter_100m_Gauge.output = {0.0, 1.0} Edited June 12, 2012 by SilentEagle Link to comment Share on other sites More sharing options...
beczl Posted June 12, 2012 Share Posted June 12, 2012 (edited) Try to use "cycled" parameter for your 1000 and 100m needle. Like this: --1000 ft needle Altimeter_1000m_Gauge = CreateGauge("cycled") Altimeter_1000m_Gauge.cycle_value = 1000 Altimeter_1000m_Gauge.arg_number = 53 Altimeter_1000m_Gauge.input = {0.0, 1000} Altimeter_1000m_Gauge.output = {0.0, 1.0} Altimeter_1000m_Gauge.controller = controllers.base_gauge_BarometricAltitude --100 ft needle Altimeter_100m_Gauge = CreateGauge("cycled") Altimeter_100m_Gauge.cycle_value = 100 Altimeter_100m_Gauge.arg_number = 51 Altimeter_100m_Gauge.input = {0.0, 100} Altimeter_100m_Gauge.output = {0.0, 1.0} Altimeter_100m_Gauge.controller = controllers.base_gauge_BarometricAltitude And no alt100 and 1000 variable need to Altimeter.lua Edited June 12, 2012 by beczl 1 Link to comment Share on other sites More sharing options...
SilentEagle Posted June 12, 2012 Share Posted June 12, 2012 Thanks beczl! I didn't have to write a device after all, but at least I learned how. Link to comment Share on other sites More sharing options...
Tango Posted June 12, 2012 Share Posted June 12, 2012 OK... how did you know to use "cycled"? Where can we get a list of these things? Best regards, Tango. Link to comment Share on other sites More sharing options...
42 Posted June 12, 2012 Share Posted June 12, 2012 OK... how did you know to use "cycled"? Where can we get a list of these things? Best regards, Tango. He probably has the russian docs ;) Link to comment Share on other sites More sharing options...
Tango Posted June 12, 2012 Share Posted June 12, 2012 Probably....and a big dose of help from ED. :P Thanks to Alex got it working now. 8) Best regards, Tango. Link to comment Share on other sites More sharing options...
Blaze Posted June 12, 2012 Share Posted June 12, 2012 So I'm assuming we'd use this "cycled" param for similar gauges like the HSI, ADF and compasses? i7 7700K | 32GB RAM | GTX 1080Ti | Rift CV1 | TM Warthog | Win 10 "There will always be people with a false sense of entitlement. You can want it, you can ask for it, but you don't automatically deserve it. " Link to comment Share on other sites More sharing options...
SilentEagle Posted June 12, 2012 Share Posted June 12, 2012 Well, no, because the value of a heading wouldn't go past 2*PI or 360 degrees. Link to comment Share on other sites More sharing options...
Tango Posted June 12, 2012 Share Posted June 12, 2012 Let me work my magic and see what I can do... ;) Best regards, Tango. Link to comment Share on other sites More sharing options...
SilentEagle Posted June 13, 2012 Share Posted June 13, 2012 I'm trying to write a controller for the airbrakes to auto-extend past Mach 0.78 and retract below 0.78, but I cannot figure out how to send a command to the game. I have tried LoSetCommand(147) from the Export.lua and I have also tried SetCommand(147). What is the command to do this? Here is my code: local dev = GetSelf() local update_rate = 0.2 -- 1/5 sec, or 5 times per second make_default_activity(update_rate) local sensor_data = get_base_data() local m_max = get_param_handle("Max_Mach") local auto_ext = get_param_handle("AutoExtended") function post_initialize() auto_ext:set(0) m_max:set(0) print("post_initialize called in BrakeController.lua") end function update() local spdbrkpos = sensor_data.getSpeedBrakePos() local mach = sensor_data.getMachNumber() if mach>0.78 then m_max:set(1) else m_max:set(0) end if mach>0.78 and spdbrkpos==0 then --BRAKES OUT LoSetCommand(147) -- Air brake on auto_ext:set(1) elseif mach<0.75 and spdbrkpos==1 and auto_ext==1 then --BRAKES IN LoSetCommand(148) -- Air brake off auto_ext:set(0) end end Link to comment Share on other sites More sharing options...
beczl Posted June 13, 2012 Share Posted June 13, 2012 Should need to be insert the following before function update due the sensor_data declaration is required.. local sensor_data = get_base_data() make_default_activity(0.05) --20 time per secondSo the code looks like this: local sensor_data = get_base_data() make_default_activity(0.05) --20 time per second local m_max = get_param_handle("Max_Mach") local auto_ext = get_param_handle("AutoExtended") function post_initialize() auto_ext:set(0) m_max:set(0) print("post_initialize called in BrakeController.lua") end function update() local spdbrkpos = sensor_data.getSpeedBrakePos() local mach = sensor_data.getMachNumber() if mach>0.78 then m_max:set(1) else m_max:set(0) end if mach>0.78 and spdbrkpos==0 then --BRAKES OUT LoSetCommand(147) -- Air brake on auto_ext:set(1) elseif mach<0.75 and spdbrkpos==1 and auto_ext==1 then --BRAKES IN LoSetCommand(148) -- Air brake off auto_ext:set(0) end end need_to_be_closed = true -- close lua state after initialization Link to comment Share on other sites More sharing options...
BrontoloIT Posted June 13, 2012 Share Posted June 13, 2012 LoSetCommand(147) -- Air brake on Hi guys, what if, like on A10C, i need to set Air brake not FULL but just, let's suppose, to 40% ? It's possible or we need to wait for the AFM ? Link to comment Share on other sites More sharing options...
SilentEagle Posted June 13, 2012 Share Posted June 13, 2012 Hi guys, what if, like on A10C, i need to set Air brake not FULL but just, let's suppose, to 40% ? It's possible or we need to wait for the AFM ? I'm guessing that speedbrakes, being a flight model system, are tied to the SFM. Should need to be insert the following before function update due the sensor_data declaration is required.. If you look at the top of my example, I actually have those lines. Your example only re-ordered those lines. The command still does not work, but I know the logic is fine, because I have tested it. I am just wondering if LoSetCommand is the right command I should be using, or if that only works in export.lua I have tried your code as well and same result. Link to comment Share on other sites More sharing options...
beczl Posted June 13, 2012 Share Posted June 13, 2012 Sorry my fault. It's an early morning. :-) Link to comment Share on other sites More sharing options...
BrontoloIT Posted June 14, 2012 Share Posted June 14, 2012 Any update? Keep getting attempt to call global 'LoSetCommand' (a nil value) in my test device. As SiletnEagle wrote, probably LoSetCommand isn't the right command. Link to comment Share on other sites More sharing options...
Tango Posted June 14, 2012 Share Posted June 14, 2012 It would seem LoSetCommand can't be called from LUA scripts. :( Best regards, Tango. Link to comment Share on other sites More sharing options...
Recommended Posts