--- More on mist.flagFunc.units_in_zones in the Mist docs, Page 14 --- The center of a Spherical Zone exists at the horizon of its object --- Mist flags are re-triggered each second, they do not latch --- https://flightcontrol.slack.com/archives/D5MRV9RB3/p1496598123681127 --- server side autoexec.cfg options.graphics.maxfps = 30 options.graphics.render3D = false if not net then net = {} end net.download_speed = 1024*1024 net.upload_speed = 256*1024 --- client side autoexec.cfg -- options.graphics.maxfps = 60 if not net then net = {} end net.download_speed = 1024*1024 net.upload_speed = 256*1024 === --- flak -- Once, Load FLAK Code, Do Script File Load Flakv3_4.lua -- Once, Load FLAK Manager, Do Script do flakmgr() end -- Continuous Action, mist.Blue Sochi FLAK Part Of Coal In Zone Do Script do vecflak('red', '07 Sochi Flak Zone','med',4) end === --- Armor deploys RPG_Team --- this clones a RPG_Team team at an armor group's position --- Tanks vs. Tanks 05 --- Mission Start Radio Add for Coalition per VGrp --- Once Deploy RPG_Team, remove Radio --- Blue --- Blue VGrp12 RPG Team --- Blue VGrp01 Tank --- Blue VGrp07 Bradley --- --- Red --- Red VGrp12 RPG Team --- Red VGrp01 Tank --- Red VGrp07 BMP --- local grpNameArmor = 'Blue VGrp01 Tank' local grpNameRPG_Team = 'Blue VGrp12 RPG Team' local unitNameArmor = Group.getByName(grpNameArmor):getUnit(1):getName() local basePos = mist.getLeadPos(grpNameArmor) local baseHeadingRad = mist.getHeading(Unit.getByName(unitNameArmor)) local baseHeadingDeg = baseHeadingRad * 180 / math.pi local newGroupRPG_Team = mist.getGroupData(grpNameRPG_Team) local newCoords = { [1] = { x = basePos.x + ((75 * math.cos(baseHeadingDeg)) - (0 * math.sin(baseHeadingDeg))), y = basePos.z + ((75 * math.sin(baseHeadingDeg)) + (0 * math.cos(baseHeadingDeg))), heading = baseHeadingDeg, }, [2] = { x = basePos.x + ((-75 * math.cos(baseHeadingDeg)) - (75 * math.sin(baseHeadingDeg))), y = basePos.z + ((-75 * math.sin(baseHeadingDeg)) + (75 * math.cos(baseHeadingDeg))), heading = baseHeadingDeg + 40, }, [3] = { x = basePos.x + ((-75 * math.cos(baseHeadingDeg)) - (-75 * math.sin(baseHeadingDeg))), y = basePos.z + ((-75 * math.sin(baseHeadingDeg)) + (-75 * math.cos(baseHeadingDeg))), heading = baseHeadingDeg - 40, } } for i = 1, #newGroupRPG_Team.units do newGroupRPG_Team.units[i].x = newCoords[i].x newGroupRPG_Team.units[i].y = newCoords[i].y newGroupRPG_Team.units[i].heading = newCoords[i].heading end newGroupRPG_Team.clone = true mist.dynAdd(newGroupRPG_Team) trigger.action.outText(grpNameArmor .. ' just dropped off an RPG Team!', 20) --- end of Armor deploys RPG_Team --- append client names --- this adds all mission defined Type = Client to tables called aircraftClientRedNames and aircraftClientBlueNames --- 1st create the tables aircraftClientBlueNames = {} aircraftClientRedNames = {} --- then do local function contains(tbl, val) for _,v in ipairs(tbl) do if v == val then return true end end return false end for uName, uData in pairs(mist.DBs.humansByName) do if(contains({'red'}, uData.coalition)) then if not(contains(aircraftClientRedNames, uName)) then table.insert(aircraftClientRedNames, uName) end end if(contains({'blue'}, uData.coalition)) then if not(contains(aircraftClientBlueNames, uName)) then table.insert(aircraftClientBlueNames, uName) end end end end --- end append client names --- detect client takeoff --- this sets flag 10008 or 50008 do local function detectClientTakeoff(event) local function contains(tbl, val) for _,v in ipairs(tbl) do if v == val then return true end end return false end if(event.id == world.event.S_EVENT_TAKEOFF and event.initiator) then local airborneUnitName = event.initiator:getName() if(contains(aircraftClientRedNames, airborneUnitName)) then trigger.action.setUserFlag(10008, true) trigger.action.outText('Red Client ' .. airborneUnitName .. ' just tookoff!', 5) end if(contains(aircraftClientBlueNames, airborneUnitName)) then trigger.action.setUserFlag(50008, true) trigger.action.outText('Blue Client ' .. airborneUnitName .. ' just tookoff!', 5) end end end mist.addEventHandler(detectClientTakeoff) end --- end detect client takeoff mist.flagFunc.units_in_zones{ units = {'[blue][plane]'}, zones = {'Test Zone'}, flag = 50107, zone_type = 'cylinder', } mist.flagFunc.units_in_zones{ units = {'[blue][plane]'}, zones = {'01 Sukhumi Zone'}, flag = 90156, toggle = true, } mist.flagFunc.units_in_zones{ units = {'F-15C 01', 'F-15C 02', 'F-15C 03', 'F-15C 04','M-2000C 21', 'M-2000C 22', 'M-2000C 23', 'M-2000C 24'}, zones = {'01 Sukhumi Zone'}, flag = 90156, toggle = true, } mist.flagFunc.units_in_zones{ units = {'F-15C 01', 'F-15C 02', 'F-15C 03', 'F-15C 04','M-2000C 21', 'M-2000C 22', 'M-2000C 23', 'M-2000C 24'}, zones = {'04 Kras Zone'}, flag = 90456, zone_type = 'sphere', toggle = true, } mist.flagFunc.units_in_zones{ units = {'[blue][plane]'}, zones = {'Test Zone'}, flag = 50207, zone_type = 'sphere', toggle = true, } mist.flagFunc.units_in_zones{ units = {'[blue][vehicle]'}, zones = {'Point Bastion'}, flag = 99, req_num = 8, stopflag = 1000, toggle = true, } mist.flagFunc.units_in_zones{ units = {'[red][plane]'}, zones = {'Ready to Attack Ground Units'}, flag = 10007, zone_type = 'cylinder', stopflag = 10004, toggle = true, } --- Stop Condition when a flag is true if trigger.misc.getUserFlag(90115) == 1 then return true end --- end of Stop Condition when a flag is true --- set a flag at a waypoint 'Perform Command', Run Script trigger.action.setUserFlag(71007, 1) --- end of set a flag at a waypoint --- Run Script to activate a group trigger.action.activateGroup(Group.getByName('RDR VGrp82-1 Mortar')) --- http://forums.eagle.ru/showthread.php?t=134722 --- end of Run Script to activate a group -- used to test for when an a/c enters a zone mist.flagFunc.units_in_zones{ units = {'[blue][plane]','[blue][helicopter]'}, zones = {'01 Red Zone'}, flag = 50007, zone_type = 'cylinder', } --- end --- mist.flagFunc.units_in_zones{ units = {'[-c]Ukraine','[red][plane]'}, zones = {'10 Threat Zone'}, flag = 91017, zone_type = 'cylinder', toggle = true, } mist.flagFunc.units_in_zones{ units = {'F-15C 01','F-15C 02','F-15C 03','F-15C 04','F-15C 11','F-15C 12','F-15C 13','F-15C 14','F-15C 21','F-15C 22','F-15C 23','F-15C 24'}, zones = {'10 Threat Zone'}, flag = 91057, zone_type = 'cylinder', } --- --- for Ants --- note,,, these flags fire off every second that this condition is met mist.flagFunc.units_in_zones{ units = {'[red][vehicle]','Mi-8T 81','Mi-8T 82','Mi-8T 83','Mi-8T 84'}, zones = {'RDR Z04B1 Zone'}, flag = 90417, zone_type = 'cylinder', toggle = true } --- more Ants, don't include --- -u RDR Z01B1 House mist.flagFunc.units_in_zones{ units = {'[red][vehicle]','[-u]RDR Z01B1 House','Mi-8T 81','Mi-8T 82','Mi-8T 83','Mi-8T 84'}, zones = {'RDR Z01B1 Zone'}, flag = 90117, zone_type = 'cylinder', toggle = true } mist.flagFunc.units_in_zones{ units = {'[red][vehicle]','[-u]RDR Z01B2 House','Mi-8T 81','Mi-8T 82','Mi-8T 83','Mi-8T 84'}, zones = {'RDR Z01B2 Zone'}, flag = 90127, zone_type = 'cylinder', toggle = true } mist.flagFunc.units_in_zones{ units = {'[red][vehicle]','[-u]RDR Z09B3 House','Mi-8T 81','Mi-8T 82','Mi-8T 83','Mi-8T 84'}, zones = {'RDR Z09B3 Zone'}, flag = 90937, zone_type = 'cylinder', toggle = true } --- end Ants --- from Erl Sis, needs 5 units in the zone mist.flagFunc.units_in_zones{ units = {'[g]BLF VGrp10 Convoy'}, zones = {'10 Ambush Zone'}, flag = 91077, zone_type = 'cylinder', toggle = true, req_num = 5, } --- end Erl Sis --- test script for Southern Storm --- must detect a specific a/c Group/Unit in an airbase zone --- set a flag when entering the zone --- clear the flag on exit --- old way local units = mist.makeUnitTable({'RDR AGrp01-1'}) local flag = 10117 local zones = {'Gudauta Zone'} local zone_type = 'cylinder' local function unitsInZonesOnOff(result) local ret = mist.getUnitsInZones(units, zones, zone_type) if #ret == 0 and result == true then trigger.action.setUserFlag(flag, 0) result = false elseif #ret > 0 and result == false then trigger.action.setUserFlag(flag, 1) result = true end mist.scheduleFunction (unitsInZonesOnOff, {result}, timer.getTime() + 1) end unitsInZonesOnOff(false) --- ^^^ old way, --- new way mist.flagFunc.units_in_zones{ units = {'RDR AGrp01-1'}, zones = {'Gudauta'}, flag = 10117, zone_type = 'cylinder', toggle = true, } --- end Southern Storm --- The Bridge, runs every 0.05 seconds to detect planes in very small zones 50-100 feet radius mist.flagFunc.units_in_zones{ units = {'[blue][plane]'}, zones = {'A Zone', 'B Zone', 'C Zone', 'D Zone', 'E Zone', 'F Zone', 'G Zone', 'H Zone', 'I Zone', 'J Zone', 'K Zone', 'L Zone', 'M Zone', 'N Zone', 'O Zone', 'P Zone', 'Q Zone' }, flag = 50007, zone_type = 'sphere', interval = .05, } --- end The Bridge --- For Pirates mission --- Note how these moving zones are created with a Unit mist.flagFunc.units_in_moving_zones{ units = {'[blue][plane]'}, zone_units = {'[g]Red SGrp01'}, flag = 40107, radius = 300, zone_type = 'sphere', toggle = true, } --- Zone 1 mist.flagFunc.units_in_moving_zones{ units = {'[blue][plane]'}, zone_units = {'Red SGrp01 Cargo Ship'}, flag = 40107, radius = 400, zone_type = 'sphere', toggle = true, interval = .25, } --- Zone 3 mist.flagFunc.units_in_moving_zones{ units = {'[blue][plane]'}, zone_units = {'Blue SGrp03 Tanker Ship'}, flag = 80307, radius = 400, zone_type = 'sphere', toggle = true, interval = .25, } --- end of Pirates --- Bridge At Zugdidi mist.flagFunc.units_in_zones{ units = {'[blue][plane]','[blue][helicopter]'}, zones = {'00 Battle Zone'}, flag = 90053, zone_type = 'cylinder', toggle = true, } mist.flagFunc.units_in_zones{ units = {'[g]BLF VGrp11 Commandos','[g]BLF VGrp12 Commandos','[g]BLF VGrp13 Commandos','[g]BLF VGrp14 Commandos','[g]BLF VGrp15 Commandos'}, zones = {'01 Zugdidi Bridge'}, flag = 90177, zone_type = 'cylinder', req_num = 6, } mist.flagFunc.units_in_zones{ units = {'[blue][plane]', '[blue][helicopter]'}, zones = {'11 Init Zone'}, flag = 91157, zone_type = 'cylinder', } mist.flagFunc.units_in_moving_zones{ units = {'[blue][plane]', '[blue][helicopter]'}, zone_units = {'[g]BLF VGrp10-1'}, flag = 91207, radius = 1000, zone_type = 'cylinder', } --- this clones a ground team at a helicopter's position local grpNameHelicopter = 'UH-1H 12 Stinger Teams Cold Start' local grpNameTeam = 'BLF VGrp04 MANPADS' local unitNameHelicopter = Group.getByName(grpNameHelicopter):getUnit(1):getName() local basePos = mist.getLeadPos(grpNameHelicopter) local baseHeadingRad = mist.getHeading(Unit.getByName(unitNameHelicopter)) local baseHeadingDeg = baseHeadingRad * 180 / math.pi local newGroupTeam = mist.getGroupData(grpNameTeam) local newCoords = { [1] = { x = basePos.x + ((75 * math.cos(baseHeadingDeg)) - (0 * math.sin(baseHeadingDeg))), y = basePos.z + ((75 * math.sin(baseHeadingDeg)) + (0 * math.cos(baseHeadingDeg))), heading = baseHeadingDeg, }, [2] = { x = basePos.x + ((-75 * math.cos(baseHeadingDeg)) - (75 * math.sin(baseHeadingDeg))), y = basePos.z + ((-75 * math.sin(baseHeadingDeg)) + (75 * math.cos(baseHeadingDeg))), heading = baseHeadingDeg + 40, }, [3] = { x = basePos.x + ((-75 * math.cos(baseHeadingDeg)) - (-75 * math.sin(baseHeadingDeg))), y = basePos.z + ((-75 * math.sin(baseHeadingDeg)) + (-75 * math.cos(baseHeadingDeg))), heading = baseHeadingDeg - 40, } } for i = 1, #newGroupTeam.units do newGroupTeam.units[i].x = newCoords[i].x newGroupTeam.units[i].y = newCoords[i].y newGroupTeam.units[i].heading = newCoords[i].heading end newGroupTeam.clone = true mist.dynAdd(newGroupTeam) local unitNameHelicopterPlayer = Group.getByName(grpNameHelicopter):getUnit(1):getPlayerName() trigger.action.outText(unitNameHelicopterPlayer .. ' just dropped off a Stinger team!', 20) --- end of Bridge At Zugdidi --- --- Armor deploys MANPADS --- this clones a MANPADS team at an armor group's position --- 'BLF VGrp01-2 Mozdok MANPADS' --- or RDR VGrp02-2 Minvody MANPADS --- Mission Start Radio Add for Coalition per VGrp --- Once Deploy Manpads, remove Radio --- Blue --- BLF VGrp01-2 Mozdok MANPADS --- BLF VGrp31 Armor MANPADS --- BLF VGrp37 Armor MANPADS --- BLF VGrp48 Armor MANPADS --- --- Red --- RDR VGrp02-2 Minvody MANPADS --- RDR VGrp14 Armor MANPADS --- RDR VGrp50 Armor MANPADS --- RDR VGrp55 Armor MANPADS --- --- RDR VGrp02-4 Minvody RPG --- RDR VGrp17 Armor RPG --- RDR VGrp51 Armor RPG --- RDR VGrp53 Armor RPG local grpNameArmor = 'BLF VGrp31 Armor MANPADS' local grpNameMANPADS = 'BLF VGrp01-2 Mozdok MANPADS' local unitNameArmor = Group.getByName(grpNameArmor):getUnit(1):getName() local basePos = mist.getLeadPos(grpNameArmor) local baseHeadingRad = mist.getHeading(Unit.getByName(unitNameArmor)) local baseHeadingDeg = baseHeadingRad * 180 / math.pi local newGroupMANPADS = mist.getGroupData(grpNameMANPADS) local newCoords = { [1] = { x = basePos.x + ((75 * math.cos(baseHeadingDeg)) - (0 * math.sin(baseHeadingDeg))), y = basePos.z + ((75 * math.sin(baseHeadingDeg)) + (0 * math.cos(baseHeadingDeg))), heading = baseHeadingDeg, }, [2] = { x = basePos.x + ((-75 * math.cos(baseHeadingDeg)) - (75 * math.sin(baseHeadingDeg))), y = basePos.z + ((-75 * math.sin(baseHeadingDeg)) + (75 * math.cos(baseHeadingDeg))), heading = baseHeadingDeg + 40, }, [3] = { x = basePos.x + ((-75 * math.cos(baseHeadingDeg)) - (-75 * math.sin(baseHeadingDeg))), y = basePos.z + ((-75 * math.sin(baseHeadingDeg)) + (-75 * math.cos(baseHeadingDeg))), heading = baseHeadingDeg - 40, } } for i = 1, #newGroupMANPADS.units do newGroupMANPADS.units[i].x = newCoords[i].x newGroupMANPADS.units[i].y = newCoords[i].y newGroupMANPADS.units[i].heading = newCoords[i].heading end newGroupMANPADS.clone = true mist.dynAdd(newGroupMANPADS) --- next two lines for Clients --- local unitNameArmorPlayer = Group.getByName(grpNameArmor):getUnit(1):getPlayerName() --- trigger.action.outText(unitNameArmorPlayer .. ' just dropped off a Stinger MANPADS!', 20) --- next line for AI trigger.action.outText(grpNameArmor .. ' just dropped off a MANPADS team!', 20) --- end of Armor deploys MANPADS --- Stinger Drop Vulcans vs Sharks -- for AI local grpName = 'BLF HGrp11 UH-1H Stinger' local unitNameManpads = 'BLF VGrp90 Stinger' local unitName = Group.getByName(grpName):getUnit(1):getName() local basePos = mist.getLeadPos(grpName) local baseHeadingRad = mist.getHeading(Unit.getByName(unitName)) local baseHeadingDeg = baseHeadingRad * 180 / math.pi -- trigger.action.outText('x = ' .. basePos.x .. ', z = ' .. basePos.z .. ', unit = ' .. unitName .. ', heading Radians = ' .. baseHeadingRad .. ', heading Degrees = ' .. baseHeadingDeg, 6) local newGroup = mist.getGroupData(unitNameManpads) local newCoords = { [1] = { x = basePos.x + ((75 * math.cos(baseHeadingDeg)) - (0 * math.sin(baseHeadingDeg))), y = basePos.z + ((75 * math.sin(baseHeadingDeg)) + (0 * math.cos(baseHeadingDeg))), heading = baseHeadingDeg, }, [2] = { x = basePos.x + ((-75 * math.cos(baseHeadingDeg)) - (75 * math.sin(baseHeadingDeg))), y = basePos.z + ((-75 * math.sin(baseHeadingDeg)) + (75 * math.cos(baseHeadingDeg))), heading = baseHeadingDeg + 40, }, [3] = { x = basePos.x + ((-75 * math.cos(baseHeadingDeg)) - (-75 * math.sin(baseHeadingDeg))), y = basePos.z + ((-75 * math.sin(baseHeadingDeg)) + (-75 * math.cos(baseHeadingDeg))), heading = baseHeadingDeg - 40, } } for i = 1, #newGroup.units do newGroup.units[i].x = newCoords[i].x newGroup.units[i].y = newCoords[i].y newGroup.units[i].heading = newCoords[i].heading end newGroup.clone = true -- trigger.action.outText('x = ' .. basePos.x .. ', z = ' .. basePos.z .. ', group = ' .. grpName .. ', unit = ' .. unitName .. ', heading Radians = ' .. baseHeadingRad .. ', heading Degrees = ' .. baseHeadingDeg .. ', Manpads = ' .. unitNameManpads, 6) mist.dynAdd(newGroup) -- for Clients -- UH-1H 01 Nalchik Cold Start, BLF VGrp90 Stinger -- UH-1H 02 Nalchik Cold Start -- UH-1H 03 FARP London Cold Start -- UH-1H 04 FARP London Cold Start -- UH-1H 05 FARP London Cold Start -- UH-1H 06 FARP London Cold Start -- UH-1H 11 Stinger Teams Cold Start, BLF VGrp04 MANPADS local grpNameHelicopter = 'UH-1H 11 Stinger Teams Cold Start' local grpNameTeam = 'BLF VGrp04 MANPADS' local unitNameHelicopter = Group.getByName(grpNameHelicopter):getUnit(1):getName() local basePos = mist.getLeadPos(grpNameHelicopter) local baseHeadingRad = mist.getHeading(Unit.getByName(unitNameHelicopter)) local baseHeadingDeg = baseHeadingRad * 180 / math.pi local newGroupTeam = mist.getGroupData(grpNameTeam) local newCoords = { [1] = { x = basePos.x + ((75 * math.cos(baseHeadingDeg)) - (0 * math.sin(baseHeadingDeg))), y = basePos.z + ((75 * math.sin(baseHeadingDeg)) + (0 * math.cos(baseHeadingDeg))), heading = baseHeadingDeg, }, [2] = { x = basePos.x + ((-75 * math.cos(baseHeadingDeg)) - (75 * math.sin(baseHeadingDeg))), y = basePos.z + ((-75 * math.sin(baseHeadingDeg)) + (75 * math.cos(baseHeadingDeg))), heading = baseHeadingDeg + 40, }, [3] = { x = basePos.x + ((-75 * math.cos(baseHeadingDeg)) - (-75 * math.sin(baseHeadingDeg))), y = basePos.z + ((-75 * math.sin(baseHeadingDeg)) + (-75 * math.cos(baseHeadingDeg))), heading = baseHeadingDeg - 40, } } for i = 1, #newGroupTeam.units do newGroupTeam.units[i].x = newCoords[i].x newGroupTeam.units[i].y = newCoords[i].y newGroupTeam.units[i].heading = newCoords[i].heading end newGroupTeam.clone = true mist.dynAdd(newGroupTeam) local unitNameHelicopterPlayer = Group.getByName(grpNameHelicopter):getUnit(1):getPlayerName() trigger.action.outText(unitNameHelicopterPlayer .. ' just dropped off a Stinger team!', 20) --- end of Stinger Drop Vulcans vs Sharks --- Simply War --- note,,, these flags fire off every second that this condition is met mist.flagFunc.units_in_zones{ units = {'MiG-21Bis 01','MiG-21Bis 02','MiG-21Bis 03','MiG-21Bis 04','RDR AGrp01-1 MiG-21Bis','RDR AGrp01-2 MiG-21Bis','RDR AGrp01-3 MiG-21Bis','RDR AGrp02-1 MiG-21Bis','RDR AGrp02-2 MiG-21Bis','RDR AGrp02-3 MiG-21Bis','RDR AGrp03-1 MiG-21Bis','RDR AGrp03-2 MiG-21Bis','RDR AGrp03-3 MiG-21Bis','RDR AGrp04-1 MiG-21Bis','RDR AGrp04-2 MiG-21Bis','RDR AGrp04-3 MiG-21Bis'}, zones = {'Zone 60mi'}, flag = 96017, zone_type = 'cylinder', toggle = true } mist.flagFunc.units_in_zones{ units = {'RDR VGrp90-2','RDR VGrp91-2','RDR VGrp92-2','RDR VGrp93-2','RDR VGrp94-2'}, zones = {'Zone 40mi'}, flag = 94037, zone_type = 'cylinder', toggle = true } --- Simply War, Helicopters drop A-Teams --- A-Team has one mortar #1, one #2 Stinger launcher, and three #3-5 Blue infantry --- note to self - the mortar team is too close together to easily select the mortar unit... local grpNameHeli = 'BLF HGrp21 Blackhawk' local grpNameTeam = 'BLF VGrp23 A-Team' local unitNameHeli = Group.getByName(grpNameHeli):getUnit(1):getName() local basePos = mist.getLeadPos(grpNameHeli) local baseHeadingRad = mist.getHeading(Unit.getByName(unitNameHeli)) local baseHeadingDeg = baseHeadingRad * 180 / math.pi -- trigger.action.outText('x = ' .. basePos.x .. ', z = ' .. basePos.z .. ', Heli unit = ' .. unitNameHeli .. ', heading Radians = ' .. baseHeadingRad .. ', heading Degrees = ' .. baseHeadingDeg, 6) local newGroupTeam = mist.getGroupData(grpNameTeam) local newCoords = { [1] = { x = basePos.x + ((75 * math.cos(baseHeadingDeg)) - (0 * math.sin(baseHeadingDeg))), y = basePos.z + ((75 * math.sin(baseHeadingDeg)) + (0 * math.cos(baseHeadingDeg))), heading = baseHeadingDeg, }, [2] = { x = basePos.x + ((-75 * math.cos(baseHeadingDeg)) - (75 * math.sin(baseHeadingDeg))), y = basePos.z + ((-75 * math.sin(baseHeadingDeg)) + (75 * math.cos(baseHeadingDeg))), heading = baseHeadingDeg + 40, }, [3] = { x = basePos.x + ((-75 * math.cos(baseHeadingDeg)) - (-75 * math.sin(baseHeadingDeg))), y = basePos.z + ((-75 * math.sin(baseHeadingDeg)) + (-75 * math.cos(baseHeadingDeg))), heading = baseHeadingDeg - 40, }, [4] = { x = basePos.x + ((74 * math.cos(baseHeadingDeg)) - (1 * math.sin(baseHeadingDeg))), y = basePos.z + ((74 * math.sin(baseHeadingDeg)) + (1 * math.cos(baseHeadingDeg))), heading = baseHeadingDeg - 5, }, [5] = { x = basePos.x + ((74 * math.cos(baseHeadingDeg)) - (-1 * math.sin(baseHeadingDeg))), y = basePos.z + ((74 * math.sin(baseHeadingDeg)) + (-1 * math.cos(baseHeadingDeg))), heading = baseHeadingDeg + 5, } } for i = 1, #newGroupTeam.units do newGroupTeam.units[i].x = newCoords[i].x newGroupTeam.units[i].y = newCoords[i].y newGroupTeam.units[i].heading = newCoords[i].heading end -- trigger.action.outText('x = ' .. basePos.x .. ', z = ' .. basePos.z .. ', Heli group = ' .. grpNameHeli .. ', Heli unit = ' .. unitNameHeli .. ', heading Radians = ' .. baseHeadingRad .. ', heading Degrees = ' .. baseHeadingDeg .. ', Team = ' .. grpNameTeam, 6) newGroupTeam.clone = true mist.dynAdd(newGroupTeam) trigger.action.outText(grpNameHeli .. ' just dropped off an A-Team team!', 20) -- local unitPlayerName = Group.getByName(grpNameHeli):getUnit(1):getPlayerName() -- trigger.action.outText(unitPlayerName .. ' just dropped off an A-Team team!', 20) --- end of Helicopters drop A-Teams, Simply War --- The Highway mist.flagFunc.units_in_zones{ units = {'[red][plane]'}, zones = {'01 Battle Zone', '02 Battle Zone'}, flag = 90117, zone_type = 'cylinder', toggle = true, } mist.flagFunc.units_in_zones{ units = {'F-15C 01 Air'}, zones = {'F15 Detect 1', 'F15 Detect 2', 'F15 Detect 3', 'F15 Detect 4'}, flag = 50107, zone_type = 'cylinder', toggle = true, } mist.flagFunc.units_in_zones{ units = {'RDR HGrp 10'}, zones = {'Kapel South Zone'}, flag = 21007, zone_type = 'sphere', toggle = true, } mist.flagFunc.units_in_zones{ units = {'F-15C 01', 'F-15C 02', 'F-15C 03', 'F-15C 04'}, zones = {'09 Gelen Zone'}, flag = 90957, zone_type = 'sphere', toggle = true, } -- the zone is defined by 6 unit locations, 02 Yellow Zone ZGrp #001, through 02 Yellow Zone ZGrp #006 -- this is not the best way mist.flagFunc.units_in_polygon{ units = {'Blue VGrp01'}, zone = { [1] = mist.DBs.unitsByName['02 Yellow Zone ZGrp #001'].point, [2] = mist.DBs.unitsByName['02 Yellow Zone ZGrp #002'].point, [3] = mist.DBs.unitsByName['02 Yellow Zone ZGrp #003'].point, [4] = mist.DBs.unitsByName['02 Yellow Zone ZGrp #004'].point, [5] = mist.DBs.unitsByName['02 Yellow Zone ZGrp #005'].point, [6] = mist.DBs.unitsByName['02 Yellow Zone ZGrp #006'].point, }, flag = 50127, toggle = true, } -- define the zone with a single hidden unit using its waypoints mist.flagFunc.units_in_polygon{ units = {'[blue][vehicle]','[-g]Blue ZGrp30 Armor'}, zone = mist.getGroupPoints('Blue ZGrp30 Armor'), flag = 73008, } --- end of The Highway --- Erl Sis, detect F-15Cs mist.flagFunc.units_in_zones{ units = {'F-15C 01','F-15C 02','F-15C 03','F-15C 04'}, zones = {'04 Air Zone'}, flag = 90457, zone_type = 'cylinder', toggle = true, } --- end of Erl Sis, detect F-15Cs --- for Blooze, RIP Blooze Feb 14, 2016 mist.msgMGRS{ units = { "R10", "R10_1", "R10_2", "R10_3", "cmd", "cmd1" }, acc = 6, displayTime = 40, msgFor = blue, text = "Pontiac, UZI, We have found an enemy command center. Rain hell on it! ", }