diff --git a/ScriptTest.miz b/ScriptTest.miz index 6df5dac..2ffea93 100644 Binary files a/ScriptTest.miz and b/ScriptTest.miz differ diff --git a/Scripts/Airboss.lua b/Scripts/Airboss.lua new file mode 100644 index 0000000..56b2f25 --- /dev/null +++ b/Scripts/Airboss.lua @@ -0,0 +1,95 @@ +Airboss = {} +--[[ + Airboss funcitons: + - Control zone. + - Turn into wind. + - LSO. + - Marshal. + - Rescue Helo. + - Recover Tanker. + + +]] + +do + + function Airboss:New(groupName) + local obj = {} + + + setmetatable(obj, self) + self.__index = self + + return obj + end + + + + + +end + +RescueHelo = {} + +do + + RescueHelo.allHeloes = {} + + function RescueHelo:New(carrierUnitName,heloGroupName) + if not carrierUnitName or not heloGroupName then return end + if not Group.getByName(heloGroupName) then return end + + local obj = {} + + obj.deBug = false + + -- basic params + obj.heloGroupName = heloGroupName + obj.heloGroup = Group.getByName(heloGroupName) + + obj.unitName = obj.heloGroup:getUnit(1) + + obj.modex = 12 + + + -- FSM + obj.isRescuing = false + obj.isReturning = false + obj.isRunning = false + obj.isStoped = false + + -- Sim params + obj.homeBase = "" + obj.carrier = carrierUnitName + obj.carrierstop = false + obj.carriertype= 'CVN71' + + obj.performRescue = true + + -- control params + obj.altitude = 1 + + obj.offSetX = 1 + obj.offSetZ = 2 + + obj.rescueRadius = 28000 -- meter + obj.rescueDuration = 300 -- second + obj.homeFuel = 5 -- % + + setmetatable(obj, self) + self.__index = self + + local ev = {} + + function ev:onEvent(event) + if event.id == world.event.S_EVENT_EJECTION or event.id == world.event.S_EVENT_CRASH then + + --function + end + + end + world.addEventHandler(ev) + + return obj + end +end \ No newline at end of file