This commit is contained in:
Frank
2019-09-11 20:09:55 +02:00
parent af3bf7dece
commit a3067740a3
6 changed files with 385 additions and 216 deletions
@@ -442,12 +442,12 @@ end
--- Return a condition section for a controlled task.
-- @param #CONTROLLABLE self
-- @param DCS#Time time
-- @param #string userFlag
-- @param #boolean userFlagValue
-- @param #string condition
-- @param DCS#Time duration
-- @param #number lastWayPoint
-- @param DCS#Time time DCS mission time.
-- @param #string userFlag Name of the user flag.
-- @param #boolean userFlagValue User flag value *true* or *false*. Could also be numeric, i.e. either 0=*false* or 1=*true*. Other numeric values don't work!
-- @param #string condition Lua string.
-- @param DCS#Time duration Duration in seconds.
-- @param #number lastWayPoint Last waypoint.
-- return DCS#Task
function CONTROLLABLE:TaskCondition( time, userFlag, userFlagValue, condition, duration, lastWayPoint )
self:F2( { time, userFlag, userFlagValue, condition, duration, lastWayPoint } )
@@ -1079,8 +1079,8 @@ end
--- (AIR) Orbit at a position with at a given altitude and speed. Optionally, a race track pattern can be specified.
-- @param #CONTROLLABLE self
-- @param Core.Point#COORDINATE Coord Coordinate at which the CONTROLLABLE orbits.
-- @param #number Altitude Altitude in meters of the orbit pattern.
-- @param #number Speed Speed [m/s] flying the orbit pattern.
-- @param #number Altitude Altitude in meters of the orbit pattern. Default y component of Coord.
-- @param #number Speed Speed [m/s] flying the orbit pattern. Default 250 knots.
-- @param Core.Point#COORDINATE CoordRaceTrack (Optional) If this coordinate is specified, the CONTROLLABLE will fly a race-track pattern using this and the initial coordinate.
-- @return #CONTROLLABLE self
function CONTROLLABLE:TaskOrbit(Coord, Altitude, Speed, CoordRaceTrack)
@@ -1100,8 +1100,8 @@ function CONTROLLABLE:TaskOrbit(Coord, Altitude, Speed, CoordRaceTrack)
pattern = Pattern,
point = P1,
point2 = P2,
speed = Speed,
altitude = Altitude,
speed = Speed or UTILS.KnotsToMps(250),
altitude = Altitude or Coord.y,
}
}
+25 -2
View File
@@ -1683,7 +1683,7 @@ function GROUP:Respawn( Template, Reset )
end
end
else -- Reset=false or nil
elseif Reset==false then -- Reset=false or nil
-- Loop over template units.
for UnitID, TemplateUnitData in pairs( Template.units ) do
@@ -1725,7 +1725,30 @@ function GROUP:Respawn( Template, Reset )
self:F( { UnitID, Template.units[UnitID], Template.units[UnitID] } )
end
end
else
local units=self:GetUnits()
-- Loop over template units.
for UnitID, Unit in pairs(Template.units) do
for _,_unit in pairs(units) do
local unit=_unit --Wrapper.Unit#UNIT
if unit:GetName()==Unit.name then
local coord=unit:GetCoordinate()
local heading=unit:GetHeading()
Unit.x=coord.x
Unit.z=coord.y
Unit.alt=coord.alt
Unit.heading=math.rad(heading)
Unit.psi=-Unit.heading
end
end
end
end
end