Export.lua Mig-15BIS - ED Forums
 


Notices

Reply
 
Thread Tools Display Modes
Old 03-02-2017, 12:19 PM   #1
jazzymanserg
Junior Member
 
Join Date: Oct 2016
Location: Odessa
Posts: 52
Reputation power: 2
jazzymanserg is a jewel in the roughjazzymanserg is a jewel in the roughjazzymanserg is a jewel in the roughjazzymanserg is a jewel in the roughjazzymanserg is a jewel in the roughjazzymanserg is a jewel in the rough
Default Export.lua Mig-15BIS

Собираю виртуальную кабину этого пупсика. Ни где в инете нет ни одной ветки.

До этого собирал Су-25А. 40 кнопок одна ось 4 7 сегментника , ОЛЕД , 3 галетников, 40 светодиодов и 2 платы ардуино, (ни стандартный джой на 12 кн 3 оси и хатка)для получения данных использовал Експорт луа, SIOC и PITHON, для отправки данных о джойстике - PPJoy и pithon.
Есть вариант с управлением тоже через луа

Есть у кого то наработки по этой теме?
Есть ли какие то ньюнсы в луа скриптах применительно к Мигу ?

Пока что кнопки сделал через вирт джойстик но в планах все таки експорт. Я пока что там не нашел много команд из тех что нужно.

Last edited by jazzymanserg; 03-02-2017 at 06:17 PM.
jazzymanserg is offline   Reply With Quote
Old 03-04-2017, 11:03 AM   #2
BR=55=Sevas
Senior Member
 
BR=55=Sevas's Avatar
 
Join Date: Apr 2008
Location: Севастополь
Posts: 1,459
Reputation power: 127
BR=55=Sevas has much to be proud ofBR=55=Sevas has much to be proud ofBR=55=Sevas has much to be proud ofBR=55=Sevas has much to be proud ofBR=55=Sevas has much to be proud ofBR=55=Sevas has much to be proud ofBR=55=Sevas has much to be proud ofBR=55=Sevas has much to be proud ofBR=55=Sevas has much to be proud ofBR=55=Sevas has much to be proud ofBR=55=Sevas has much to be proud of
Default

Попробуйте почитать это и далее.
https://forums.eagle.ru/showpost.php...9&postcount=15
https://freemanru.wordpress.com/category/dcs-lua/

Естественно делайте поправку что многое поменялось. Скорее всего сейчас списки команд находятся в другом месте.
Метод тыка наше всё.

Last edited by BR=55=Sevas; 03-04-2017 at 11:06 AM.
BR=55=Sevas is offline   Reply With Quote
Old 03-24-2017, 01:14 AM   #3
jazzymanserg
Junior Member
 
Join Date: Oct 2016
Location: Odessa
Posts: 52
Reputation power: 2
jazzymanserg is a jewel in the roughjazzymanserg is a jewel in the roughjazzymanserg is a jewel in the roughjazzymanserg is a jewel in the roughjazzymanserg is a jewel in the roughjazzymanserg is a jewel in the rough
Default

Пишу вот такой текст:

HTML Code:
dofile(lfs.currentdir().."mods/aircraft/Mig-15bis/Cockpit/Scripts/devices.lua")
dofile(lfs.currentdir().."mods/aircraft/Mig-15bis/Cockpit/Scripts/command_defs.lua")

function LuaExportStart()
 end

function LuaExportBeforeNextFrame()
	local pit = GetDevice(2)
	if pit then 
	   pit:performClickableAction(3071,1.0)--power ON
	end
	local pit = GetDevice(devices.ELEC_INTERFACE)
	if pit then 
	   pit:performClickableAction(electric_commands.Mig15_Command_BatterySw,1.0)--power ON
	end
end

function LuaExportAfterNextFrame()
end

function LuaExportStop()

end

function LuaExportActivityNextEvent(t)

end
Для теста написал - надо включить тумблер на старте.
Ну и соответственно оно не включает. В чем ошибка не пойму.
Вот отрывки из системных файлов
HTML Code:
---clicable
function default_2_position_tumb11(hint_, device_, command_, arg_)
	return  {	
				class 		= {class_type.TUMB,class_type.TUMB},
				hint  		= hint_,
				device 		= device_,
				action 		= {command_,command_},
				arg 	  	= {arg_,arg_},
				arg_value 	= {2,-2}, 
				arg_lim   	= {{-1,1},{-1,1}},
				updatable 	= true, 
				use_OBB 	= true
			}
end
-----------------------////////////////////////
--comman_defs

count = start_command
electric_commands =
{
	Mig15_Command_BatterySw			= counter();
	Mig15_Command_GeneratorSw		= counter();

	
[B]	---device.lua[/B]
	
	local count = 0
local function counter()
	count = count + 1
	return count
end
-------DEVICE ID-------
devices = {}
-- moved forward for correct initialization of another devices
-- do not changed following sequence for sim
devices["FM_PROXY"]					= counter()
devices["ELEC_INTERFACE"]			= counter()
devices["CONTROL_INTERFACE"]		= counter()
devices["WEAPON_SYSTEM"]			= counter()
devices["STANDBY_COMPASS"]			= counter()
devices["KNEEBOARD"] 				= counter()
devices["CLOCK"] 					= counter()
de
[/HTML]
В логах ни каких ошибок

Last edited by jazzymanserg; 03-24-2017 at 01:19 AM.
jazzymanserg is offline   Reply With Quote
Old 03-25-2017, 01:32 PM   #4
BR=55=Sevas
Senior Member
 
BR=55=Sevas's Avatar
 
Join Date: Apr 2008
Location: Севастополь
Posts: 1,459
Reputation power: 127
BR=55=Sevas has much to be proud ofBR=55=Sevas has much to be proud ofBR=55=Sevas has much to be proud ofBR=55=Sevas has much to be proud ofBR=55=Sevas has much to be proud ofBR=55=Sevas has much to be proud ofBR=55=Sevas has much to be proud ofBR=55=Sevas has much to be proud ofBR=55=Sevas has much to be proud ofBR=55=Sevas has much to be proud ofBR=55=Sevas has much to be proud of
Default

У вас же циклически повторяется код в BeforeNextFrame
переносите в LuaExportStart и пробуйте дальше.
BR=55=Sevas is offline   Reply With Quote
Old 03-25-2017, 08:57 PM   #5
jazzymanserg
Junior Member
 
Join Date: Oct 2016
Location: Odessa
Posts: 52
Reputation power: 2
jazzymanserg is a jewel in the roughjazzymanserg is a jewel in the roughjazzymanserg is a jewel in the roughjazzymanserg is a jewel in the roughjazzymanserg is a jewel in the roughjazzymanserg is a jewel in the rough
Default

Даже если в цикле - я всего лишь включаю питание. Выключения там нет.
Но я все же попробовал, результат такой - же.
Такое впечатление что функции не работают как надо ?
jazzymanserg is offline   Reply With Quote
Old 04-04-2017, 07:17 PM   #6
jazzymanserg
Junior Member
 
Join Date: Oct 2016
Location: Odessa
Posts: 52
Reputation power: 2
jazzymanserg is a jewel in the roughjazzymanserg is a jewel in the roughjazzymanserg is a jewel in the roughjazzymanserg is a jewel in the roughjazzymanserg is a jewel in the roughjazzymanserg is a jewel in the rough
Default

Ошибка была в строке pit:performClickableAction(3071,1.0)--power ON
Первый по счету элемент 3001, а не 3000
jazzymanserg is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 07:51 PM. vBulletin Skin by ForumMonkeys. Powered by vBulletin®.
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.