Jump to content

Recommended Posts

Posted

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

Posted
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

Posted (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 by BR=55=Sevas
Posted

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

Posted

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!

  • Like 1

/Daniel

 

Heatblur Simulations

Posted

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.

Posted
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;

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...