static spawn change (#47)
This commit is contained in:
Binary file not shown.
+25
-19
@@ -455,7 +455,15 @@ do -- INIT DCS_UTIL
|
|||||||
group_template
|
group_template
|
||||||
}
|
}
|
||||||
]] --
|
]] --
|
||||||
|
|
||||||
|
---@class MizGroupData
|
||||||
|
---@field category GroupCategory
|
||||||
|
---@field country_id integer
|
||||||
|
---@field group_template table
|
||||||
|
|
||||||
|
---@type table<string, MizGroupData>
|
||||||
DCS_UTIL.__miz_groups = {}
|
DCS_UTIL.__miz_groups = {}
|
||||||
|
|
||||||
DCS_UTIL.__groupNames = {}
|
DCS_UTIL.__groupNames = {}
|
||||||
DCS_UTIL.__blueGroupNames = {}
|
DCS_UTIL.__blueGroupNames = {}
|
||||||
DCS_UTIL.__redGroupNames = {}
|
DCS_UTIL.__redGroupNames = {}
|
||||||
@@ -499,6 +507,7 @@ do -- INIT DCS_UTIL
|
|||||||
Polygon = 2
|
Polygon = 2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
---@enum SpearheadGroupCategory
|
||||||
DCS_UTIL.GroupCategory = {
|
DCS_UTIL.GroupCategory = {
|
||||||
AIRPLANE = 0,
|
AIRPLANE = 0,
|
||||||
HELICOPTER = 1,
|
HELICOPTER = 1,
|
||||||
@@ -533,25 +542,14 @@ do -- INIT DCS_UTIL
|
|||||||
if category_id == DCS_UTIL.GroupCategory.STATIC then
|
if category_id == DCS_UTIL.GroupCategory.STATIC then
|
||||||
local unit = group.units[1]
|
local unit = group.units[1]
|
||||||
|
|
||||||
if unit.category == "Heliports" then
|
if unit and unit.category == "Heliports" then
|
||||||
|
skippable = true
|
||||||
|
elseif unit then
|
||||||
|
name = unit.name
|
||||||
|
else
|
||||||
|
env.error("Group " .. name .. " has no units, skipping it.")
|
||||||
skippable = true
|
skippable = true
|
||||||
end
|
end
|
||||||
|
|
||||||
name = unit.name
|
|
||||||
local staticObj = {
|
|
||||||
heading = unit.heading,
|
|
||||||
name = unit.name,
|
|
||||||
x = unit.x,
|
|
||||||
y = unit.y,
|
|
||||||
type = unit.type,
|
|
||||||
dead = group.dead
|
|
||||||
}
|
|
||||||
|
|
||||||
if unit and unit.category and string.lower(unit.category) == "planes" then
|
|
||||||
staticObj.livery_id = unit.livery_id
|
|
||||||
end
|
|
||||||
|
|
||||||
group = staticObj
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if skippable == false then
|
if skippable == false then
|
||||||
@@ -708,7 +706,7 @@ do -- INIT DCS_UTIL
|
|||||||
---@param groupName string
|
---@param groupName string
|
||||||
function DCS_UTIL.IsGroupStatic(groupName)
|
function DCS_UTIL.IsGroupStatic(groupName)
|
||||||
if DCS_UTIL.__miz_groups[groupName] then
|
if DCS_UTIL.__miz_groups[groupName] then
|
||||||
return DCS_UTIL.__miz_groups[groupName].category == 5;
|
return DCS_UTIL.__miz_groups[groupName].category == DCS_UTIL.GroupCategory.STATIC;
|
||||||
end
|
end
|
||||||
|
|
||||||
return StaticObject.getByName(groupName) ~= nil
|
return StaticObject.getByName(groupName) ~= nil
|
||||||
@@ -1272,7 +1270,15 @@ do -- INIT DCS_UTIL
|
|||||||
--TODO: Implement location and route stuff
|
--TODO: Implement location and route stuff
|
||||||
local spawn_template = template.group_template
|
local spawn_template = template.group_template
|
||||||
local country = countryId or template.country_id
|
local country = countryId or template.country_id
|
||||||
return coalition.addStaticObject(country, spawn_template), true
|
|
||||||
|
---disable diagnostic as -1 is actually valid
|
||||||
|
---@diagnostic disable-next-line: param-type-mismatch
|
||||||
|
coalition.addGroup(country, -1, spawn_template)
|
||||||
|
|
||||||
|
local object = StaticObject.getByName(spawn_template.name)
|
||||||
|
if object then
|
||||||
|
return object, true
|
||||||
|
end
|
||||||
else
|
else
|
||||||
local spawn_template = template.group_template
|
local spawn_template = template.group_template
|
||||||
if location ~= nil then
|
if location ~= nil then
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
--Single player purpose
|
--Single player purpose
|
||||||
|
|
||||||
local defaultLogLevel = "INFO"
|
local defaultLogLevel = "INFO"
|
||||||
@@ -53,8 +52,8 @@ Spearhead.LoadingDone()
|
|||||||
|
|
||||||
Spearhead.internal.GlobalStageManager:printFullOverview()
|
Spearhead.internal.GlobalStageManager:printFullOverview()
|
||||||
|
|
||||||
--Check lines of code in directory per file:
|
--Check lines of code in directory per file:
|
||||||
-- Get-ChildItem . -Include *.lua -Recurse | foreach {""+(Get-Content $_).Count + " => " + $_.name }; GCI . -Include *.lua* -Recurse | foreach{(GC $_).Count} | measure-object -sum | % Sum
|
-- Get-ChildItem . -Include *.lua -Recurse | foreach {""+(Get-Content $_).Count + " => " + $_.name }; GCI . -Include *.lua* -Recurse | foreach{(GC $_).Count} | measure-object -sum | % Sum
|
||||||
-- find . -name '*.lua' | xargs wc -l
|
-- find . -name '*.lua' | xargs wc -l
|
||||||
|
|
||||||
--- ==================== DEBUG ORDER OR ZONE VEC ===========================
|
--- ==================== DEBUG ORDER OR ZONE VEC ===========================
|
||||||
@@ -68,7 +67,7 @@ Spearhead.internal.GlobalStageManager:printFullOverview()
|
|||||||
-- local b = zone.verts[i+1]
|
-- local b = zone.verts[i+1]
|
||||||
|
|
||||||
-- local color = {0,0,0,1}
|
-- local color = {0,0,0,1}
|
||||||
|
|
||||||
-- color[i] = 1
|
-- color[i] = 1
|
||||||
|
|
||||||
-- trigger.action.textToAll(-1, 46+i , { x= a.x, y = 0, z = a.z } , color, {0,0,0}, 24 , true , "" .. i )
|
-- trigger.action.textToAll(-1, 46+i , { x= a.x, y = 0, z = a.z } , color, {0,0,0}, 24 , true , "" .. i )
|
||||||
|
|||||||
Reference in New Issue
Block a user