mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Compare commits
9 Commits
2.9.13
...
bd054b26c0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bd054b26c0 | ||
|
|
f094716b73 | ||
|
|
b3100d2f5e | ||
|
|
4b1888a34d | ||
|
|
f4cd214823 | ||
|
|
b9be3aa7f8 | ||
|
|
bb6db2b7f8 | ||
|
|
fd2dacaefb | ||
|
|
cc60e85901 |
@@ -33,7 +33,7 @@
|
||||
-- - @module Functional.Tiresias
|
||||
-- - @image Functional.Tiresias.jpg
|
||||
|
||||
--- Last Update: Dec 2023 (Optimized July 2025)
|
||||
--- Last Update: July 2025
|
||||
|
||||
--- **TIRESIAS** class, extends Core.Base#BASE
|
||||
-- @type TIRESIAS
|
||||
@@ -55,6 +55,7 @@
|
||||
-- @field #boolean SwitchAAA
|
||||
-- @field #string lid
|
||||
-- @field #table _cached_zones
|
||||
-- @field #table _cached_groupsets
|
||||
-- @extends Core.Fsm#FSM
|
||||
|
||||
---
|
||||
@@ -104,7 +105,7 @@
|
||||
TIRESIAS = {
|
||||
ClassName = "TIRESIAS",
|
||||
debug = true,
|
||||
version = " 0.0.6-OPT" ,
|
||||
version = " 0.0.7-OPT" ,
|
||||
Interval = 20,
|
||||
GroundSet = nil,
|
||||
VehicleSet = nil,
|
||||
@@ -116,6 +117,7 @@ TIRESIAS = {
|
||||
PlaneSwitchRange = 25, -- NM
|
||||
SwitchAAA = true,
|
||||
_cached_zones = {}, -- Cache for zone objects
|
||||
_cached_groupsets = {}, -- Cache for group_set objects
|
||||
}
|
||||
|
||||
---
|
||||
@@ -418,6 +420,7 @@ function TIRESIAS:_SwitchOnGroups(group, radius)
|
||||
local group_name = group:GetName()
|
||||
local cache_key = group_name .. " _" .. radius
|
||||
local zone = self._cached_zones[cache_key]
|
||||
local ground = self._cached_groupsets[cache_key]
|
||||
|
||||
if not zone then
|
||||
zone = ZONE_GROUP:New(" Zone-" .. group_name, group, UTILS.NMToMeters(radius))
|
||||
@@ -427,7 +430,13 @@ function TIRESIAS:_SwitchOnGroups(group, radius)
|
||||
zone:UpdateFromGroup(group)
|
||||
end
|
||||
|
||||
local ground = SET_GROUP:New():FilterCategoryGround():FilterZones({zone}):FilterOnce()
|
||||
if not ground then
|
||||
ground = SET_GROUP:New():FilterCategoryGround():FilterZones({zone}):FilterOnce()
|
||||
self._cached_groupsets[cache_key] = ground
|
||||
else
|
||||
ground:FilterZones({zone},true):FilterOnce()
|
||||
end
|
||||
|
||||
local count = ground:CountAlive()
|
||||
|
||||
if self.debug then
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -867,6 +867,7 @@ do
|
||||
-- my_ctld.TroopUnloadDistHoverHook = 5 -- When hovering, unload troops this far behind the Chinook
|
||||
-- my_ctld.showstockinmenuitems = false -- When set to true, the menu lines will also show the remaining items in stock (that is, if you set any), downside is that the menu for all will be build every 30 seconds anew.
|
||||
-- my_ctld.onestepmenu = false -- When set to true, the menu will create Drop and build, Get and load, Pack and remove, Pack and load, Pack. it will be a 1 step solution.
|
||||
-- my_ctld.VehicleMoveFormation = AI.Task.VehicleFormation.VEE -- When a group moves to a MOVE zone, then it takes this formation. Can be a table of formations, which are then randomly chosen. Defaults to "Vee".
|
||||
--
|
||||
-- ## 2.1 CH-47 Chinook support
|
||||
--
|
||||
@@ -1294,6 +1295,7 @@ CTLD = {
|
||||
LoadedGroupsTable = {},
|
||||
keeploadtable = true,
|
||||
allowCATransport = false,
|
||||
VehicleMoveFormation = AI.Task.VehicleFormation.VEE,
|
||||
}
|
||||
|
||||
------------------------------
|
||||
@@ -1414,7 +1416,7 @@ CTLD.FixedWingTypes = {
|
||||
|
||||
--- CTLD class version.
|
||||
-- @field #string version
|
||||
CTLD.version="1.3.36"
|
||||
CTLD.version="1.3.37"
|
||||
|
||||
--- Instantiate a new CTLD.
|
||||
-- @param #CTLD self
|
||||
@@ -1554,6 +1556,8 @@ function CTLD:New(Coalition, Prefixes, Alias)
|
||||
self.movetroopsdistance = 5000
|
||||
self.troopdropzoneradius = 100
|
||||
|
||||
self.VehicleMoveFormation = AI.Task.VehicleFormation.VEE
|
||||
|
||||
-- added support Hercules Mod
|
||||
self.enableHercules = false -- deprecated
|
||||
self.enableFixedWing = false
|
||||
@@ -4197,6 +4201,17 @@ function CTLD:_BuildObjectFromCrates(Group,Unit,Build,Repair,RepairLocation,Mult
|
||||
return self
|
||||
end
|
||||
|
||||
--- (Internal) Function to get a vehicle formation for a moving group
|
||||
-- @param #CTLD self
|
||||
-- @return #string Formation
|
||||
function CTLD:_GetVehicleFormation()
|
||||
local VehicleMoveFormation = self.VehicleMoveFormation or AI.Task.VehicleFormation.VEE
|
||||
if type(self.VehicleMoveFormation)=="table" then
|
||||
VehicleMoveFormation = self.VehicleMoveFormation[math.random(1,#self.VehicleMoveFormation)]
|
||||
end
|
||||
return VehicleMoveFormation
|
||||
end
|
||||
|
||||
--- (Internal) Function to move group to WP zone.
|
||||
-- @param #CTLD self
|
||||
-- @param Wrapper.Group#GROUP Group The Group to move.
|
||||
@@ -4211,18 +4226,20 @@ function CTLD:_MoveGroupToZone(Group)
|
||||
-- yes, we can ;)
|
||||
local groupname = Group:GetName()
|
||||
local zonecoord = zone:GetRandomCoordinate(20,125) -- Core.Point#COORDINATE
|
||||
local coordinate = zonecoord:GetVec2()
|
||||
local formation = self:_GetVehicleFormation()
|
||||
--local coordinate = zonecoord:GetVec2()
|
||||
Group:SetAIOn()
|
||||
Group:OptionAlarmStateAuto()
|
||||
Group:OptionDisperseOnAttack(30)
|
||||
Group:OptionROEOpenFirePossible()
|
||||
Group:RouteToVec2(coordinate,5)
|
||||
Group:OptionROEOpenFireWeaponFree()
|
||||
Group:RouteGroundTo(zonecoord,5,formation)
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
--- (Internal) Housekeeping - Cleanup crates when build
|
||||
-- @param #CTLD self
|
||||
--
|
||||
-- @param #table Crates Table of #CTLD_CARGO objects near the unit.
|
||||
-- @param #CTLD.Buildable Build Table build object.
|
||||
-- @param #number Number Number of objects in Crates (found) to limit search.
|
||||
@@ -7134,6 +7151,16 @@ end
|
||||
local filepath = self.filepath
|
||||
self:__Save(interval,filepath,filename)
|
||||
end
|
||||
|
||||
if type(self.VehicleMoveFormation) == "table" then
|
||||
local Formations = {}
|
||||
for _,_formation in pairs(self.VehicleMoveFormation) do
|
||||
table.insert(Formations,_formation)
|
||||
end
|
||||
self.VehicleMoveFormation = nil
|
||||
self.VehicleMoveFormation = Formations
|
||||
end
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
@@ -4620,6 +4620,24 @@ function UTILS.ShowPicture(FileName, Duration, ClearView, StartDelay, Horizontal
|
||||
net.dostring_in("mission", string.format("a_out_picture(getValueResourceByKey(\"%s\"), %d, %s, %d, \"%d\", \"%d\", %d, \"%d\")", FileName, Duration or 10, ClearView, StartDelay, HorizontalAlign, VerticalAlign, Size, SizeUnits))
|
||||
end
|
||||
|
||||
--- Load a mission file. This will replace the current mission with the one given carrying along the online clients.
|
||||
-- @param #string FileName Mission filename
|
||||
function UTILS.LoadMission(FileName)
|
||||
net.dostring_in("mission", string.format("a_load_mission(\"%s\")", FileName))
|
||||
end
|
||||
|
||||
--- Set the mission briefing for a coalition.
|
||||
-- @param #number Coalition Briefing coalition ID, can be coalition.side.BLUE, coalition.side.RED or coalition.side.NEUTRAL
|
||||
-- @param #string Text Briefing text, can contain newlines, will be converted formatted properly for DCS
|
||||
-- @param #string Picture Picture filename, can be a file in the DEFAULT folder inside the .miz
|
||||
function UTILS.SetMissionBriefing(Coalition, Text, Picture)
|
||||
Text = Text or ""
|
||||
Text = Text:gsub("\n", "\\n")
|
||||
Picture = Picture or ""
|
||||
local coalName = string.lower(UTILS.GetCoalitionName(Coalition))
|
||||
net.dostring_in("mission", string.format("a_set_briefing(\"%s\", getValueResourceByKey(\"%s\"), \"%s\")", coalName, Picture, Text))
|
||||
end
|
||||
|
||||
--- Show a helper gate at a DCS#Vec3 position
|
||||
-- @param DCS#Vec3 pos The position
|
||||
-- @param number heading Heading in degrees, can be 0..359 degrees
|
||||
|
||||
Reference in New Issue
Block a user