From eacfbad729f5e5948cb3f71c349cb782a0209664 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Wed, 23 Nov 2022 09:48:06 +0100 Subject: [PATCH 01/11] #SPAWN * Fix for unit callsign number duplication since 2.8 release (ED saving callsign.name now as "Texaco11" instead of "Texaco" for the F10 Map overview --- Moose Development/Moose/Core/Spawn.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/Moose Development/Moose/Core/Spawn.lua b/Moose Development/Moose/Core/Spawn.lua index 9c5225a0b..00265187d 100644 --- a/Moose Development/Moose/Core/Spawn.lua +++ b/Moose Development/Moose/Core/Spawn.lua @@ -3038,6 +3038,7 @@ function SPAWN:_Prepare( SpawnTemplatePrefix, SpawnIndex ) -- R2.2 if type( Callsign ) ~= "number" then -- blue callsign Callsign[2] = ((SpawnIndex - 1) % 10) + 1 local CallsignName = SpawnTemplate.units[UnitID].callsign["name"] -- #string + CallsignName = string.match(CallsignName,"^(%a+)") -- 2.8 - only the part w/o numbers local CallsignLen = CallsignName:len() SpawnTemplate.units[UnitID].callsign["name"] = CallsignName:sub( 1, CallsignLen ) .. SpawnTemplate.units[UnitID].callsign[2] .. SpawnTemplate.units[UnitID].callsign[3] else From 1e139a6005116777a39b2b190acfc749731531b1 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Wed, 23 Nov 2022 09:55:47 +0100 Subject: [PATCH 02/11] #SPAWN * Fix callsign dupplication of numbers introduced with 2.8 --- Moose Development/Moose/Core/Spawn.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/Moose Development/Moose/Core/Spawn.lua b/Moose Development/Moose/Core/Spawn.lua index 9c5225a0b..00265187d 100644 --- a/Moose Development/Moose/Core/Spawn.lua +++ b/Moose Development/Moose/Core/Spawn.lua @@ -3038,6 +3038,7 @@ function SPAWN:_Prepare( SpawnTemplatePrefix, SpawnIndex ) -- R2.2 if type( Callsign ) ~= "number" then -- blue callsign Callsign[2] = ((SpawnIndex - 1) % 10) + 1 local CallsignName = SpawnTemplate.units[UnitID].callsign["name"] -- #string + CallsignName = string.match(CallsignName,"^(%a+)") -- 2.8 - only the part w/o numbers local CallsignLen = CallsignName:len() SpawnTemplate.units[UnitID].callsign["name"] = CallsignName:sub( 1, CallsignLen ) .. SpawnTemplate.units[UnitID].callsign[2] .. SpawnTemplate.units[UnitID].callsign[3] else From fe9a5aea2a1aef5ad6f4feba5ad0df5b43741713 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Wed, 23 Nov 2022 12:57:54 +0100 Subject: [PATCH 03/11] #AUFTRAG * Fix for orbit task not able to get a Vec2 from a Vec2... --- Moose Development/Moose/Ops/Auftrag.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Moose Development/Moose/Ops/Auftrag.lua b/Moose Development/Moose/Ops/Auftrag.lua index d007aa28a..d5e62aab1 100644 --- a/Moose Development/Moose/Ops/Auftrag.lua +++ b/Moose Development/Moose/Ops/Auftrag.lua @@ -6031,7 +6031,7 @@ function AUFTRAG:GetDCSMissionTask() --end -- Create orbit task. - local DCStask=CONTROLLABLE.TaskOrbit(nil, orbitVec2, self.orbitAltitude, self.orbitSpeed, orbitRaceTrack) + local DCStask=CONTROLLABLE.TaskOrbit(nil, COORDINATE:NewFromVec2(orbitVec2), self.orbitAltitude, self.orbitSpeed, orbitRaceTrack) -- Add DCS task. table.insert(DCStasks, DCStask) From cec045045e3fe1db1171a6c8d1a89873ef612b48 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Sun, 27 Nov 2022 17:29:53 +0100 Subject: [PATCH 04/11] * Less noise --- Moose Development/Moose/Wrapper/Airbase.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Moose Development/Moose/Wrapper/Airbase.lua b/Moose Development/Moose/Wrapper/Airbase.lua index f6e4c440f..a2fd0577a 100644 --- a/Moose Development/Moose/Wrapper/Airbase.lua +++ b/Moose Development/Moose/Wrapper/Airbase.lua @@ -1368,7 +1368,7 @@ function AIRBASE:FindFreeParkingSpotForAircraft(group, terminaltype, scanradius, local _nspots=nspots or group:GetSize() -- Debug info. - self:E(string.format("%s: Looking for %d parking spot(s) for aircraft of size %.1f m (x=%.1f,y=%.1f,z=%.1f) at terminal type %s.", airport, _nspots, _aircraftsize, ax, ay, az, tostring(terminaltype))) + self:T(string.format("%s: Looking for %d parking spot(s) for aircraft of size %.1f m (x=%.1f,y=%.1f,z=%.1f) at terminal type %s.", airport, _nspots, _aircraftsize, ax, ay, az, tostring(terminaltype))) -- Table of valid spots. local validspots={} From eb5a72fc27ab1916ba5ae4d1ea68fb22e40ca711 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Sun, 27 Nov 2022 17:35:09 +0100 Subject: [PATCH 05/11] * less noise --- Moose Development/Moose/Ops/ATIS.lua | 2 ++ Moose Development/Moose/Tasking/CommandCenter.lua | 2 +- Moose Development/Moose/Tasking/Mission.lua | 8 ++++---- Moose Development/Moose/Utilities/Utils.lua | 2 ++ Moose Development/Moose/Wrapper/Controllable.lua | 2 +- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Moose Development/Moose/Ops/ATIS.lua b/Moose Development/Moose/Ops/ATIS.lua index 083aa86a4..9cdf60ec3 100644 --- a/Moose Development/Moose/Ops/ATIS.lua +++ b/Moose Development/Moose/Ops/ATIS.lua @@ -268,6 +268,8 @@ -- Unfortunately, it is not possible to determine the duration of the complete transmission. So once the transmission is finished, there might be some radio silence before -- the next iteration begins. You can fine tune the time interval between transmissions with the @{#ATIS.SetQueueUpdateTime}() function. The default interval is 90 seconds. -- +-- An SRS Setup-Guide can be found here: [Moose TTS Setup Guide](https://github.com/FlightControl-Master/MOOSE_GUIDES/blob/master/documents/Moose%20TTS%20Setup%20Guide.pdf) +-- -- # Examples -- -- ## Caucasus: Batumi diff --git a/Moose Development/Moose/Tasking/CommandCenter.lua b/Moose Development/Moose/Tasking/CommandCenter.lua index 6562fcb90..8af4786bc 100644 --- a/Moose Development/Moose/Tasking/CommandCenter.lua +++ b/Moose Development/Moose/Tasking/CommandCenter.lua @@ -512,7 +512,7 @@ function COMMANDCENTER:AssignTask( TaskGroup ) if Task then - self:I( "Assigning task " .. Task:GetName() .. " using auto assign method " .. self.AutoAssignMethod .. " to " .. TaskGroup:GetName() .. " with task priority " .. AssignPriority ) + self:T( "Assigning task " .. Task:GetName() .. " using auto assign method " .. self.AutoAssignMethod .. " to " .. TaskGroup:GetName() .. " with task priority " .. AssignPriority ) if not self.AutoAcceptTasks == true then Task:SetAutoAssignMethod( ACT_ASSIGN_MENU_ACCEPT:New( Task.TaskBriefing ) ) diff --git a/Moose Development/Moose/Tasking/Mission.lua b/Moose Development/Moose/Tasking/Mission.lua index ba84fe162..b0f39072f 100644 --- a/Moose Development/Moose/Tasking/Mission.lua +++ b/Moose Development/Moose/Tasking/Mission.lua @@ -413,7 +413,7 @@ end -- @param Wrapper.Group#GROUP PlayerGroup The GROUP of the player joining the Mission. -- @return #boolean true if Unit is part of a Task in the Mission. function MISSION:JoinUnit( PlayerUnit, PlayerGroup ) - self:I( { Mission = self:GetName(), PlayerUnit = PlayerUnit, PlayerGroup = PlayerGroup } ) + self:T( { Mission = self:GetName(), PlayerUnit = PlayerUnit, PlayerGroup = PlayerGroup } ) local PlayerUnitAdded = false @@ -571,7 +571,7 @@ do -- Group Assignment local MissionGroupName = MissionGroup:GetName() self.AssignedGroups[MissionGroupName] = MissionGroup - self:I( string.format( "Mission %s is assigned to %s", MissionName, MissionGroupName ) ) + self:T( string.format( "Mission %s is assigned to %s", MissionName, MissionGroupName ) ) return self end @@ -698,7 +698,7 @@ end function MISSION:AddTask( Task ) local TaskName = Task:GetTaskName() - self:I( { "==> Adding TASK ", MissionName = self:GetName(), TaskName = TaskName } ) + self:T( { "==> Adding TASK ", MissionName = self:GetName(), TaskName = TaskName } ) self.Tasks[TaskName] = Task @@ -717,7 +717,7 @@ end function MISSION:RemoveTask( Task ) local TaskName = Task:GetTaskName() - self:I( { "<== Removing TASK ", MissionName = self:GetName(), TaskName = TaskName } ) + self:T( { "<== Removing TASK ", MissionName = self:GetName(), TaskName = TaskName } ) self:F( TaskName ) self.Tasks[TaskName] = self.Tasks[TaskName] or { n = 0 } diff --git a/Moose Development/Moose/Utilities/Utils.lua b/Moose Development/Moose/Utilities/Utils.lua index df656431b..dd073f753 100644 --- a/Moose Development/Moose/Utilities/Utils.lua +++ b/Moose Development/Moose/Utilities/Utils.lua @@ -1576,6 +1576,8 @@ function UTILS.GMTToLocalTimeDifference() return 3 -- Damascus is UTC+3 hours elseif theatre==DCSMAP.MarianaIslands then return 10 -- Guam is UTC+10 hours. + elseif theatre==DCSMAP.Falklands then + return -3 -- Fireland is UTC-3 hours. else BASE:E(string.format("ERROR: Unknown Map %s in UTILS.GMTToLocal function. Returning 0", tostring(theatre))) return 0 diff --git a/Moose Development/Moose/Wrapper/Controllable.lua b/Moose Development/Moose/Wrapper/Controllable.lua index 95c8c4ade..5cf5b4ac2 100644 --- a/Moose Development/Moose/Wrapper/Controllable.lua +++ b/Moose Development/Moose/Wrapper/Controllable.lua @@ -2395,7 +2395,7 @@ do -- Route methods -- @return DCS#Task Task. -- @return #boolean If true, path on road is possible. If false, task will route the group directly to its destination. function CONTROLLABLE:TaskGroundOnRoad( ToCoordinate, Speed, OffRoadFormation, Shortcut, FromCoordinate, WaypointFunction, WaypointFunctionArguments ) - self:I( { ToCoordinate = ToCoordinate, Speed = Speed, OffRoadFormation = OffRoadFormation, WaypointFunction = WaypointFunction, Args = WaypointFunctionArguments } ) + self:T( { ToCoordinate = ToCoordinate, Speed = Speed, OffRoadFormation = OffRoadFormation, WaypointFunction = WaypointFunction, Args = WaypointFunctionArguments } ) -- Defaults. Speed = Speed or 20 From 53d71d976678af6dbc7cac5846c721bb0f8ff624 Mon Sep 17 00:00:00 2001 From: Thomas <72444570+Applevangelist@users.noreply.github.com> Date: Mon, 28 Nov 2022 17:42:09 +0100 Subject: [PATCH 06/11] Update RAT.lua Fix #1848 --- Moose Development/Moose/Functional/RAT.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Moose Development/Moose/Functional/RAT.lua b/Moose Development/Moose/Functional/RAT.lua index 0643cf01b..a54533eeb 100644 --- a/Moose Development/Moose/Functional/RAT.lua +++ b/Moose Development/Moose/Functional/RAT.lua @@ -5671,6 +5671,9 @@ function RAT:_ATCClearForLanding(airport, flight) -- Debug message. local text1=string.format("ATC %s: Flight %s cleared for landing (flag=%d).", airport, flight, flagvalue) + if string.find(flight,"#") then + flight = string.match(flight,"^(.+)#") + end local text2=string.format("ATC %s: Flight %s you are cleared for landing.", airport, flight) BASE:T( RAT.id..text1) MESSAGE:New(text2, 10):ToAllIf(RAT.ATC.messages) @@ -5713,6 +5716,9 @@ function RAT:_ATCFlightLanded(name) local text1=string.format("ATC %s: Flight %s landed. Tholding = %i:%02d, Tfinal = %i:%02d.", dest, name, Thold/60, Thold%60, Tfinal/60, Tfinal%60) local text2=string.format("ATC %s: Number of flights still on final %d.", dest, RAT.ATC.airport[dest].Nonfinal) local text3=string.format("ATC %s: Traffic report: Number of planes landed in total %d. Flights/hour = %3.2f.", dest, RAT.ATC.airport[dest].traffic, TrafficPerHour) + if string.find(name,"#") then + name = string.match(name,"^(.+)#") + end local text4=string.format("ATC %s: Flight %s landed. Welcome to %s.", dest, name, dest) BASE:T(RAT.id..text1) BASE:T(RAT.id..text2) From 75bc95167f2b051227372443b418c3c21fdff6c6 Mon Sep 17 00:00:00 2001 From: Thomas <72444570+Applevangelist@users.noreply.github.com> Date: Mon, 28 Nov 2022 17:45:47 +0100 Subject: [PATCH 07/11] Update RAT.lua (#1849) Fix #1848 --- Moose Development/Moose/Functional/RAT.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Moose Development/Moose/Functional/RAT.lua b/Moose Development/Moose/Functional/RAT.lua index 0643cf01b..a54533eeb 100644 --- a/Moose Development/Moose/Functional/RAT.lua +++ b/Moose Development/Moose/Functional/RAT.lua @@ -5671,6 +5671,9 @@ function RAT:_ATCClearForLanding(airport, flight) -- Debug message. local text1=string.format("ATC %s: Flight %s cleared for landing (flag=%d).", airport, flight, flagvalue) + if string.find(flight,"#") then + flight = string.match(flight,"^(.+)#") + end local text2=string.format("ATC %s: Flight %s you are cleared for landing.", airport, flight) BASE:T( RAT.id..text1) MESSAGE:New(text2, 10):ToAllIf(RAT.ATC.messages) @@ -5713,6 +5716,9 @@ function RAT:_ATCFlightLanded(name) local text1=string.format("ATC %s: Flight %s landed. Tholding = %i:%02d, Tfinal = %i:%02d.", dest, name, Thold/60, Thold%60, Tfinal/60, Tfinal%60) local text2=string.format("ATC %s: Number of flights still on final %d.", dest, RAT.ATC.airport[dest].Nonfinal) local text3=string.format("ATC %s: Traffic report: Number of planes landed in total %d. Flights/hour = %3.2f.", dest, RAT.ATC.airport[dest].traffic, TrafficPerHour) + if string.find(name,"#") then + name = string.match(name,"^(.+)#") + end local text4=string.format("ATC %s: Flight %s landed. Welcome to %s.", dest, name, dest) BASE:T(RAT.id..text1) BASE:T(RAT.id..text2) From df0c0ec21e7a58afa830d748fb5ef8fe25e9dd11 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Tue, 29 Nov 2022 15:39:58 +0100 Subject: [PATCH 08/11] #CTLD * Small fix for BEACON Zones --- Moose Development/Moose/Ops/CTLD.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Moose Development/Moose/Ops/CTLD.lua b/Moose Development/Moose/Ops/CTLD.lua index 0a7c38665..e370b430e 100644 --- a/Moose Development/Moose/Ops/CTLD.lua +++ b/Moose Development/Moose/Ops/CTLD.lua @@ -22,7 +22,7 @@ -- @module Ops.CTLD -- @image OPS_CTLD.jpg --- Last Update October 2022 +-- Last Update December 2022 do @@ -1078,7 +1078,7 @@ CTLD.UnitTypes = { --- CTLD class version. -- @field #string version -CTLD.version="1.0.19" +CTLD.version="1.0.20" --- Instantiate a new CTLD. -- @param #CTLD self @@ -3611,7 +3611,8 @@ function CTLD:CheckDroppedBeacons() for _,_beacon in pairs (self.droppedBeacons) do local beacon = _beacon -- #CTLD.CargoZone - local T0 = beacon.timestamp + if not beacon.timestamp then beacon.timestamp = timer.getTime() end + local T0 = beacon.timestamp if timer.getTime() - T0 > timeout then local name = beacon.name self.droppedbeaconref[name] = nil From d674f5534326256f4915cd13a6a39011de7ded3b Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Tue, 29 Nov 2022 15:42:04 +0100 Subject: [PATCH 09/11] #PLAYERTASK * Added Silent option for PLAYERTASKCONTROLLER:AddPlayerTaskToQueue(PlayerTask,Silent) --- Moose Development/Moose/Ops/PlayerTask.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Moose Development/Moose/Ops/PlayerTask.lua b/Moose Development/Moose/Ops/PlayerTask.lua index c4deae952..2c6f3a75f 100644 --- a/Moose Development/Moose/Ops/PlayerTask.lua +++ b/Moose Development/Moose/Ops/PlayerTask.lua @@ -1409,7 +1409,7 @@ PLAYERTASKCONTROLLER.Messages = { --- PLAYERTASK class version. -- @field #string version -PLAYERTASKCONTROLLER.version="0.1.49" +PLAYERTASKCONTROLLER.version="0.1.50" --- Create and run a new TASKCONTROLLER instance. -- @param #PLAYERTASKCONTROLLER self @@ -2651,6 +2651,7 @@ end --- [User] Add a PLAYERTASK object to the list of (open) tasks -- @param #PLAYERTASKCONTROLLER self -- @param Ops.PlayerTask#PLAYERTASK PlayerTask +-- @param #boolean Silent If true, make no "has new task" announcement -- @return #PLAYERTASKCONTROLLER self -- @usage -- Example to create a PLAYERTASK of type CTLD and give Players 10 minutes to complete: @@ -2671,13 +2672,15 @@ end -- ) -- -- taskmanager:AddPlayerTaskToQueue(PlayerTask) -function PLAYERTASKCONTROLLER:AddPlayerTaskToQueue(PlayerTask) +function PLAYERTASKCONTROLLER:AddPlayerTaskToQueue(PlayerTask,Silent) self:T(self.lid.."AddPlayerTaskToQueue") if PlayerTask and PlayerTask.ClassName and PlayerTask.ClassName == "PLAYERTASK" then PlayerTask:_SetController(self) PlayerTask:SetCoalition(self.Coalition) self.TaskQueue:Push(PlayerTask) - self:__TaskAdded(10,PlayerTask) + if not Silent then + self:__TaskAdded(10,PlayerTask) + end else self:E(self.lid.."***** NO valid PAYERTASK object sent!") end From df2a6a6902eb790516cb0fe8e2b395e1c61f82e8 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Tue, 29 Nov 2022 17:53:41 +0100 Subject: [PATCH 10/11] #ATIS * Added `ATIS:GetSRSText()` --- Moose Development/Moose/Ops/ATIS.lua | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Moose Development/Moose/Ops/ATIS.lua b/Moose Development/Moose/Ops/ATIS.lua index 9cdf60ec3..d4c20f948 100644 --- a/Moose Development/Moose/Ops/ATIS.lua +++ b/Moose Development/Moose/Ops/ATIS.lua @@ -93,6 +93,7 @@ -- @field #number dTQueueCheck Time interval to check the radio queue. Default 5 sec or 90 sec if SRS is used. -- @field #boolean ReportmBar Report mBar/hpa even if not metric, i.e. for Mirage flights -- @field #boolean TransmitOnlyWithPlayers For SRS - If true, only transmit if there are alive Players. +-- @field #string SRSText Text of the complete SRS message (if done at least once, else nil) -- @extends Core.Fsm#FSM --- *It is a very sad thing that nowadays there is so little useless information.* - Oscar Wilde @@ -592,7 +593,7 @@ _ATIS = {} --- ATIS class version. -- @field #string version -ATIS.version = "0.9.11" +ATIS.version = "0.9.12" ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- TODO list @@ -880,6 +881,13 @@ function ATIS:SetMapMarks( switch ) return self end +--- Return the complete SRS Text block, if at least generated once. Else nil. +-- @param #ATIS self +-- @return #string SRSText +function ATIS:GetSRSText() + return self.SRSText +end + --- Set magnetic runway headings as depicted on the runway, *e.g.* "13" for 130° or "25L" for the left runway with magnetic heading 250°. -- @param #ATIS self -- @param #table headings Magnetic headings. Inverse (-180°) headings are added automatically. You only need to specify one heading per runway direction. "L"eft and "R" right can also be appended. @@ -2402,7 +2410,8 @@ function ATIS:onafterReport( From, Event, To, Text ) local duration = STTS.getSpeechTime(text,0.95) self.msrsQ:NewTransmission(text,duration,self.msrs,nil,2) --self.msrs:PlayText( text ) - + self.SRSText = text + end end From f17f688a2035a0b439a06b8bbd4222ed72be935e Mon Sep 17 00:00:00 2001 From: Frank Date: Wed, 30 Nov 2022 18:37:14 +0100 Subject: [PATCH 11/11] Condition and Message --- Moose Development/Moose/Core/Condition.lua | 72 +++++++++++++++++++++- Moose Development/Moose/Core/Message.lua | 10 +++ 2 files changed, 81 insertions(+), 1 deletion(-) diff --git a/Moose Development/Moose/Core/Condition.lua b/Moose Development/Moose/Core/Condition.lua index 8d9824a72..80f80cf52 100644 --- a/Moose Development/Moose/Core/Condition.lua +++ b/Moose Development/Moose/Core/Condition.lua @@ -23,6 +23,7 @@ -- @type CONDITION -- @field #string ClassName Name of the class. -- @field #string lid Class id string for output to DCS log file. +-- @field #string name Name of the condition. -- @field #boolean isAny General functions are evaluated as any condition. -- @field #boolean negateResult Negeate result of evaluation. -- @field #table functionsGen General condition functions. @@ -55,7 +56,7 @@ CONDITION = { --- CONDITION class version. -- @field #string version -CONDITION.version="0.1.0" +CONDITION.version="0.2.0" ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- TODO list @@ -206,6 +207,10 @@ function CONDITION:Evaluate(AnyTrue) return result end +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +-- Private Functions +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + --- Check if all given condition are true. -- @param #CONDITION self -- @param #table functions Functions to evaluate. @@ -290,6 +295,71 @@ function CONDITION:_CreateCondition(Function, ...) return condition end + +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +-- Global Condition Functions +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +--- Condition to check if time is greater than a given threshold time. +-- @param #number Time Time in seconds. +-- @param #boolean Absolute If `true`, abs. mission time from `timer.getAbsTime()` is checked. Default is relative mission time from `timer.getTime()`. +-- @return #boolean Returns `true` if time is greater than give the time. +function CONDITION.IsTimeGreater(Time, Absolute) + + local Tnow=nil + + if Absolute then + Tnow=timer.getAbsTime() + else + Tnow=timer.getTime() + end + + if Tnow>Time then + return true + else + return false + end + + return nil +end + +--- Function that returns `true` (success) with a certain probability. For example, if you specify `Probability=80` there is an 80% chance that `true` is returned. +-- Technically, a random number between 0 and 100 is created. If the given success probability is less then this number, `true` is returned. +-- @param #number Probability Success probability in percent. Default 50 %. +-- @return #boolean Returns `true` for success and `false` otherwise. +function CONDITION.IsRandomSuccess(Probability) + + Probability=Probability or 50 + + -- Create some randomness. + math.random() + math.random() + math.random() + + -- Number between 0 and 100. + local N=math.random()*100 + + if N