Code: Alles auswählen
local inf = Unit.getByName('test')
local infpos = inf:getPosition().p
trigger.action.smoke({x=infpos.x + math.random(5,10), y=infpos.y-2, z=infpos.z + math.random(5,10)}, trigger.smokeColor.Green)
Moderator: JaBoG32 Stab
Code: Alles auswählen
local inf = Unit.getByName('test')
local infpos = inf:getPosition().p
trigger.action.smoke({x=infpos.x + math.random(5,10), y=infpos.y-2, z=infpos.z + math.random(5,10)}, trigger.smokeColor.Green)
Code: Alles auswählen
local heli = Unit.getByName('heli')
local heligroup = Group.getByName('heli')
local helipos = heli:getPosition().p
local heliheading = mist.getHeading(heli)
local targetunit = trigger.misc.getZone('test')
local targetunitpos = {}
targetunitpos.x = targetunit.point.x + math.random(targetunit.radius * -1, targetunit.radius)
targetunitpos.z = targetunit.point.z + math.random(targetunit.radius * -1, targetunit.radius)
local data = {
["visible"] = false,
["groupId"] = "PontiacInf",
["taskSelected"] = true,
["hidden"] = false,
["units"] =
{
[1] =
{
["y"] = helipos.z + 8,
["type"] = "Soldier M4",
["name"] = "PontiacInf",
["unitId"] = 1,
["heading"] = heliheading,
["playerCanDrive"] = true,
["skill"] = "Excellent",
["x"] = helipos.x,
},
[2] =
{
["y"] = helipos.z,
["type"] = "Soldier M4",
["name"] = "PontiacInf",
["unitId"] = 2,
["heading"] = heliheading,
["playerCanDrive"] = true,
["skill"] = "Excellent",
["x"] = helipos.x + 8,
},
[3] =
{
["y"] = helipos.z - 8,
["type"] = "Soldier M4",
["name"] = "PontiacInf",
["unitId"] = 3,
["heading"] = heliheading,
["playerCanDrive"] = true,
["skill"] = "Excellent",
["x"] = helipos.x,
},
[4] =
{
["y"] = helipos.z,
["type"] = "Soldier M4",
["name"] = "PontiacInf",
["unitId"] = 4,
["heading"] = heliheading,
["playerCanDrive"] = true,
["skill"] = "Excellent",
["x"] = helipos.x - 8,
},
},
["name"] = "PontiacInf",
["task"] = "Ground Nothing",
}
coalition.addGroup(country.id.USA, Group.Category.GROUND, data)
trigger.action.outTextForGroup(Group.getID(heligroup), string.format("Troops are disembarking, hold position!"), 10)
local infgroup = Group.getByName('PontiacInf')
function generateWaypoints(targetunit, heli, waypointType)
local waypoints = {}
local targetunit = trigger.misc.getZone('test')
local targetunitpos = {}
targetunitpos.x = targetunit.point.x + math.random(targetunit.radius * -1, targetunit.radius)
targetunitpos.z = targetunit.point.z + math.random(targetunit.radius * -1, targetunit.radius)
local helipos = heli:getPosition().p
local landingpos = Unit.getByName("PontiacInf"):getPosition().p
local targetpoint = {
["type"] = "Flyover Point",
["ETA"] = 0,
["y"] = targetunitpos.z,
["x"] = targetunitpos.x,
["ETA_locked"] = true,
["speed"] = 15,
["speed_locked"] = true,
}
local landingpoint = {
["type"] = "Flyover Point",
["ETA"] = 0,
["y"] = landingpos.z,
["x"] = landingpos.x,
["ETA_locked"] = true,
["speed"] = 15,
["speed_locked"] = true,
}
if waypointType == 'LZ' then
waypoints[#waypoints+1] = mist.ground.buildWP(landingpoint, 'Off Road', 20)
waypoints[#waypoints+1] = mist.ground.buildWP(targetpoint, 'Diamond', 20)
end
return waypoints
end
LZ = generateWaypoints(targetunit, heli, 'LZ')
trigger.action.outText("Airborneassault on the move!", 40)
mist.goRoute(infgroup, LZ)
Code: Alles auswählen
local heli = Unit.getByName('heli')
local heligroup = Group.getByName('heli')
local target = trigger.misc.getZone('test')
local targetpos = {}
targetpos.x = target.point.x + math.random(target.radius * -1, target.radius)
targetpos.z = target.point.z + math.random(target.radius * -1, target.radius)
mist.flagFunc.units_in_zones
{
units = {'heli'},
zones = {'LZ'},
flag = 910,
}
function landingcheck()
trigger.action.setUserFlag('906', true) -- for testing, indicates heli has infantry on board, remove later
if heli:inAir()
then return
else if (trigger.misc.getUserFlag(910) > 0 and trigger.misc.getUserFlag(906) > 0)
then
trigger.action.outTextForGroup(Group.getID(heligroup), string.format("Troops are dismbarking, hold position!"), 10)
disembarking()
end
end
end
disembarktimer = mist.scheduleFunction(landingcheck, {}, timer.getTime(), 10)
function disembarking()
local helipos = heli:getPosition().p
local heliheading = mist.getHeading(heli)
trigger.action.outText("disembarking", 4)
local infGroupX = helipos.x + 10 * math.cos(heliheading + math.pi / 2)
local infGroupY = helipos.z + 10 * math.sin(heliheading + math.pi / 2)
local infGroupLeftX = helipos.x + 10 * math.cos(heliheading + (math.pi * 3) / 2)
local infGroupLeftY = helipos.z + 10 * math.sin(heliheading + (math.pi * 3) / 2)
local leftDistance = math.sqrt((infGroupLeftX - targetpos.x) ^ 2 + (infGroupLeftY - targetpos.z) ^ 2)
local rightDistance = math.sqrt((infGroupX - targetpos.x) ^ 2 + (infGroupY - targetpos.z) ^ 2)
if rightDistance >= leftDistance then
infGroupX = infGroupLeftX
infGroupY = infGroupLeftY
end
local data = {
["visible"] = false,
["groupId"] = "PontiacInf",
["taskSelected"] = true,
["hidden"] = false,
["units"] =
{
[1] =
{
["y"] = infGroupY,
["type"] = "Soldier M4",
["name"] = "PontiacInf",
["unitId"] = 1,
["heading"] = heliheading,
["playerCanDrive"] = true,
["skill"] = "Excellent",
["x"] = infGroupX,
},
[2] =
{
["y"] = infGroupY,
["type"] = "Soldier M4",
["name"] = "PontiacInf",
["unitId"] = 2,
["heading"] = heliheading,
["playerCanDrive"] = true,
["skill"] = "Excellent",
["x"] = infGroupX +2,
},
[3] =
{
["y"] = infGroupY +2,
["type"] = "Soldier M4",
["name"] = "PontiacInf",
["unitId"] = 3,
["heading"] = heliheading,
["playerCanDrive"] = true,
["skill"] = "Excellent",
["x"] = infGroupX,
},
[4] =
{
["y"] = infGroupY +2,
["type"] = "Soldier M4",
["name"] = "PontiacInf",
["unitId"] = 4,
["heading"] = heliheading,
["playerCanDrive"] = true,
["skill"] = "Excellent",
["x"] = infGroupX +2,
},
},
["name"] = "PontiacInf",
["task"] = "Ground Nothing",
}
coalition.addGroup(country.id.USA, Group.Category.GROUND, data)
trigger.action.outTextForGroup(Group.getID(heligroup), string.format("Troops are disembarking, hold position!"), 10)
local infgroup = Group.getByName('PontiacInf')
function generateWaypoints(target, heli, waypointType)
local waypoints = {}
local target = trigger.misc.getZone('test')
local targetpos = {}
targetpos.x = target.point.x + math.random(target.radius * -1, target.radius)
targetpos.z = target.point.z + math.random(target.radius * -1, target.radius)
local helipos = heli:getPosition().p
local landingpos = Unit.getByName("PontiacInf"):getPosition().p
local targetpoint = {
["type"] = "Flyover Point",
["ETA"] = 0,
["y"] = targetpos.z,
["x"] = targetpos.x,
["ETA_locked"] = true,
["speed"] = 15,
["speed_locked"] = true,
}
local landingpoint = {
["type"] = "Flyover Point",
["ETA"] = 0,
["y"] = landingpos.z,
["x"] = landingpos.x,
["ETA_locked"] = true,
["speed"] = 15,
["speed_locked"] = true,
}
if waypointType == 'Targetarea' then
waypoints[#waypoints+1] = mist.ground.buildWP(landingpoint, 'custom', 20)
waypoints[#waypoints+1] = mist.ground.buildWP(targetpoint, 'custom', 20)
end
return waypoints
end
Targetarea = generateWaypoints(target, heli, 'Targetarea')
trigger.action.outText("Airborneassault on the move!", 40)
mist.goRoute(infgroup, Targetarea)
--trigger.action.setUserFlag('911', true)
mist.removeFunction(disembarktimer)
end
Code: Alles auswählen
--create a group with the name "Infantryname" near a Triggerzone called "Pickupzone"
--create a heli with unit name "Heliname"
--create a Triggerzone called "Dropzone", thats where the infantry can be deployed
--create a Triggerzone called "Gotozone", thats the zone the infantry will move into
--note that flag # 902-906 are used in this script
local inf = Unit.getByName('Infantryname') --unit name of 1ste unit of Infantryname group
local infgroup = Group.getByName('Infantryname') --groupname of troops to be pickedup
local heli = Unit.getByName('Heliname') --unit name of transport heli
local heligroup = Group.getByName('Heliname') --group name of transport heli
mist.flagFunc.units_in_zones
{
units = {'Heliname'},
zones = {'Pickupzone'},
flag = 903,
}
function boarding()
if (trigger.misc.getUserFlag(903) < 1)
then
--trigger.action.outText("903", 4)
return
else
if heli:inAir()
then return
else
trigger.action.outTextForGroup(Group.getID(heligroup), string.format("Troops are embarking, hold position!"), 10)
trigger.action.setUserFlag('904', true) --Flag 1004 indicates troops can embark
--trigger.action.outText("904", 4)
end
if (trigger.misc.getUserFlag(904) > 0 and trigger.misc.getUserFlag(905) < 1)
then
local helipos = heli:getPosition().p
trigger.action.outTextForGroup(Group.getID(heligroup), string.format("Troops are embarking, hold position!"), 10)
local getin =
{
group = Group.getByName('Infantryname'),
point = {x = helipos.x, z = helipos.z, y = helipos.y},
radius = 0,
form = "custom",
speed = 20,
disableRoads = 1
}
mist.groupToRandomPoint(getin)
mist.removeFunction(boardingtimer)
end
end
end
boardingtimer = mist.scheduleFunction(boarding, {}, timer.getTime() + 1, 5)
mist.flagFunc.units_in_moving_zones --creating zone to trigger that troops embarked
{
units = {"Infantryname"},
zone_units = {"Heliname"},
radius = 20, --distance at which infanty embark
flag = 905,
stopflag = 906,
req_num = 1
}
function onboard()
if (trigger.misc.getUserFlag(905) > 0 and trigger.misc.getUserFlag(906) < 1)
then
local inf = Unit.getByName('Infantryname') --unit name of 1ste unit of Infantryname group
local infgroup = Group.getByName('Infantryname') --groupname of troops to be pickedup
infgroup:destroy()
trigger.action.setUserFlag('906',true) --Flag 1006 indicates troops are on board
trigger.action.outTextForGroup(Group.getID(heligroup), string.format("All troops on board!"), 10)
mist.removeFunction(onboardchecktimer)
end
end
onboardchecktimer = mist.scheduleFunction(onboard, {}, timer.getTime() + 1, 2)
local target = trigger.misc.getZone('Gotozone')
local targetpos = {}
targetpos.x = target.point.x + math.random(target.radius * -1, target.radius)
targetpos.z = target.point.z + math.random(target.radius * -1, target.radius)
mist.flagFunc.units_in_zones
{
units = {'Heliname'},
zones = {'Dropzone'},
flag = 902,
}
function landingcheck()
--trigger.action.setUserFlag('906', true) -- for testing, indicates heli has Infantryname on board, remove later
if heli:inAir()
then return
else if (trigger.misc.getUserFlag(902) > 0 and trigger.misc.getUserFlag(906) > 0)
then
trigger.action.outTextForGroup(Group.getID(heligroup), string.format("Troops are dismbarking, hold position!"), 10)
disembarking()
end
end
end
disembarktimer = mist.scheduleFunction(landingcheck, {}, timer.getTime(), 10)
function disembarking()
local helipos = heli:getPosition().p
local heliheading = mist.getHeading(heli)
--trigger.action.outText("disembarking", 4)
local infGroupX = helipos.x + 10 * math.cos(heliheading + math.pi / 2)
local infGroupY = helipos.z + 10 * math.sin(heliheading + math.pi / 2)
local infGroupLeftX = helipos.x + 10 * math.cos(heliheading + (math.pi * 3) / 2)
local infGroupLeftY = helipos.z + 10 * math.sin(heliheading + (math.pi * 3) / 2)
local leftDistance = math.sqrt((infGroupLeftX - targetpos.x) ^ 2 + (infGroupLeftY - targetpos.z) ^ 2)
local rightDistance = math.sqrt((infGroupX - targetpos.x) ^ 2 + (infGroupY - targetpos.z) ^ 2)
if rightDistance >= leftDistance then
infGroupX = infGroupLeftX
infGroupY = infGroupLeftY
end
local data = {
["visible"] = false,
["groupId"] = "InfantryDeployed",
["taskSelected"] = true,
["hidden"] = false,
["units"] =
{
[1] =
{
["y"] = infGroupY,
["type"] = "Soldier M4",
["name"] = "InfantryDeployed",
["unitId"] = 1,
["heading"] = heliheading,
["playerCanDrive"] = true,
["skill"] = "Excellent",
["x"] = infGroupX,
},
[2] =
{
["y"] = infGroupY,
["type"] = "Soldier M4",
["name"] = "InfantryDeployed",
["unitId"] = 2,
["heading"] = heliheading,
["playerCanDrive"] = true,
["skill"] = "Excellent",
["x"] = infGroupX +2,
},
[3] =
{
["y"] = infGroupY +2,
["type"] = "Soldier M4",
["name"] = "InfantryDeployed",
["unitId"] = 3,
["heading"] = heliheading,
["playerCanDrive"] = true,
["skill"] = "Excellent",
["x"] = infGroupX,
},
[4] =
{
["y"] = infGroupY +2,
["type"] = "Soldier M4",
["name"] = "InfantryDeployed",
["unitId"] = 4,
["heading"] = heliheading,
["playerCanDrive"] = true,
["skill"] = "Excellent",
["x"] = infGroupX +2,
},
},
["name"] = "InfantryDeployed",
["task"] = "Ground Nothing",
}
coalition.addGroup(country.id.USA, Group.Category.GROUND, data)
trigger.action.outTextForGroup(Group.getID(heligroup), string.format("Troops are disembarking, hold position!"), 10)
local infgroup = Group.getByName('InfantryDeployed')
function generateWaypoints(target, heli, waypointType)
local waypoints = {}
local target = trigger.misc.getZone('Gotozone')
local targetpos = {}
targetpos.x = target.point.x + math.random(target.radius * -1, target.radius)
targetpos.z = target.point.z + math.random(target.radius * -1, target.radius)
local helipos = heli:getPosition().p
local landingpos = Unit.getByName("InfantryDeployed"):getPosition().p
local targetpoint = {
["type"] = "Flyover Point",
["ETA"] = 0,
["y"] = targetpos.z,
["x"] = targetpos.x,
["ETA_locked"] = true,
["speed"] = 15,
["speed_locked"] = true,
}
local landingpoint = {
["type"] = "Flyover Point",
["ETA"] = 0,
["y"] = landingpos.z,
["x"] = landingpos.x,
["ETA_locked"] = true,
["speed"] = 15,
["speed_locked"] = true,
}
if waypointType == 'Targetarea' then
waypoints[#waypoints+1] = mist.ground.buildWP(landingpoint, 'custom', 20)
waypoints[#waypoints+1] = mist.ground.buildWP(targetpoint, 'custom', 20)
end
return waypoints
end
Targetarea = generateWaypoints(target, heli, 'Targetarea')
--trigger.action.outText("Airborneassault on the move!", 40)
trigger.action.setUserFlag('906', false)
mist.goRoute(infgroup, Targetarea)
--trigger.action.setUserFlag('911', true)
mist.removeFunction(disembarktimer)
end
Code: Alles auswählen
mist.ground.patrol = function(gpData, pType)
local tempRoute = {}
local useRoute = {}
if type(gpData) == 'string' then
gpData = Group.getByName(gpData)
end
local posStart = mist.getLeadPos(gpData)
if not route then
tempRoute = mist.getGroupRoute(gpData:getName())
else
for i = 1, #route do
tempRoute[#tempRoute +1] = mist.ground.buildWP(route[i], form, speed)
end
end
useRoute[#useRoute + 1] = mist.ground.buildWP(posStart, form, speed)
for i = 1, #tempRoute do
useRoute[#useRoute + 1] = mist.ground.buildWP(tempRoute[i], form, speed)
end
if pType and pType == 'doubleBack' then
for i = #tempRoute, 2, -1 do
useRoute[#useRoute + 1] = mist.ground.buildWP(tempRoute[i], form, speed)
end
end
local tempTask = {
id = 'WrappedAction',
params = {
action = {
id = 'Script',
params = {
command = tostring('local group = ... \n mist.ground.patrol(group:getName() , ' .. mist.utils.basicSerialize(pType) .. ')') ,
},
},
},
}
useRoute[#useRoute].task = tempTask
mist.goRoute(gpData, useRoute)
end
Code: Alles auswählen
--MIST 2.0 required
--Following trigger zones need to be placed in the ME:
--1: Zone called 'airspawnzone1', which defines the area in which planes will airspawn
--2: Zone called 'landingpoint', which includes the airport on which the planes will land
--3: Zone called 'entrypoint1', which defines the entry/exit point of the airfield the planes are set to land or takeoff
groupcounter = 0
function generateAirplane()
randomnr1 = math.random(1,2) -- random for spawnpoints; 1=arrival, 2=depature
randomnr2 = math.random(1,8) -- random for aircrafttype
groupcounter = groupcounter + 1
if randomnr2 == 1
then
_aircrafttype = "C-17A" --or whatever type
else
if randomnr2 == 2
then
_aircrafttype = "Yak-40" --or whatever type
else
if randomnr2 == 3
then
_aircrafttype = "A-10C" --or whatever type
else
if randomnr2 == 4
then
_aircrafttype = "F/A-18C" --or whatever type
else
if randomnr2 == 5
then
_aircrafttype = "C-130" --or whatever type
else
if randomnr2 == 6
then
_aircrafttype = "Su-25T" --or whatever type
else
if randomnr2 == 7
then
_aircrafttype = "IL-76MD" --or whatever type
else
if randomnr2 == 8
then
_aircrafttype = "Su-25" --or whatever type
end
end
end
end
end
end
end
end
if randomnr1 == 1
then
_spawnairplane = trigger.misc.getZone('airspawnzone1')
_spawnairplanepos = {}
_spawnairplanepos.x = _spawnairplane.point.x + math.random(_spawnairplane.radius * -1, _spawnairplane.radius)
_spawnairplanepos.z = _spawnairplane.point.z + math.random(_spawnairplane.radius * -1, _spawnairplane.radius)
_alt = 6000
_speed = 250
_waypointtype = "Turning Point"
_waypointaction = "Turning Point"
_airdromeId = nil
route = 'arrival'
else
if randomnr1 == 2
then
_spawnairplane = trigger.misc.getZone('landingpoint')
_spawnairplanepos = {}
_spawnairplanepos.x = _spawnairplane.point.x + math.random(_spawnairplane.radius * -1, _spawnairplane.radius)
_spawnairplanepos.z = _spawnairplane.point.z + math.random(_spawnairplane.radius * -1, _spawnairplane.radius)
_alt = 88
_speed = 0
_waypointtype = "TakeOffParking"
_waypointaction = "From Parking Area"
_airdromeId = 24
route = 'departure'
end
end
_airplanedata = {
["modulation"] = 0,
["tasks"] =
{
}, -- end of ["tasks"]
["task"] = "CAS",
["uncontrolled"] = false,
["route"] =
{
["points"] =
{
[1] =
{
["alt"] = _alt,
["type"] = _waypointtype,
["action"] = _waypointaction,
["alt_type"] = "BARO",
["formation_template"] = "",
["ETA"] = 0,
["airdromeId"] = _airdromeId,
["y"] = _spawnairplanepos.z,
["x"] = _spawnairplanepos.x,
["speed"] = _speed,
["ETA_locked"] = true,
["task"] =
{
["id"] = "ComboTask",
["params"] =
{
["tasks"] =
{
}, -- end of ["tasks"]
}, -- end of ["params"]
}, -- end of ["task"]
["speed_locked"] = true,
}, -- end of [1]
}, -- end of ["points"]
}, -- end of ["route"]
["groupId"] = 1,
["hidden"] = false,
["units"] =
{
[1] =
{
["alt"] = _alt,
["heading"] = 0,
["type"] = _aircrafttype,
["psi"] = 0,
["onboard_num"] = "10",
["parking"] = 19,
["y"] = _spawnairplanepos.z,
["x"] = _spawnairplanepos.x,
["name"] = string.format(groupcounter),
["payload"] =
{
}, -- end of ["payload"]
["speed"] = _speed,
["unitId"] = string.format(groupcounter),
["alt_type"] = "BARO",
["skill"] = "High",
}, -- end of [1]
}, -- end of ["units"]
["y"] = _spawnairplanepos.z,
["x"] = _spawnairplanepos.x,
["name"] = string.format(groupcounter),
["communication"] = true,
["start_time"] = 0,
["frequency"] = 124,
}
trigger.action.outText("airplane data generated", 3)
coalition.addGroup(country.id.USA, Group.Category.AIRPLANE, _airplanedata)
trigger.action.outText("airplane spawned", 3)
end
generateAirplane()
Code: Alles auswählen
--MIST 2.0 required
--Following trigger zones need to be placed in the ME:
--1: Zone called 'airspawnzone1', which defines the area in which planes will airspawn
--2: Zone called 'landingpoint', which includes the airport on which the planes will land
--3: Zone called 'entrypoint1', which defines the entry/exit point of the airfield the planes are set to land or takeoff
groupcounter = 1 --airplanename = 1
route = 'departure' --waypoints set for departure, alternative 'arrival'
function generateWaypoints(_spawnairplane, _entrypoint1, _landingpoint1, waypointType)
local waypoints = {}
_spawnairplane = trigger.misc.getZone('airspawnzone1')
_spawnairplanepos = {}
_spawnairplanepos.x = _spawnairplane.point.x + math.random(_spawnairplane.radius * -1, _spawnairplane.radius)
_spawnairplanepos.z = _spawnairplane.point.z + math.random(_spawnairplane.radius * -1, _spawnairplane.radius)
_entrypoint1 = trigger.misc.getZone('entrypoint1')
_entrypoint1pos = {}
_entrypoint1pos.x = _entrypoint1.point.x + math.random(_entrypoint1.radius * -1, _entrypoint1.radius)
_entrypoint1pos.z = _entrypoint1.point.z + math.random(_entrypoint1.radius * -1, _entrypoint1.radius)
_landingpoint1 = trigger.misc.getZone('landingpoint')
_landingpoint1pos = {}
_landingpoint1pos.x = _landingpoint1.point.x + math.random(_landingpoint1.radius * -1, _landingpoint1.radius)
_landingpoint1pos.z = _landingpoint1.point.z + math.random(_landingpoint1.radius * -1, _landingpoint1.radius)
local startpoint1 = {
["alt"] = 6000,
["type"] = "Turning Point",
["action"] = "Turning Point",
["alt_type"] = "RADIO",
["formation_template"] = "",
["ETA"] = 0,
["y"] = _spawnairplanepos.z,
["x"] = _spawnairplanepos.x,
["speed"] = 250,
["ETA_locked"] = false,
["task"] =
{
["id"] = "ComboTask",
["params"] =
{
["tasks"] =
{
}, -- end of ["tasks"]
}, -- end of ["params"]
}, -- end of ["task"]
["speed_locked"] = true,
} -- end of [1]
local entrypoint1 =
{
["alt"] = 3000,
["type"] = "Turning Point",
["action"] = "Turning Point",
["alt_type"] = "RADIO",
["formation_template"] = "",
["ETA"] = 0,
["y"] = _entrypoint1pos.z,
["x"] = _entrypoint1pos.x,
["speed"] = 250,
["ETA_locked"] = false,
["task"] =
{
["id"] = "ComboTask",
["params"] =
{
["tasks"] =
{
}, -- end of ["tasks"]
}, -- end of ["params"]
}, -- end of ["task"]
["speed_locked"] = true,
}
local landingpoint1 =
{
["alt"] = 3000,
["type"] = "LAND",
["action"] = "Landing",
["alt_type"] = "RADIO",
["formation_template"] = "",
["ETA"] = 0,
["y"] = _landingpoint1pos.z,
["x"] = _landingpoint1pos.x,
["speed"] = 200,
["ETA_locked"] = false,
["task"] =
{
["id"] = "ComboTask",
["params"] =
{
["tasks"] =
{
}, -- end of ["tasks"]
}, -- end of ["params"]
}, -- end of ["task"]
["speed_locked"] = true,
}
local takeoffpoint =
{
["alt"] = _alt,
["type"] = "TakeOffParking",
["action"] = "From Parking Area",
["alt_type"] = "RADIO",
["formation_template"] = "",
["ETA"] = 0,
["y"] = _landingpoint1pos.z,
["x"] = _landingpoint1pos.x,
["speed"] = 0,
["ETA_locked"] = false,
["task"] =
{
["id"] = "ComboTask",
["params"] =
{
["tasks"] =
{
}, -- end of ["tasks"]
}, -- end of ["params"]
}, -- end of ["task"]
["speed_locked"] = true,
}
if waypointType == 'arrival'
then
waypoints[#waypoints+1] = mist.fixedWing.buildWP(startpoint1, "Turning Point", 250, 3000, "RADIO")
waypoints[#waypoints+1] = mist.fixedWing.buildWP(entrypoint1, "Turning Point", 250, 3000, "RADIO")
waypoints[#waypoints+1] = mist.fixedWing.buildWP(landingpoint1, "LAND", 250, 3000, "RADIO") --string type, number speed, number altitude, string altitudeType
else if waypointType == 'departure'
then
waypoints[#waypoints+1] = mist.fixedWing.buildWP(takeoffpoint, "TakeOffParking", 250, 3000, "RADIO")
waypoints[#waypoints+1] = mist.fixedWing.buildWP(entrypoint1, "Turning Point", 250, 3000, "RADIO")
waypoints[#waypoints+1] = mist.fixedWing.buildWP(startpoint1, "Turning Point", 250, 3000, "RADIO")
waypoints[#waypoints+1] = mist.fixedWing.buildWP(entrypoint1, "Turning Point", 250, 3000, "RADIO")
waypoints[#waypoints+1] = mist.fixedWing.buildWP(landingpoint1, "LAND", 250, 3000, "RADIO") --string type, number speed, number altitude, string altitudeType
end
end
return waypoints
end
flightplan = generateWaypoints(_spawnairplane, _entrypoint1, _landingpoint1, route)
local airtraffic1grp = Group.getByName(string.format(groupcounter))
mist.goRoute(airtraffic1grp, flightplan)
Code: Alles auswählen
randomAirplane = math.random(1,18) -- random for airplanettype; Russian AC 10-18 , for russion only set (10,18), or otherwise for other nations
randomHeli = math.random(1,18) --Russian AC 13-18, for russion only set (13,18), or otherwise for other nations
randomFighter = math.random(1,36) --Russian AC 18-36, for russion only set (18,36), or otherwise for other nations
Code: Alles auswählen
intervall = math.random(300,900) --(x,y) minimum x seconds, max. y seconds