ED Forums - View Single Post - Changes to how instruments are exported?
View Single Post
Old 07-30-2014, 05:33 PM   #2
[FSF]Ian
ED Testers Team
 
Join Date: Feb 2013
Location: Germany
Posts: 1,291
Default

To export additional gauges, you need to do some minor edits to their Lua files.

Let's use the RWR as an example. Open Mods/aircraft/A-10C/Cockpit/Scripts/AN_ALR69V/indicator/AN_ALR69V_init.lua and append the following lines to the end of the file:
Code:
dofile(LockOn_Options.common_script_path.."ViewportHandling.lua")
try_find_assigned_viewport("ED_A10C_RWR")
("ED_A10C_RWR" is a unique name for the viewport, which you can pick arbitrarily as long as its a valid Lua variable name.)

You can then export the RWR like this in MonitorSetup.lua:
Code:
ED_A10C_RWR =
	{
		x = 599;
		y = 1360;
		width = 179;
		height = 179;
	}
I use this approach to export the clock and the RWR.

In general, under Cockpit/Scripts there is a subfolder for each device. Inside that is an indicator subfolder which includes one Lua file that ends with _init -- that is the one you want to edit.

Edit (2015-01-19): add code to the end of the file instead of the beginning (required for some indicators, others do not care)

Last edited by [FSF]Ian; 01-19-2015 at 04:40 PM.
[FSF]Ian is offline   Reply With Quote