ED Team Alex Okean Posted November 15, 2012 ED Team Posted November 15, 2012 (edited) By some requests internal logic of SFM planes control surfaces was switched off when custom cockpit present . instead of that you now have ability to set control surfaces position directly by using local value = get_aircraft_draw_argument_value(arg_number) set_aircraft_draw_argument_value(arg_number,value) Edited November 15, 2012 by Alex O'kean
Mt5_Roie Posted November 15, 2012 Posted November 15, 2012 Thanks Alex. Coder - Oculus Rift Guy - Court Jester
SkateZilla Posted November 15, 2012 Posted November 15, 2012 is this the same for landing Gear and Speedbrakes? Windows 10 Pro, Ryzen 2700X @ 4.6Ghz, 32GB DDR4-3200 GSkill (F4-3200C16D-16GTZR x2), ASRock X470 Taichi Ultimate, XFX RX6800XT Merc 310 (RX-68XTALFD9) 3x ASUS VS248HP + Oculus HMD, Thrustmaster Warthog HOTAS + MFDs
aaron886 Posted November 15, 2012 Posted November 15, 2012 It's very nice to get off work and see this thread. Thank you very much, Alex. I know I (and others) made a lot of noise about this one, so I do appreciate you coming through for us.
Dimebag Posted November 17, 2012 Posted November 17, 2012 Interesting, I wonder has anyone managed to use this code successfully to get a working gear up down command? It seems to me based on that code that we can set a particular argument value directly, but if I set arg 430 to 1, will the system detect that arg 430 is gear and adjust the drag parameters accordingly? I guess what I am asking is, are the gear and flap still tied to the sfm, or do we now have to code more than a command to get the gear or flaps to act appropriately? [sIGPIC][/sIGPIC] Find us at http://virtual-roulettes.forumotion.com/
aaron886 Posted November 17, 2012 Posted November 17, 2012 I was able to do it via arguments 0, 3, and 5, but only for single player. It appears other aircraft across multiplayer are not picking that up, which is a problem. I'll try using AFM arg numbers and see what happens.
Pat01 Posted November 18, 2012 Posted November 18, 2012 Smiley, try the following. I don't know how you defined your landing_gear_system, but this sample works fine. I trigger the action with a button in the internal cockpit. this is from my electric_system.lua initialisation file. As it is, it's gear down or gear up, no animation. I guess you'll have to code the animation too. local update_time_step = 0.1 make_default_activity(update_time_step) local GEAR_STATE = 0 function SetCommand(command,value) if command == 3001 then GEAR_STATE = value end end function update() set_aircraft_draw_argument_value(0,GEAR_STATE) end EDIT : How do you make your text appear in a code window in th thread ?
Mt5_Roie Posted November 18, 2012 Posted November 18, 2012 There is another small issue here. When you go from value 0 to 1 it doesn't animate the process of going from 0 1. So it either shows gears up or gears down. I'm working to see if I can code a delay for it to make it look animated..but no luck yet. Also trying to figure out how to get the keyboard keys to works again. I've tried adjusting the input file to use the command number for the function (like gear) but no avail at this point. Coder - Oculus Rift Guy - Court Jester
aaron886 Posted November 18, 2012 Posted November 18, 2012 Roiegat, if you can catch me on Skype, I'll explain the keyboard bit.
aaron886 Posted November 19, 2012 Posted November 19, 2012 Dimebag - it appears you must use traditional SFM arguments, 0-114. Flight control positions transmit over multiplayer for me, but gear position does not. Alex, or anyone qualified, can you shed some light on why gear position may not be shared across multiplayer instances?
aaron886 Posted November 19, 2012 Posted November 19, 2012 Here we go, triple-post! Seems it is possible to animate the gear across multiplayer. It may be an issue with my initialized state. If I can narrow it down to a succinct algorithmic problem, I'll post to make sure no one else runs into the same issue.
EagleEye Posted November 19, 2012 Posted November 19, 2012 EDIT : How do you make your text appear in a code window in th thread ? Just type: Same for spoiler and quote.:) Deutsche DCS-Flughandbücher SYSSpecs: i7-4790K @4GHz|GA-Z97X-SLI|16GB RAM|ASUS GTX1070|Win10 64bit|TrackIR5|TM Warthog/Saitek Pro Pedals
Pat01 Posted November 19, 2012 Posted November 19, 2012 Just type: Same for spoiler and quote.:) Thanks. Aaron, could you share the shortkey stuff ?
Mt5_Roie Posted November 19, 2012 Posted November 19, 2012 Aaron, Will find you sometime on Skype. But the keyboard inputs are not top priority right now. Got so much other stuff to deal with. Hopefully your project is going well. Roiegat, if you can catch me on Skype, I'll explain the keyboard bit. Coder - Oculus Rift Guy - Court Jester
aaron886 Posted November 19, 2012 Posted November 19, 2012 Pat - if I find time to write it up this week, yes! Aaron, Will find you sometime on Skype. But the keyboard inputs are not top priority right now. Got so much other stuff to deal with. Hopefully your project is going well. No worries. Going well, just digging out of the hole and back up to usable status.:D
Pat01 Posted November 19, 2012 Posted November 19, 2012 (edited) Aaron, no need, I got it. To All, The "set_aircraft_draw_argument_value" and "get_aircraft_draw_argument_value" functions are only for external model args. Are there some similar functions for internal cockpit model ? Smiley, Could you tell me two little words about animating ? Edited November 19, 2012 by Pat01
aaron886 Posted November 19, 2012 Posted November 19, 2012 No, no... cockpit animations are very different. Take a look in mainpanel_init.lua for cockpit animations. Clickable objects, however, have their animation done differently, via clickabledata.lua.
Pat01 Posted November 20, 2012 Posted November 20, 2012 Aaron, Thanks for pointing me in the right direction. I didn't see a thing that was just in front of my eyes. I'm having a look at it.
Pat01 Posted November 20, 2012 Posted November 20, 2012 Ok, I got my cockpit door working with a shortkey, external and cockpit models. Now I'm looking for playing a sound.
Pat01 Posted November 20, 2012 Posted November 20, 2012 CptSmiley, I got my cockpit door (external and cockpit models) animated and working with a keyboard shortkey. I'm looking for playing a sound that suit the opening/closing door with no luck at this time. I looked in the fm template as you told me, but I didn't notice nothing concerning any sound. Now, I'm dealing with the external nav lights that don't work as planned. Thanks.
Pat01 Posted November 21, 2012 Posted November 21, 2012 Concerning pitch, roll and rudder does someone have an idea ? I tried listen_command and create_gauge with no luck.
Pat01 Posted November 23, 2012 Posted November 23, 2012 Hello, Is there a listen command for joystick or is there another way to catch joystick movements ? Thanks.
BR55Sevas Posted November 23, 2012 Posted November 23, 2012 Pat, check this one \DCS World\DCS World\Mods\aircrafts\Wunderluft\Cockpit\mainpanel_init.lua in the end you can find list for animation what you need --base_gauge_StickRollPosition --base_gauge_StickPitchPosition --base_gauge_RudderPosition --base_gauge_ThrottleLeftPosition --base_gauge_ThrottleRightPosition --base_gauge_HelicopterCollective МиГ-29 Fly by wire СДУ Su-27SM second display panel https://www.youtube.com/embed/videoseries?list=PL_2GGwNpWNp_fKXfRtDhIk8s5Jf4a9XHS http://berkuts.ru Пилотажный сервер с роботом | Aerobatic server with PhantomControl
Pat01 Posted November 23, 2012 Posted November 23, 2012 I already created a gauge StickPitch = CreateGauge() StickPitch.arg_number = 74 StickPitch.input = {-1, 1} StickPitch.output = {-1, 1} StickPitch.controller = controllers.base_gauge_StickPitchPosition [/Code] But nothing happened, something's missing... The arg #74 has been rechecked in the model. I noticed the Joystick isn't dealed the same way the keyboard is. I tried to read some message from the stick with no success. I have no more idea at the moment.
Recommended Posts