Jump to content

Recommended Posts

Posted

Hi,

 

I'm producing a mod for the ME, and partially it's a conversion of some utilities script that I wrote before to be loaded and work in the mission environment using some of the SSE function (i.e. getAirbases, getGroup, etc).

 

I need a way to have those function working in the ME environment. I already be successful in using dofile function inside the ME... so I simply need how to load those function.

 

PS:

 

using dofile(lfs.currentdir() .. 'Scripts/ScriptingSystem.lua') seems not working.

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Posted (edited)

Ok I dumped the _G table in the ME environment... WTF, it's almost 535k lines. I also found a useful function to retrieve airbase data, but this function isn't telling me the coalition that own the airbase.

 

Any suggestion is appreciated, this airbase thing seems to be the most complicated issue.

 

Data I need from airbases + helipads:

 

1. Name (en)

2. Point (VEC2 or VEC3)

3. Airport Id / Helipad Id (unit ID of the static helipad structure)

4. Coalition owning the airbase/helipad

 

Those are almost the same information that you can retrieve from coalition.getAirbase function.

Edited by chromium

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Posted

Small update:

 


-- build AFB & Country Tables
DAWS.fillAFBandCOUNTRYtable = function()

	--[[ coalitions
		0 = neutral
		1 = red
		2 = blue		
	]]--
	
	local coalitions = {}
	coalitions[1] = 1 --coalition.side.RED
	coalitions[2] = 2 --coalition.side.BLUE
	coalitions[3] = 0 --coalition.side.NEUTRAL

	AFBtable = {}
	for k = 1, #coalitions do
		for airdromeID, airdrome in pairs(MapWindow.listAirdromes) do
			local j = #AFBtable + 1
			AFBtable[j] = {}
			AFBtable[j].id = airdromeID
			AFBtable[j].coaId = 0 [color="Red"]-- XXX this should change with something that identify the coalition.[/color]
			AFBtable[j].name = airdrome.names.en
			AFBtable[j].pos = {x = airdrome.reference_point.x, y = 0, z = airdrome.reference_point.y} 	-- tmp[i]:getPoint()
			AFBtable[j].category = tmp[i]:getTypeName() [color="Red"]-- XXX not working[/color]
			local aDesc = tmp[i]:getDesc() [color="Red"]-- XXX not working[/color]
			AFBtable[j].category = aDesc.category [color="Red"]-- XXX not working[/color]
			AFBtable[j].ICAO = airdrome.code
			AFBtable[j].FrqUHF = airdrome.frequency[3]
			AFBtable[j].FrqVHF = airdrome.frequency[1]
		end
	end
   
   
end
--]]--


 

That code works gathering information for everything except the red lines.. which I need for.

 

I'm also looking for a "plan B", which is not using this function. What I need is to locate the airport / heliport* nearest to a given group, obviously of the same coalition.

 

* airport only for planes, airport or heliport for helicopters

 

Any suggestion?

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Posted

ok solved using getNearestAirdromePoint, a me_db function :)

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

  • Recently Browsing   0 members

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