Initial Deep Strike implementation
This commit is contained in:
@@ -169,7 +169,7 @@ class Sidebar extends HTMLElement {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
var betaHtml = '';
|
var betaHtml = '';
|
||||||
if (true || window.location.hostname.toLowerCase() == 'beta.spearhead.rocks') {
|
if (window.location.hostname.toLowerCase() == 'beta.spearhead.rocks') {
|
||||||
betaHtml = '<note-box type="warning" title="Beta Version">You are looking at docs that are released with the beta version.</note-box>';
|
betaHtml = '<note-box type="warning" title="Beta Version">You are looking at docs that are released with the beta version.</note-box>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,14 +26,14 @@
|
|||||||
|
|
||||||
<div class="content-wrapper">
|
<div class="content-wrapper">
|
||||||
<h1>Advanced Tutorial: Missions</h1>
|
<h1>Advanced Tutorial: Missions</h1>
|
||||||
|
<div id="strike-region">
|
||||||
<h2 id="strike">Strike</h2>
|
<h2 id="strike">Strike</h2>
|
||||||
<p>
|
<p>
|
||||||
Naming: <span class="inline-lua"><span class="lua-variable">MISSION_STRIKE_[Name]</span></span> <br>
|
Naming: <code-inline>MISSION_STRIKE_[Name]</code-inline> <br>
|
||||||
</p>
|
</p>
|
||||||
<h3 id="specific_targets">Specific Targets</h3>
|
<h3 id="specific_targets">Specific Targets</h3>
|
||||||
<p>TBD</p>
|
<p>TBD</p>
|
||||||
|
|
||||||
|
|
||||||
<h3 id="scenery_targets">Scenery Targets</h3>
|
<h3 id="scenery_targets">Scenery Targets</h3>
|
||||||
<p>
|
<p>
|
||||||
Bridges, buildings or other type of targets that are baked into the map are awesome targets.<br>
|
Bridges, buildings or other type of targets that are baked into the map are awesome targets.<br>
|
||||||
@@ -41,24 +41,100 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<note-box type="info" title="Implementation details">
|
<note-box type="info" title="Implementation details">
|
||||||
Spearhead detects scenery targets by the trigger zone name. A zone named <strong>scenerytarget_[freeform]</strong> or
|
Spearhead detects scenery targets by the trigger zone name. A zone named
|
||||||
<strong>scenerytargets</strong> (case-insensitive) will be scanned and any scenery objects that has the attribute "Buildings" inside the zone
|
<strong>scenerytarget_[freeform]</strong> or
|
||||||
|
<strong>scenerytargets</strong> (case-insensitive) will be scanned and any scenery objects that
|
||||||
|
has the attribute "Buildings" inside the zone
|
||||||
will be added as mission scenery targets.
|
will be added as mission scenery targets.
|
||||||
</note-box>
|
</note-box>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Scenery targets are treated like mission targets: they are included in the mission completion calculation
|
Scenery targets are treated like mission targets: they are included in the mission completion
|
||||||
(their `IsAlive()` state is checked) and their state is persisted/updated when missions spawn or resume.
|
calculation
|
||||||
|
(their `IsAlive()` state is checked) and their state is persisted/updated when missions spawn or
|
||||||
|
resume.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<note-box type="warning" title="Changing IDs">
|
<note-box type="warning" title="Changing IDs">
|
||||||
Due to Object IDs changing when maps are updated and edited the "Assign as..." functionality does not work for scenery targets.
|
Due to Object IDs changing when maps are updated and edited the "Assign as..." functionality
|
||||||
|
does not work for scenery targets.
|
||||||
Hence the need to use trigger zones to define them.
|
Hence the need to use trigger zones to define them.
|
||||||
</note-box>
|
</note-box>
|
||||||
|
|
||||||
|
|
||||||
<p>Here's two images showing how a bridge is added to a mission.</p>
|
<p>Here's two images showing how a bridge is added to a mission.</p>
|
||||||
<img src="/img/bridge.png" style="max-height: 35remrem;"/>
|
<img src="/img/bridge.png" style="max-height: 35remrem;" />
|
||||||
|
</div>
|
||||||
|
<div id="cas-region">
|
||||||
|
<h2 id="cas">CAS</h2>
|
||||||
|
<p>
|
||||||
|
Naming: <code-inline>MISSION_CAS_[Name]</code-inline> <br>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h3 id="BattleManager">Battle Manager</h3>
|
||||||
|
<p>TBD</p>
|
||||||
|
</div>
|
||||||
|
<div id="dead-region">
|
||||||
|
<h2 id="dead">DEAD</h2>
|
||||||
|
<p>
|
||||||
|
Naming: <code-inline>MISSION_DEAD_[Name]</code-inline> <br>
|
||||||
|
Naming: <code-inline>MISSION_SAM_[Name]</code-inline> <br>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h3 id="sam-vs-dead">SAM vs DEAD</h3>
|
||||||
|
<p>TBD</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="bai-region">
|
||||||
|
<h2 id="bai">BAI</h2>
|
||||||
|
<p>
|
||||||
|
Naming: <code-inline>MISSION_BAI_[Name]</code-inline> <br>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="deepstrike-region">
|
||||||
|
<h2 id="deepstrike">DEEPSTRIKE</h2>
|
||||||
|
<p>
|
||||||
|
Naming: <code-inline>MISSION_DEEPSTRIKE_[Name]</code-inline> <br>
|
||||||
|
<br>
|
||||||
|
When you, as a mission editor, want to create a mission that's further away from the current front-line you can use the Deep Strike mission type. <br>
|
||||||
|
This allows you to plan missions that require more strategic positioning and timing. <br>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h3 id="activation">Activation</h3>
|
||||||
|
<p>
|
||||||
|
Deep Strike missions are activated when the Stage in which they are located becomes "PreActive" or "Active". <br>
|
||||||
|
"PreActive" is when either the current active StageNumber is a certain number of stages away OR the stage has "CAP" airbases active . <br>
|
||||||
|
<code-inline>SpearheadConfig.StageConfig.preactivateStage</code-inline> changes the configuration. <br>
|
||||||
|
<br>
|
||||||
|
For example: <br>
|
||||||
|
If the current active stage is <code-inline>MissionStage_2_[name]</code-inline> and preActivate config is set to 2. <br>
|
||||||
|
Then both <code-inline>MissionStage_3_[name]</code-inline> and <code-inline>MissionStage_4_[name]</code-inline> would become "PreActive".
|
||||||
|
</p>
|
||||||
|
<h3 id="primary-vs-secondary">Make Primary</h3>
|
||||||
|
<p>
|
||||||
|
By default DEEPSTRIKE missions are "Secondary" missions when spawned as a pre-activated stage.<br>
|
||||||
|
Then when the stage they are in is "Active", the mission becomes a "Primary" mission. <br>
|
||||||
|
<br>
|
||||||
|
If you want to make it a "Primary" mission from the start, you can overwrite it.<br>
|
||||||
|
Click the mission's trigger zone. Add a property named <code-inline>primary</code-inline> and set it to <code-inline>true</code-inline>.
|
||||||
|
This will make the mission "Primary" from the start. <br>
|
||||||
|
<br>
|
||||||
|
If you want it to "Secondary" even when its stage is the active stage, you can set "primary" to false. <br>
|
||||||
|
<br>
|
||||||
|
If you want to have it be "Secondary" when its stage is "Pre-Active" and "primary" when its stage is "Active" you don't have to do anything.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h3 id="future-additions">Future</h3>
|
||||||
|
<p>
|
||||||
|
In the future we're thinking it would be cool to make the Deep Strike missions
|
||||||
|
be more integrated with the CAP airbases and/or logistics. <br>
|
||||||
|
Eg. Completing a DEEPSTRIKE mission would disable CAP for X amount of minutes after completion. <br>
|
||||||
|
This still needs to be refined, but we've already have ideas.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
--color-bg-hover: rgba(120, 140, 255, 0.12); /* More visible hover */
|
--color-bg-hover: rgba(120, 140, 255, 0.12); /* More visible hover */
|
||||||
--color-bg-note-dark: rgba(40, 35, 30, 0.85); /* Slightly darker note box */
|
--color-bg-note-dark: rgba(40, 35, 30, 0.85); /* Slightly darker note box */
|
||||||
|
|
||||||
--color-text-primary: #a5a5a5; /* Brighter text */
|
--color-text-primary: #b4b3b3; /* Brighter text */
|
||||||
--color-text-secondary: #bfc8d8; /* Lighter secondary text */
|
--color-text-secondary: #bfc8d8; /* Lighter secondary text */
|
||||||
--color-text-accent: #7ecbff; /* Brighter accent */
|
--color-text-accent: #7ecbff; /* Brighter accent */
|
||||||
--color-text-light: #ffffff;
|
--color-text-light: #ffffff;
|
||||||
|
|||||||
@@ -90,14 +90,6 @@ function ZoneMission.new(zoneName, priority, database, logger, parentStage, spaw
|
|||||||
local missionData = database:getMissionDataForZone(zoneName)
|
local missionData = database:getMissionDataForZone(zoneName)
|
||||||
if not missionData then return end
|
if not missionData then return end
|
||||||
|
|
||||||
if missionData.primaryOverwrite ~= nil then
|
|
||||||
if missionData.primaryOverwrite == true then
|
|
||||||
priority = "primary"
|
|
||||||
else
|
|
||||||
priority= "secondary"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local missionBriefing = missionData.description or "No briefing available"
|
local missionBriefing = missionData.description or "No briefing available"
|
||||||
|
|
||||||
local success, error = Mission.newSuper(self, zoneName, parsed.missionName, parsed.type, missionBriefing, priority,
|
local success, error = Mission.newSuper(self, zoneName, parsed.missionName, parsed.type, missionBriefing, priority,
|
||||||
@@ -360,6 +352,19 @@ end
|
|||||||
function ZoneMission:SpawnInactive()
|
function ZoneMission:SpawnInactive()
|
||||||
self._logger:info("PreActivating " .. self.name)
|
self._logger:info("PreActivating " .. self.name)
|
||||||
|
|
||||||
|
if self.missionType == "DEEPSTRIKE" then
|
||||||
|
local missionData = self._database:getMissionDataForZone(self.zoneName)
|
||||||
|
---@type MissionPriority
|
||||||
|
local priority = "secondary"
|
||||||
|
if missionData and missionData.primaryOverwrite ~= nil then
|
||||||
|
if missionData.primaryOverwrite == true then
|
||||||
|
priority = "primary"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
self._priority = priority
|
||||||
|
self._missionCommandsHelper:AddMissionToCommands(self)
|
||||||
|
end
|
||||||
|
|
||||||
for _, group in pairs(self._missionGroups.redGroups) do
|
for _, group in pairs(self._missionGroups.redGroups) do
|
||||||
group:Spawn()
|
group:Spawn()
|
||||||
end
|
end
|
||||||
@@ -396,6 +401,17 @@ function ZoneMission:SpawnActive()
|
|||||||
self._battleManager:Start()
|
self._battleManager:Start()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
self._missionCommandsHelper:RemoveMissionToCommands(self) -- Remove first
|
||||||
|
if self.missionType == "DEEPSTRIKE" then
|
||||||
|
local missionData = self._database:getMissionDataForZone(self.zoneName)
|
||||||
|
local priority = "primary"
|
||||||
|
if missionData and missionData.primaryOverwrite ~= nil then
|
||||||
|
if missionData.primaryOverwrite == false then
|
||||||
|
priority = "secondary"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
self._priority = priority
|
||||||
|
end
|
||||||
self._missionCommandsHelper:AddMissionToCommands(self)
|
self._missionCommandsHelper:AddMissionToCommands(self)
|
||||||
|
|
||||||
self:StartCheckingContinuous()
|
self:StartCheckingContinuous()
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ local GlobalConfig = require("classes.configuration.GlobalConfig")
|
|||||||
---@field zoneName string
|
---@field zoneName string
|
||||||
---@field missionType MissionType
|
---@field missionType MissionType
|
||||||
---@field missionTypeDisplay string
|
---@field missionTypeDisplay string
|
||||||
---@field private _priority MissionPriority
|
---@field protected _priority MissionPriority
|
||||||
---@field location Vec2?
|
---@field location Vec2?
|
||||||
---@field code string
|
---@field code string
|
||||||
---@field protected _state MissionState
|
---@field protected _state MissionState
|
||||||
|
|||||||
Reference in New Issue
Block a user