OPS Respawn

This commit is contained in:
Frank
2021-07-15 22:25:02 +02:00
parent 835041e5f6
commit 78b3e3c60b
6 changed files with 252 additions and 98 deletions

View File

@@ -410,7 +410,7 @@ do -- FSM
Transition.To = To
-- Debug message.
self:T2( Transition )
self:T3( Transition )
self._Transitions[Transition] = Transition
self:_eventmap( self.Events, Transition )
@@ -432,7 +432,7 @@ do -- FSM
-- @param #table ReturnEvents A table indicating for which returned events of the SubFSM which Event must be triggered in the FSM.
-- @return Core.Fsm#FSM_PROCESS The SubFSM.
function FSM:AddProcess( From, Event, Process, ReturnEvents )
self:T( { From, Event } )
self:T3( { From, Event } )
local Sub = {}
Sub.From = From
@@ -533,7 +533,7 @@ do -- FSM
Process._Scores[State].ScoreText = ScoreText
Process._Scores[State].Score = Score
self:T( Process._Scores )
self:T3( Process._Scores )
return Process
end
@@ -576,7 +576,7 @@ do -- FSM
self[__Event] = self[__Event] or self:_delayed_transition(Event)
-- Debug message.
self:T2( "Added methods: " .. Event .. ", " .. __Event )
self:T3( "Added methods: " .. Event .. ", " .. __Event )
Events[Event] = self.Events[Event] or { map = {} }
self:_add_to_map( Events[Event].map, EventStructure )
@@ -825,7 +825,7 @@ do -- FSM
end
-- Debug.
self:T2( { CallID = CallID } )
self:T3( { CallID = CallID } )
end
end
@@ -846,7 +846,7 @@ do -- FSM
function FSM:_gosub( ParentFrom, ParentEvent )
local fsmtable = {}
if self.subs[ParentFrom] and self.subs[ParentFrom][ParentEvent] then
self:T( { ParentFrom, ParentEvent, self.subs[ParentFrom], self.subs[ParentFrom][ParentEvent] } )
self:T3( { ParentFrom, ParentEvent, self.subs[ParentFrom], self.subs[ParentFrom][ParentEvent] } )
return self.subs[ParentFrom][ParentEvent]
else
return {}
@@ -1150,7 +1150,7 @@ do -- FSM_PROCESS
-- @param #FSM_PROCESS self
-- @return #FSM_PROCESS
function FSM_PROCESS:Copy( Controllable, Task )
self:T( { self:GetClassNameAndID() } )
self:T3( { self:GetClassNameAndID() } )
local NewFsm = self:New( Controllable, Task ) -- Core.Fsm#FSM_PROCESS
@@ -1176,13 +1176,13 @@ do -- FSM_PROCESS
-- Copy End States
for EndStateID, EndState in pairs( self:GetEndStates() ) do
self:T( EndState )
self:T3( EndState )
NewFsm:AddEndState( EndState )
end
-- Copy the score tables
for ScoreID, Score in pairs( self:GetScores() ) do
self:T( Score )
self:T3( Score )
NewFsm:AddScore( ScoreID, Score.ScoreText, Score.Score )
end

View File

