Для корректности добавлю, что инструменты есть для всего кроме оружейки.
Чугуний можно запускать, а вот с управляемым оружием беда.
Насколько знаю, даже радар сейчас можно сделать без доп.инструментов.
Does anyone knows how to play engine sound with EFM?
I suppose this is somewhere here
double ed_fm_get_param(unsigned index)
{
if (index <= ED_FM_END_ENGINE_BLOCK)
{
switch (index)
{
case ED_FM_ENGINE_1_RPM:
[b]return 0;[/b]
case ED_FM_ENGINE_1_RELATED_RPM:
return 0;
case ED_FM_ENGINE_1_THRUST:
return 0;
case ED_FM_ENGINE_1_RELATED_THRUST:
return 0;
case ED_FM_ENGINE_2_RPM:
return 0;
case ED_FM_ENGINE_2_RELATED_RPM:
return 0;
case ED_FM_ENGINE_2_THRUST:
return 0;
case ED_FM_ENGINE_2_RELATED_THRUST:
return 0;//////////////
}
}
I tried to return 0..1 range or 0..maxRPM,
but engine sound does not play.
function LuaExportBeforeNextFrame()
rs, err = mysocket:receive('*l')
if (rs ~= nil) then
_, _, pitch, bank = string.find(rs, "(.+) (.+)")
LoSetCommand(2001, pitch)
LoSetCommand(2002, bank)
end
end
Another way I see is add some kind of counter.
If you know your dt, then you know tick number for full transition from 0 to 1.
So if you know there are shoud be 20 ticks, then just check this ticks
if (placement == 0) and (lever_pos > 0) and (tickCounter <21) then
lever_pos = lever_pos - 0.002
tickCounter = tickCounterPrev + 1
tickCounterPrev = tickCounter
end
also need to add extra statement for nulling the counter after we have reached the limits.
Of-course bad thing could happens in this case that we can over count 1.1.. or -0.1 which give unpredictable results with animation arguments.
And finally as we work with float/double vars so obvious better to check some range and manually round value.
So I think simple checking small deadzone in my 1st post is better solution.
Not sure about correct/incorrect solution, just some thoughts
add another if statement for force round var value
if (lever_pos > 0.9) then
lever_pos = 1.0
end
if (lever_pos < 0.1) then
lever_pos = 0.0
end
Вытащил данные по двигателю и руду из самой игры.
Эксперимент элементарный - долбим по РУДу функцией Хевисайда (то есть почти мгновенно) вверх и вниз от минимала до максимала и наоборот и смотрим что происходит с оборотами.
Минимал=>Максимал в увеличенном варианте
Тот же ещё более увеличенный фрагмент
Руд в максимале в момент времени t = 58.150 с
Видим (насколько позволяет сглаживание графика), что обороты при этом начали расти примерно с t = 59.120 c или того меньше.
Если конечно считать, что "заметное" изменение принять в 0.4-0.5%
То есть, получается, что обороты реагируют за рудом менее, чем за 1 секунду или того меньше.
И вариант Максимал=>Минимал
PS обсуждаемая проблема (если она и есть) меня не интересует. Мне интересен лишь технический момент обработки данных.
Good question, I have done similar, but I`ve used external software - winrar + console bat file. But anyway DCS are not frees the loaded mission, so I have to create miz copy file and load it.
PS Doesn't ED helps to their 3-rd parties in tech question?
Thats weird.
As I remember DCS freeze only if you try to send data from your app to DCS, and DCS waits data, if there are no data its freeze.
Functions like socket.receive or similar.
Try this advise, maybe it fix freeze