swither Posted July 26, 2015 Posted July 26, 2015 I'm playing around with adding a new aircraft to DCS (made 3d model and i've based the scripts on wunderluft) but i'm having an issue where all my animations (rudders, flaps, etc) are working if AI is controlling the plane, but if it's player controlled they just won't animate at all. Any ideas? :) All help appreciated :):joystick: /Daniel Heatblur Simulations
RedBeard2 Posted July 26, 2015 Posted July 26, 2015 I've been having similar issues as noted in the breaking changes thread (http://forums.eagle.ru/showthread.php?t=145145).
BR55Sevas Posted July 27, 2015 Posted July 27, 2015 You need manualy code all animation and connect it to your input. Everything works, even more - you can add your custom argument animation which is absent in game by default. МиГ-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
swither Posted July 28, 2015 Author Posted July 28, 2015 I've been having similar issues as noted in the breaking changes thread (http://forums.eagle.ru/showthread.php?t=145145). Thanks for the answer. Is there an example somewhere of how to do this? Do i write this code in the cockpit scripts or somewhere else? Another question: The hud you made is very nice, is there any resources on how to use c++ for modding DCS? I thought it was restricted to third party devs. Or do you just use binary functions written in c++ from LUA? /Daniel Heatblur Simulations
BR55Sevas Posted July 28, 2015 Posted July 28, 2015 (edited) I think no examples, only "How to " thread I mentioned. HUD/MFD done by lua, all initialisation, textures definitions, transparency, some other parameters done with lua scripts. If you need render some uniqe params, then you have to make procedures to push params values from c++ to lua, thats much harder, but possible. For us - not 3rd p.devs restricted things are - radar, navigations, and weapon functions. Edited July 28, 2015 by BR=55=Sevas МиГ-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
swither Posted July 28, 2015 Author Posted July 28, 2015 Thanks for the reply! Is there a Lua function for setting values of existing animation arguments? Like setting flaps animation position? Also, do I need to use the makeflyable function even if I use the dofile on my cockpit script? /Daniel Heatblur Simulations
BR55Sevas Posted July 28, 2015 Posted July 28, 2015 set_aircraft_draw_argument_value(arg_number,value) МиГ-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
swither Posted July 28, 2015 Author Posted July 28, 2015 Ok! I've played around a bit now and this is what i came up with and implemented as a cockpit device: local dev = GetSelf() local update_time_step = 0.02 make_default_activity(update_time_step) -- enables call to update local sensor_data = get_base_data() function post_initialize() print("ext. anim. post_initialize called") for key,value in pairs(sensor_data) do print("found member " .. key); end end function update() --Test set anim argument -- local temp = sensor_data:getStickPitchPosition() / 100 local temp2 = sensor_data:getStickRollPosition() / 100 set_aircraft_draw_argument_value(15, temp2) -- left elev set_aircraft_draw_argument_value(16, temp2) -- right elev -- print(temp) print(temp2) end Which seems to work :). Only strange thing is that getStickRollPosition seems to give pitch, and vice verse, any thoughts on this? But is this really the proper way to do it? This way AI-aircraft animation is handled totally different from player aircraft!?!? Is there any other way to do this other than through the cockpit scripts , which will apply both to AI aircraft and player aircraft? Thanks again for the help! 1 /Daniel Heatblur Simulations
archimaede Posted July 29, 2015 Posted July 29, 2015 Thanks for the help, now I've got a pitch animation. I suppose I'll have to add a line for every external animation, but as long as it works, it's ok :) I've also noticed about the pitch and roll mix up, and also had that even before adding your code. I don't know if it's a DCS issue or something else. Community A-4E mod
BR55Sevas Posted July 29, 2015 Posted July 29, 2015 Ok! I've played around a bit now and this is what i came up with and implemented as a cockpit device: But is this really the proper way to do it? This way AI-aircraft animation is handled totally different from player aircraft!?!? Is there any other way to do this other than through the cockpit scripts , which will apply both to AI aircraft and player aircraft? Thanks again for the help! As I know this way is fastest, cause you dont need recompile dll. lua is just text. If you want to use animation from dll, then check ed_fm_set_draw_args function insude c++ example. works almost the same as lua drawargs[15].f = (float)Input::stick_pitch; МиГ-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
Recommended Posts