@@ -26,19 +26,28 @@
--
-- ### Authors:
--
-- * FlightControl : Design & Programming
-- * FlightControl (Design & Programming)
--
-- ### Contributions:
--
-- * funkyfranky
-- * Applevangelist
--
-- ===
--
-- @module Core.Point
-- @image Core_Coordinate.JPG
do -- COORDINATE
--- @type COORDINATE
-- @field #string ClassName Name of the class
-- @field #number x Component of the 3D vector.
-- @field #number y Component of the 3D vector.
-- @field #number z Component of the 3D vector.
-- @field #number Heading Heading in degrees. Needs to be set first.
-- @field #number Velocity Velocity in meters per second. Needs to be set first.
-- @extends Core.Base#BASE
@@ -201,13 +210,24 @@ do -- COORDINATE
ClassName = "COORDINATE",
}
--- @field COORDINATE.WaypointAltType
--- Waypoint altitude types.
-- @type COORDINATE.WaypointAltType
-- @field #string BARO Barometric altitude.
-- @field #string RADIO Radio altitude.
COORDINATE.WaypointAltType = {
BARO = "BARO",
RADIO = "RADIO",
}
--- @field COORDINATE.WaypointAction
--- Waypoint actions.
-- @type COORDINATE.WaypointAction
-- @field #string TurningPoint Turning point.
-- @field #string FlyoverPoint Fly over point.
-- @field #string FromParkingArea From parking area.
-- @field #string FromParkingAreaHot From parking area hot.
-- @field #string FromRunway From runway.
-- @field #string Landing Landing.
-- @field #string LandingReFuAr Landing and refuel and rearm.
COORDINATE.WaypointAction = {
TurningPoint = "Turning Point",
FlyoverPoint = "Fly Over Point",
@@ -218,7 +238,14 @@ do -- COORDINATE
LandingReFuAr = "LandingReFuAr",
}
--- @field COORDINATE.WaypointType
--- Waypoint types.
-- @type COORDINATE.WaypointType
-- @field #string TakeOffParking Take of parking.
-- @field #string TakeOffParkingHot Take of parking hot.
-- @field #string TakeOff Take off parking hot.
-- @field #string TurningPoint Turning point.
-- @field #string Land Landing point.
-- @field #string LandingReFuAr Landing and refuel and rearm.
COORDINATE.WaypointType = {
TakeOffParking = "TakeOffParking",
TakeOffParkingHot = "TakeOffParkingHot",
@@ -232,13 +259,13 @@ do -- COORDINATE
--- COORDINATE constructor.
-- @param #COORDINATE self
-- @param DCS#Distance x The x coordinate of the Vec3 point, pointing to the North.
-- @param DCS#Distance y The y coordinate of the Vec3 point, pointing to the Right.
-- @param DCS#Distance z The z coordinate of the Vec3 point, pointing to the Right.
-- @return #COORDINATE
-- @param DCS#Distance y The y coordinate of the Vec3 point, pointing to up.
-- @param DCS#Distance z The z coordinate of the Vec3 point, pointing to the right.
-- @return #COORDINATE self
function COORDINATE:New( x, y, z )
--env.info("FF COORDINATE New")
local self = BASE:Inherit( self, BASE:New() ) -- #COORDINATE
local self=BASE:Inherit(self, BASE:New()) -- #COORDINATE
self.x = x
self.y = y
self.z = z
@@ -249,7 +276,7 @@ do -- COORDINATE
--- COORDINATE constructor.
-- @param #COORDINATE self
-- @param #COORDINATE Coordinate.
-- @return #COORDINATE
-- @return #COORDINATE self
function COORDINATE:NewFromCoordinate( Coordinate )
local self = BASE:Inherit( self, BASE:New() ) -- #COORDINATE
@@ -263,8 +290,8 @@ do -- COORDINATE
--- Create a new COORDINATE object from Vec2 coordinates.
-- @param #COORDINATE self
-- @param DCS#Vec2 Vec2 The Vec2 point.
-- @param DCS#Distance LandHeightAdd (optional) The default height if required to be evaluated will be the land height of the x, y coordinate. You can specify an extra height to be added to the land height.
-- @return #COORDINATE
-- @param DCS#Distance LandHeightAdd (Optional) The default height if required to be evaluated will be the land height of the x, y coordinate. You can specify an extra height to be added to the land height.
-- @return #COORDINATE self
function COORDINATE:NewFromVec2( Vec2, LandHeightAdd )
local LandHeight = land.getHeight( Vec2 )
@@ -274,8 +301,6 @@ do -- COORDINATE
local self = self:New( Vec2.x, LandHeight, Vec2.y ) -- #COORDINATE
self:F2( self )
return self
end
@@ -283,7 +308,7 @@ do -- COORDINATE
--- Create a new COORDINATE object from Vec3 coordinates.
-- @param #COORDINATE self
-- @param DCS#Vec3 Vec3 The Vec3 point.
-- @return #COORDINATE
-- @return #COORDINATE self
function COORDINATE:NewFromVec3( Vec3 )
local self = self:New( Vec3.x, Vec3.y, Vec3.z ) -- #COORDINATE
@@ -292,6 +317,22 @@ do -- COORDINATE
return self
end
--- Create a new COORDINATE object from a waypoint. This uses the components
--
-- * `waypoint.x`
-- * `waypoint.alt`
-- * `waypoint.y`
--
-- @param #COORDINATE self
-- @param DCS#Waypoint Waypoint The waypoint.
-- @return #COORDINATE self
function COORDINATE:NewFromWaypoint(Waypoint)
local self=self:New(Waypoint.x, Waypoint.alt, Waypoint.y) -- #COORDINATE
return self
end
--- Return the coordinates itself. Sounds stupid but can be useful for compatibility.
-- @param #COORDINATE self
@@ -1720,7 +1761,7 @@ do -- COORDINATE
return self:GetSurfaceType()==land.SurfaceType.LAND
end
--- Checks if the surface type is road.
--- Checks if the surface type is land.
-- @param #COORDINATE self
-- @return #boolean If true, the surface type at the coordinate is land.
function COORDINATE:IsSurfaceTypeLand()
@@ -2082,7 +2123,7 @@ do -- COORDINATE
--- Circle to all.
-- Creates a circle on the map with a given radius, color, fill color, and outline.
-- @param #COORDINATE self
-- @param #numberr Radius Radius in meters. Default 1000 m.
-- @param #number Radius Radius in meters. Default 1000 m.
-- @param #number Coalition Coalition: All=-1, Neutral=0, Red=1, Blue=2. Default -1=All.
-- @param #table Color RGB color table {r, g, b}, e.g. {1,0,0} for red (default).
-- @param #number Alpha Transparency [0,1]. Default 1.