@jtff/miztemplate-lib 3.4.12 → 3.4.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -846,22 +846,33 @@ function SpawnRanges(param)
846
846
  elseif (staticToSpawn.type ~= nil and staticToSpawn.category ~= nil) then
847
847
  local staticTypeToSpawn = string.format("%s", staticToSpawn.type)
848
848
  local staticCategoryToSpawn = string.format("%s", staticToSpawn.category)
849
- spawnStatic = SPAWNSTATIC:NewFromType(staticTypeToSpawn, staticCategoryToSpawn)
850
- if (staticToSpawn.coalition ~= nil) then
851
- if (staticToSpawn.coalition == coalition.side.BLUE) then
852
- spawnStatic = SPAWNSTATIC:NewFromType(staticTypeToSpawn, staticCategoryToSpawn, country.id.CJTF_BLUE)
853
- elseif (staticToSpawn.coalition == coalition.side.RED) then
854
- spawnStatic = SPAWNSTATIC:NewFromType(staticTypeToSpawn, staticCategoryToSpawn, country.id.CJTF_RED)
855
- else
856
- spawnStatic = SPAWNSTATIC:NewFromType(staticTypeToSpawn, staticCategoryToSpawn, country.id.UN_PEACEKEEPERS)
857
- end
858
- end
859
849
  local x = staticToSpawn.x
860
850
  local y = staticToSpawn.y
861
- local heading = staticToSpawn.heading
862
- local name = string.format("%s_%s_%i", subRangeName, staticTypeToSpawn, index)
863
- local static = spawnStatic:SpawnFromPointVec2( POINT_VEC2:New( x, y ), heading, name )
864
- jtff_log.info(string.format("Static type to spawn %s at %i,%i -> %s", static:GetDCSObject():getTypeName(), x, y, static:GetDCSObject():getName()),"RANGE")
851
+ --spawnStatic = SPAWNSTATIC:NewFromType(staticTypeToSpawn, staticCategoryToSpawn)
852
+ if (staticToSpawn.type == "big_smoke" and staticToSpawn.category == "Effects") then
853
+ local landAltitude = POINT_VEC2:New( x, y ):GetAlt()
854
+ trigger.action.effectSmokeBig({ x = x, y = landAltitude, z = y}, 1, 1)
855
+ else
856
+ if (staticToSpawn.coalition ~= nil) then
857
+ if (staticToSpawn.coalition == coalition.side.BLUE) then
858
+ spawnStatic = SPAWNSTATIC:NewFromType(staticTypeToSpawn, staticCategoryToSpawn, country.id.CJTF_BLUE)
859
+ elseif (staticToSpawn.coalition == coalition.side.RED) then
860
+ spawnStatic = SPAWNSTATIC:NewFromType(staticTypeToSpawn, staticCategoryToSpawn, country.id.CJTF_RED)
861
+ else
862
+ spawnStatic = SPAWNSTATIC:NewFromType(staticTypeToSpawn, staticCategoryToSpawn, country.id.UN_PEACEKEEPERS)
863
+ end
864
+ end
865
+ local heading = staticToSpawn.heading
866
+ local name = string.format("%s_%s_%i", subRangeName, staticTypeToSpawn, index)
867
+ if (staticToSpawn.shape_name ~= nil) then
868
+ spawnStatic:InitShape(staticToSpawn.shape_name)
869
+ end
870
+ if (staticToSpawn.dead ~= nil) then
871
+ spawnStatic:InitDead(staticToSpawn.dead)
872
+ end
873
+ local static = spawnStatic:SpawnFromPointVec2( POINT_VEC2:New( x, y ), heading, name )
874
+ jtff_log.info(string.format("Static type to spawn %s at %i,%i -> %s", static:GetDCSObject():getTypeName(), x, y, static:GetDCSObject():getName()),"RANGE")
875
+ end
865
876
  else
866
877
  jtff_log.warn(string.format("Static to spawn has no name or type!"),"RANGE")
867
878
  end
@@ -7,6 +7,7 @@ end
7
7
 
8
8
  function wipeCapWarZone(objCapWarZone)
9
9
  jtff_log.info(string.format("%s Zone Stopping...", objCapWarZone.customconfig.name),"CAP_WAR_ZONE")
10
+ --TODO: remove all drawings generated by CAPSquadrons
10
11
  objCapWarZone.objDispatcher:SetTacticalDisplay(false)
11
12
  objCapWarZone.objDispatcher:Stop()
12
13
  objCapWarZone.objDispatcher = nil
@@ -113,6 +114,49 @@ function startCapWarZone(objCapWarZone)
113
114
  CapZoneName = "unknown"
114
115
  end
115
116
  end
117
+ if objCapWarZone.customconfig.coalitionCAP == coalition.side.RED then
118
+ CapZone:DrawZone(
119
+ coalition.side.BLUE,
120
+ {1,0,1},
121
+ 1,
122
+ {1,0,1},
123
+ 0.10,
124
+ 4,
125
+ true,
126
+ nil
127
+ )
128
+ CapZone:GetCoordinate():TextToAll(
129
+ "CAP Warzone " .. objCapWarZone.customconfig.name,
130
+ coalition.side.BLUE,
131
+ {1,0,0},
132
+ 1,
133
+ {1,0,0},
134
+ 0,
135
+ 20,
136
+ true
137
+ )
138
+ else
139
+ CapZone:DrawZone(
140
+ coalition.side.RED,
141
+ {1,0,1},
142
+ 1,
143
+ {1,0,1},
144
+ 0.10,
145
+ 4,
146
+ true,
147
+ nil
148
+ )
149
+ CapZone:GetCoordinate():TextToAll(
150
+ "CAP Warzone " .. objCapWarZone.customconfig.name,
151
+ coalition.side.RED,
152
+ {1,0,0},
153
+ 1,
154
+ {1,0,0},
155
+ 0,
156
+ 20,
157
+ true
158
+ )
159
+ end
116
160
  jtff_log.info(string.format("Assigned Squadron %s to %s patrol Zone...", CAPSquadronName, CapZoneName),"CAP_WAR_ZONE")
117
161
  objCapWarZone.objDispatcher:SetSquadronCap(
118
162
  CAPSquadronName,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jtff/miztemplate-lib",
3
- "version": "3.4.12",
3
+ "version": "3.4.14",
4
4
  "description": "JTFF mission template library",
5
5
  "main": "index.js",
6
6
  "files": [