wip
This commit is contained in:
+7
-5
@@ -40,12 +40,14 @@
|
|||||||
With the help of naming conventions, trigger zones, pre-configured
|
With the help of naming conventions, trigger zones, pre-configured
|
||||||
logic and custom configuration items, it gives a huge amount of versatility.
|
logic and custom configuration items, it gives a huge amount of versatility.
|
||||||
we're trying to strike a balance between no-code and low-code with the possibility to hook into it for
|
we're trying to strike a balance between no-code and low-code with the possibility to hook into it for
|
||||||
the hard core scripters.</p>
|
the hard core scripters.
|
||||||
|
</p>
|
||||||
<p id="latest-version">Latest Version: #{VERSION}# created at: #{VERSION_DATE}#</p>
|
<p>
|
||||||
<p id="latest-version">Latest Beta Version: #{BETA_VERSION}# created at: #{BETA_VERSION_DATE}#</p>
|
Whether this is your first mission or your hundredth, we hope Spearhead will make your life easier.
|
||||||
<a style="text-decoration: underline;" target="_blank" href="https://github.com/dutchie031/Spearhead/releases">See All releases here</a>
|
</p>
|
||||||
|
|
||||||
|
<download-spearhead></download-spearhead>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|||||||
@@ -3,3 +3,4 @@ import * as sidebar from "./components/sidebar.js";
|
|||||||
import './components/code-block.js';
|
import './components/code-block.js';
|
||||||
import './components/code-inline.js';
|
import './components/code-inline.js';
|
||||||
import './components/note.js';
|
import './components/note.js';
|
||||||
|
import './components/latest-version-download.js';
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ class Header extends HTMLElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
connectedCallback() {
|
connectedCallback() {
|
||||||
this.innerHTML = `
|
this.innerHTML = /*html*/`
|
||||||
<div class="header-box">
|
<div class="header-box">
|
||||||
<a class="logo" href="/index.html">Spearhead</a>
|
<a class="logo" href="/index.html">Spearhead</a>
|
||||||
<span class="subTitle">mission making, made easy</span>
|
<span class="subTitle">mission making, made easy</span>
|
||||||
@@ -17,10 +17,11 @@ class Header extends HTMLElement {
|
|||||||
<div class="dropdown">
|
<div class="dropdown">
|
||||||
<a href="/pages/tutorials.html">Tutorials</a>
|
<a href="/pages/tutorials.html">Tutorials</a>
|
||||||
<div class="dropdown-content">
|
<div class="dropdown-content">
|
||||||
<a href="/pages/tutorials.html">Quick Starts</a>
|
<a href="/pages/include-script.html">Include the Script</a>
|
||||||
<a href="/pages/advanced/CAP.html">Advanced: CAP</a>
|
<a href="/pages/first-start.html">First Start</a>
|
||||||
<a href="/pages/advanced/missions.html">Advanced: Missions</a>
|
<a href="/pages/advanced/CAP.html">Advanced: CAP</a>
|
||||||
<a href="/pages/advanced/custom-drawings.html">Custom Drawings</a>
|
<a href="/pages/advanced/missions.html">Advanced: Missions</a>
|
||||||
|
<a href="/pages/advanced/map-markings.html">Map Markings</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,119 @@
|
|||||||
|
class DownloadScript extends HTMLElement {
|
||||||
|
|
||||||
|
constructor(){
|
||||||
|
super();
|
||||||
|
this.cacheKey = 'spearhead-latest-release';
|
||||||
|
this.cacheExpiryMinutes = 15;
|
||||||
|
}
|
||||||
|
|
||||||
|
getCachedData() {
|
||||||
|
const cached = localStorage.getItem(this.cacheKey);
|
||||||
|
if (!cached) return null;
|
||||||
|
|
||||||
|
const { data, timestamp } = JSON.parse(cached);
|
||||||
|
const now = Date.now();
|
||||||
|
const expiry = this.cacheExpiryMinutes * 60 * 1000; // 15 minutes in ms
|
||||||
|
|
||||||
|
if (now - timestamp > expiry) {
|
||||||
|
localStorage.removeItem(this.cacheKey);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
setCachedData(data) {
|
||||||
|
const cacheItem = {
|
||||||
|
data: data,
|
||||||
|
timestamp: Date.now()
|
||||||
|
};
|
||||||
|
localStorage.setItem(this.cacheKey, JSON.stringify(cacheItem));
|
||||||
|
}
|
||||||
|
|
||||||
|
async fetchLatestRelease() {
|
||||||
|
// Check cache first
|
||||||
|
const cachedData = this.getCachedData();
|
||||||
|
if (cachedData) {
|
||||||
|
return cachedData;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const response = await fetch('https://api.github.com/repos/dutchie031/Spearhead/releases/latest');
|
||||||
|
const data = await response.json();
|
||||||
|
|
||||||
|
// Cache the data
|
||||||
|
this.setCachedData(data);
|
||||||
|
return data;
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error fetching latest release:', error);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async fetchReleaseAssets(url){
|
||||||
|
try {
|
||||||
|
const response = await fetch(url);
|
||||||
|
const data = await response.json();
|
||||||
|
return data;
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error fetching release assets:', error);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async connectedCallback() {
|
||||||
|
|
||||||
|
var version = "?";
|
||||||
|
var timestamp = "?";
|
||||||
|
var size = "?";
|
||||||
|
var href = "https://github.com/dutchie031/Spearhead/releases"
|
||||||
|
|
||||||
|
const latestRelease = await this.fetchLatestRelease();
|
||||||
|
if (latestRelease) {
|
||||||
|
version = latestRelease.tag_name;
|
||||||
|
timestamp = new Date(latestRelease.published_at).toLocaleDateString('en-CA');
|
||||||
|
|
||||||
|
const assets = await this.fetchReleaseAssets(latestRelease.assets_url);
|
||||||
|
if (assets && assets.length > 0) {
|
||||||
|
const spearheadAsset = assets.find(asset => asset.name.includes('spearhead'));
|
||||||
|
if (spearheadAsset) {
|
||||||
|
size = (spearheadAsset.size / 1024).toFixed(2) + 'kb';
|
||||||
|
href = spearheadAsset.browser_download_url;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.innerHTML = /*html*/`
|
||||||
|
<div class="latest-version-download-box">
|
||||||
|
<style>
|
||||||
|
.latest-version-download-box {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.latest-version-download-content {
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
border-radius: 8px;
|
||||||
|
padding: 0px 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.version-text {
|
||||||
|
font-weight: bold;
|
||||||
|
color: #f5efefff
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<div class="latest-version-download-content">
|
||||||
|
<p>
|
||||||
|
<span class="version-text">${version}</span> (${timestamp}) <br>
|
||||||
|
<a style="text-decoration: underline;" target="_blank" href="${href}">Download</a> (${size}) <br>
|
||||||
|
<a style="text-decoration: underline;" target="_blank" href="https://github.com/dutchie031/Spearhead/releases">See All Versions here</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
customElements.define('download-spearhead', DownloadScript);
|
||||||
@@ -25,24 +25,46 @@
|
|||||||
<app-sidebar></app-sidebar>
|
<app-sidebar></app-sidebar>
|
||||||
|
|
||||||
<div class="content-wrapper">
|
<div class="content-wrapper">
|
||||||
<h1>Advanced Tutorial: Custom Drawings</h1>
|
<h1>Map Markings</h1>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Drawings can be very powerful in DCS missions. <br>
|
Drawings can be very powerful in DCS missions. <br>
|
||||||
They can guide players towards the right objectives or warn them of dangers ahead. <br>
|
They can guide players towards the right objectives or warn them of dangers ahead. <br>
|
||||||
In Spearhead, we provide an easy way to manage and update these drawings dynamically as the mission progresses. <br>
|
In Spearhead, we have both automatic markers and drawings as well as the possibility to integrate custom drawings.<br>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h2 id="custom_drawings_how_to">How to</h2>
|
<h2 id="automatic_drawings">Automated</h2>
|
||||||
|
|
||||||
|
|
||||||
|
<h3 id="stage_drawings">Stages</h3>
|
||||||
|
<p>
|
||||||
|
Spearhead automatically draws stage markings on the map for players to see. <br>
|
||||||
|
These are drawn when a stage becomes active and removed when the stage is completed. <br>
|
||||||
|
This gives players a clear visual indication of where they need to go next. <br>
|
||||||
|
<br>
|
||||||
|
These can however be disabled in the configuration if desired. <br>
|
||||||
|
<code-inline>SpearheadConfig.StageConfig.drawStages</code-inline> <br>
|
||||||
|
<code-inline>SpearheadConfig.StageConfig.drawPreActived</code-inline> <br>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h3 id="lastcontact_markings">Last Contact</h3>
|
||||||
|
<p>
|
||||||
|
If enabled, Spearhead will draw a marker on the map where the enemy was last killed. <br>
|
||||||
|
This might help in big multiplayer missions where players log off without sharing intel. <br>
|
||||||
|
This can be enabled or disabled in the configuration. <br>
|
||||||
|
<code-inline>SpearheadConfig.StageConfig.markLastContact</code-inline>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h2 id="custom_drawings">Custom</h2>
|
||||||
<p>
|
<p>
|
||||||
Adding a custom drawing is easy. <br>
|
Adding a custom drawing is easy. <br>
|
||||||
Simply create the drawing and then name it according to the following convention: <br>
|
Simply create the drawing and then name it according to the following convention: <br>
|
||||||
<code-inline>DRAWING_[a]:[b]_[FreeForm]</starting></code-inline> <br>
|
<code-inline>DRAWING_[a]:[b]_[FreeForm]</starting></code-inline> <br>
|
||||||
Where:
|
Where:
|
||||||
<ul>
|
<ul>
|
||||||
<li><strong>[a]</strong> is the stage number at which the drawing should appear.</li>
|
<li><code-inline>[a]</code-inline> is the stage number at which the drawing should appear.</li>
|
||||||
<li><strong>[b]</strong> is the stage number at which the drawing should be removed again.</li>
|
<li><code-inline>[b]</code-inline> is the stage number at which the drawing should be removed again.</li>
|
||||||
<li><strong>[FreeForm]</strong> is any name you want to make it unique or findables.</li>
|
<li><code-inline>[FreeForm]</code-inline> is any name you want to make it unique or findables.</li>
|
||||||
</ul>
|
</ul>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
@@ -51,8 +73,6 @@
|
|||||||
This is due to other layers being visible by default and cannot be as easily removed when not needed.
|
This is due to other layers being visible by default and cannot be as easily removed when not needed.
|
||||||
The author layer is not visible by default in multiplayer, making it perfect for this use case.
|
The author layer is not visible by default in multiplayer, making it perfect for this use case.
|
||||||
</note-box>
|
</note-box>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -0,0 +1,208 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en" data-theme="dark">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Spearhead Tutorials</title>
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="/style/prism.css">
|
||||||
|
<link rel="stylesheet" href="/style/style.css">
|
||||||
|
|
||||||
|
<script src="/js/prism.js"></script>
|
||||||
|
<script src="/js/site.js"></script>
|
||||||
|
<style>
|
||||||
|
.side-nav a.active {
|
||||||
|
font-weight: bold;
|
||||||
|
color: #4fc3f7;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<script type="module" src="../js/components.js"></script>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<header>
|
||||||
|
<app-header></app-header>
|
||||||
|
</header> <main>
|
||||||
|
<div class="reference-container">
|
||||||
|
<app-sidebar></app-sidebar>
|
||||||
|
|
||||||
|
<div class="content-wrapper">
|
||||||
|
<h1>Tutorials</h1>
|
||||||
|
<p>
|
||||||
|
This guide is to get you started building your first Spearhead mission. <br />
|
||||||
|
Spearhead was created to enable the mission maker to worry as little about the running, timing and scripting
|
||||||
|
and most about the setting and looks and feel of the mission. <br />
|
||||||
|
In the example we'll show how you can create a simple island hopping mission
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h2>Include the script</h2>
|
||||||
|
<p>
|
||||||
|
Read <a href="/pages/include-script.html">here</a> how to include the Spearhead script in your mission first. <br />
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h2 id="stages">Stages</h2>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
In general, stages are the backbone of a Spearhead mission. <br>
|
||||||
|
They define the flow of the mission and what is active at what time. <br>
|
||||||
|
|
||||||
|
Don't worry, it can be changed and adapted later on, but it's best to translate your mission idea into stages first. <br>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Stages are defined by trigger zones. <br>
|
||||||
|
They'll be picked up by Spearhead when named according to the naming convention: <br>
|
||||||
|
<code-inline>MISSIONSTAGE_[OrderNumber]_[FreeForm]</code-inline> <br>
|
||||||
|
<br>
|
||||||
|
Stages are divided in primary stages: <code-inline>MISSIONSTAGE_[number]</code-inline> <br>
|
||||||
|
or secondary stages: <code-inline>MISSIONSTAGE_x[number]</code-inline> <br>
|
||||||
|
Note the x before the number. This marks it as "extra" <br>
|
||||||
|
Secondary stages will follow the order number, but are not required to be completed before moving on to the next stage numbers. <br>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
For this Demo mission we'll create 3 stages. <br>
|
||||||
|
<code-inline>MissionStage_1_start</code-inline><br>
|
||||||
|
<code-inline>MissionStage_2_continuation</code-inline><br>
|
||||||
|
<code-inline>MissionStage_3_finale</code-inline> <br>
|
||||||
|
Each stage will have it's own trigger zone. <br/>
|
||||||
|
</p>
|
||||||
|
<img src="../img/first-start/1.png" alt="The first stages displayed" style="width: 100%;"></img>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
There's 3 stages now. <br>
|
||||||
|
The first <code-inline>MissionStage_1_start</code-inline> is the first stage and will be active at mission start. <br>
|
||||||
|
The second <code-inline>MissionStage_2_continuation</code-inline> will be pre-activated when stage 1 is active. <br>
|
||||||
|
But will be fully activated when stage 1 is complete. <br>
|
||||||
|
Pre-activated means that the SAM missions and Airbase units will be activated. <br>
|
||||||
|
This is the difference between SAM and DEAD missions, but let's not get into too much detail at this time. <br>
|
||||||
|
|
||||||
|
You can ofcourse create as many stages as you want. <br>
|
||||||
|
You can also change the amount of stages that get pre-activated. <br>
|
||||||
|
By default Spearhead will pre-activate 1 stage ahead. <br/>
|
||||||
|
This can be changed in the configuration. <br/>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h2 id="create-missions">Create Missions</h2>
|
||||||
|
<p>
|
||||||
|
Now that we've created the stages we can start adding missions to them. <br>
|
||||||
|
Missions are also defined by trigger zones. <br>
|
||||||
|
They'll be picked up by Spearhead when named according to the naming convention: <br>
|
||||||
|
<code-inline>MISSION_[Type]_[FreeForm]</code-inline> <br>
|
||||||
|
Where <code-inline>[Type]</code-inline> is the type of mission. <br>
|
||||||
|
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h3 id="mission-cas">CAS</h3>
|
||||||
|
<p>
|
||||||
|
Personally CAS is one of our favorite mission types. <br>
|
||||||
|
Mostly because it's easy to set up and creates a truly immersive experience. <br>
|
||||||
|
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h3 id="mission-sam">SAM</h3>
|
||||||
|
<p>
|
||||||
|
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h3 id="mission-strike">STRIKE</h3>
|
||||||
|
<p>
|
||||||
|
|
||||||
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
<h2 id="setting-up-cap">Setting up CAP</h2>
|
||||||
|
<p>
|
||||||
|
If you don't want to use the CAP managers withing Spearhead you can skip this and continue to <a href="#setting-up-the-missions">Setting up Missions</a>. <br />
|
||||||
|
However CAP is one of the painpoints in a lot of missions and setting up a dynamic feeling airspace can be
|
||||||
|
quite the challenge. <br />
|
||||||
|
With the CAP managers we've tried to make this a lot easier. <br />
|
||||||
|
|
||||||
|
A CAP group needs to follow the following naming convention: <code-inline>CAP_[A|B][CONFIG]_[Free Form]</code-inline>
|
||||||
|
|
||||||
|
For details on config read this: <code-inline>CAP Group Config</code-inline>
|
||||||
|
|
||||||
|
For now I set up 3 groups with the following names. <code-inline>CAP_A[1]1_Rota1</code-inline>, <code-inline>CAP_A[1]1_Rota1-1</code-inline>,
|
||||||
|
<code-inline>CAP_B[1]1_Rota1</code-inline> <br />
|
||||||
|
The first two are marked with <code-inline>A</code-inline> and will therefore be primary CAP units. They will be
|
||||||
|
scheduled and make up for the total count. <br />
|
||||||
|
Meaning that for this airbase there is 2 CAP units max at a time flying out. <br />
|
||||||
|
In this case all groups have <code-inline>[1]1</code-inline> in the name, (This would be the same as <code-inline>[1]A</code-inline>) which means
|
||||||
|
that when stage 1 is active the groups will activate and fly out to stage 1.
|
||||||
|
|
||||||
|
I also set up a few groups further back. One example: <code-inline>CAP_A[1-3]3_Group1</code-inline>. This group will
|
||||||
|
protect zone 3 when zones 1 through 3 are active.
|
||||||
|
|
||||||
|
CAP units fly out, fly their CAP zone for x amount of minutes and will then RTB. <br />
|
||||||
|
Before they actually RTB an event is triggered 10 minutes before the actual RTB task. This event
|
||||||
|
will trigger a backup unit to startup and fly out to take over. <br />
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<note-box type="info" title="Tip">
|
||||||
|
You can start a mission, speed up the simulation and make the CAP fly out to see what happens
|
||||||
|
</note-box>
|
||||||
|
|
||||||
|
<h3 id="creating-cap-routes">Creating CAP Routes</h3>
|
||||||
|
<p>
|
||||||
|
Creating CAP routes is not needed per se, but with a multi-stage stage (we have 2 stages with <code-inline>_1_</code-inline>) it is recommended. <br/>
|
||||||
|
Similarly with huge stages. <br/>
|
||||||
|
If there is multiple zones it will "round-robin" over them. <br/>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
If no CAP route is present the unit will fly a route generated differently per zone: <br/>
|
||||||
|
<code-inline>quad zone</code-inline> => race-track between the corner closest to the origin airbase to the center point of the zone <br/>
|
||||||
|
<code-inline>circle zone</code-inline> => race-track between the closest point on circle to the origin airbase to the center <br/>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
If you want to create your own CAP Routes you can! <br/>
|
||||||
|
For this example I created 2 CAP routes inside of the 2 <code-inline>_1_</code-inline> stages. <br/>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
As you can see below there's a nice feature you can exploit. As long as the <code-inline>X</code-inline> of the zone is inside of the the <code-inline>CAPROUTE</code-inline> will be used for that stage!
|
||||||
|
</p>
|
||||||
|
<img src="../img/cap_routes.png" alt="CAP Routes Image" style="width: 100%;"></img>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Well, nice, we're done setting up the initial CAP effort. <br/>
|
||||||
|
If you want to change values for the CAP routes please read about how to configure it here: <a href="./Reference.html#cap-config">Cap Config</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h2 id="mission-briefings">Mission Briefings</h2>
|
||||||
|
<p>
|
||||||
|
So now we've created some missions we also want to add briefings to them. This is pretty easy with Spearhead. <br/>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
To do so click on <code-inline>draw</code-inline> on the left hand pane in the mission editor. This opens up the drawing tools in the editor. <br/>
|
||||||
|
On the right click <code-inline>TextBox</code-inline> and click somewhere inside the zone to which you want to add the briefing. <br/>
|
||||||
|
Give the briefing a name (It's not used, but can be nice to use to reference the briefing later) and add the briefing. <br/>
|
||||||
|
The text box is quite small, but can have a lot of text. Easiest is to edit the text in an editor of choice and paste it into the box afterwards. <br/>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Keep the binding layer to "Author" only. That way it doesn't show up for anyone other than in the mission editor.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
See the two images below. The left shows the <code-inline>Text Box</code-inline> drawing. The right shows the briefing as shown in the mission.
|
||||||
|
</p>
|
||||||
|
<div style="display: flex">
|
||||||
|
<div style="flex: 50%">
|
||||||
|
<img src="../img/briefing_me.png"/>
|
||||||
|
</div>
|
||||||
|
<div style="flex: 50%">
|
||||||
|
<img src="../img/briefing_mission.png"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<p>
|
||||||
|
We are now done creating a first mission. Hit fly and test it. <br/>
|
||||||
|
Check all references for way more features and keep up to date with the latest changes as they come along! <br/>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
<footer>
|
||||||
|
<p>© 2025 Spearhead Project</p>
|
||||||
|
</footer>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en" data-theme="dark">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Spearhead Tutorials</title>
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="/style/prism.css">
|
||||||
|
<link rel="stylesheet" href="/style/style.css">
|
||||||
|
|
||||||
|
<script src="/js/prism.js"></script>
|
||||||
|
<script src="/js/site.js"></script>
|
||||||
|
<style>
|
||||||
|
.side-nav a.active {
|
||||||
|
font-weight: bold;
|
||||||
|
color: #4fc3f7;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<script type="module" src="../js/components.js"></script>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<header>
|
||||||
|
<app-header></app-header>
|
||||||
|
</header> <main>
|
||||||
|
<div class="reference-container">
|
||||||
|
<app-sidebar></app-sidebar>
|
||||||
|
|
||||||
|
<div class="content-wrapper">
|
||||||
|
<h1>Include the Spearhead Script</h1>
|
||||||
|
|
||||||
|
<h2 id="include-the-script">Include the Script</h2>
|
||||||
|
<p>
|
||||||
|
Download the latest version of Spearhead. You can choose which version you feel comfortable with. <br />
|
||||||
|
Versions that end in -rc are not stable. Versions that do not have the "release candidate" (rc) tag are. <br>
|
||||||
|
Stable does not mean bug-free, so if you find any issues let us know!
|
||||||
|
<br />
|
||||||
|
Here is the latest stable version:
|
||||||
|
<download-spearhead></download-spearhead>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Then run the script in the mission. <br />
|
||||||
|
Please do exactly as it's done below. <br />
|
||||||
|
</p>
|
||||||
|
<div style="width: 100%;">
|
||||||
|
<img style="width: 100%;" src="../img/script_install.png"></img>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<note-box type="info" title="Note">
|
||||||
|
Spearhead does not require any dependencies (eg. MIST or MOOSE). Compatibility with other frameworks is
|
||||||
|
not tested at this time, so cannot be guaranteed, but there should be no conflicts if they are not
|
||||||
|
controlling the same units.
|
||||||
|
</note-box>
|
||||||
|
|
||||||
|
<div class="next-steps">
|
||||||
|
<a href="/pages/first-start.html">Next: Getting started with Spearhead →</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
<footer>
|
||||||
|
<p>© 2025 Spearhead Project</p>
|
||||||
|
</footer>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
+35
-37
@@ -66,24 +66,23 @@
|
|||||||
These are logically ordered zones that will activate one by one based on the mission status in them. <br />
|
These are logically ordered zones that will activate one by one based on the mission status in them. <br />
|
||||||
There is a little more to it, but you'll find out. <br />
|
There is a little more to it, but you'll find out. <br />
|
||||||
|
|
||||||
Stages need to be named according to the convention: <span class="inline-lua"><span class="lua-variable">MISSIONSTAGE_[OrderNumber]_[FreeForm]</span></span> <br />
|
Stages need to be named according to the convention: <code-inline>MISSIONSTAGE_[OrderNumber]_[FreeForm]</code-inline> <br />
|
||||||
The first stage will be called <span class="inline-lua"><span class="lua-variable">MISSIONSTAGE_1</span></span> or <span class="inline-lua"><span class="lua-variable">MISSIONSTAGE_1_EAST</span></span> for example. <br />
|
The first stage will be called <code-inline>MISSIONSTAGE_1</code-inline> or <code-inline>MISSIONSTAGE_1_EAST</code-inline> for example. <br />
|
||||||
<br /><br />
|
<br /><br />
|
||||||
Stages are divided in primary stages: <span class="inline-lua"><span class="lua-variable">MISSIONSTAGE_[number]</span></span> <br />
|
Stages are divided in primary stages: <code-inline>MISSIONSTAGE_[number]</code-inline> <br />
|
||||||
or secondary stages: <span class="inline-lua"><span class="lua-variable">MISSIONSTAGE_x[number]</span></span> <br />
|
or secondary stages: <code-inline>MISSIONSTAGE_x[number]</code-inline> <br />
|
||||||
Note the x before the number. This marks it as "extra"
|
Note the x before the number. This marks it as "extra"
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
For this mission we started with the three stages: <span class="inline-lua"><span class="lua-variable">MISSIONSTAGE_1_GROUND</span></span>,
|
For this mission we started with the three stages: <code-inline>MISSIONSTAGE_1_GROUND</code-inline>,
|
||||||
<span class="inline-lua"><span class="lua-variable">MISSIONSTAGE_2_WATER</span></span> and <span
|
<code-inline>MISSIONSTAGE_2_WATER</code-inline> and <code-inline>MISSIONSTAGE_1_AIRBASE</code-inline> as you see in the image.
|
||||||
class="inline-lua"><span class="lua-variable">MISSIONSTAGE_1_AIRBASE</span></span> as you see in the image.
|
|
||||||
</p>
|
</p>
|
||||||
<img src="../img/starting_stages.png" style="width: 100%;"></img>
|
<img src="../img/starting_stages.png" style="width: 100%;"></img>
|
||||||
<p>
|
<p>
|
||||||
<span class="inline-lua"><span class="lua-variable">MISSIONSTAGE_1_GROUND</span></span> will be activated when the mission starts <br />
|
<code-inline>MISSIONSTAGE_1_GROUND</code-inline>will be activated when the mission starts <br />
|
||||||
<span class="inline-lua"><span class="lua-variable">MISSIONSTAGE_1_WATER</span></span> will be also be activated <br />
|
<code-inline>MISSIONSTAGE_1_WATER</code-inline> will be also be activated <br />
|
||||||
<span class="inline-lua"><span class="lua-variable">MISSIONSTAGE_2_AIRBASE</span></span> will be activated when the player enters the zone.
|
<code-inline>MISSIONSTAGE_2_AIRBASE</code-inline> will be activated when the player enters the zone.
|
||||||
<br />
|
<br />
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
@@ -94,20 +93,19 @@
|
|||||||
quite the challenge. <br />
|
quite the challenge. <br />
|
||||||
With the CAP managers we've tried to make this a lot easier. <br />
|
With the CAP managers we've tried to make this a lot easier. <br />
|
||||||
|
|
||||||
A CAP group needs to follow the following naming convention: <span
|
A CAP group needs to follow the following naming convention: <code-inline>CAP_[A|B][CONFIG]_[Free Form]</code-inline>
|
||||||
class="inline-lua"><span class="lua-variable">CAP_[A|B][CONFIG]_[Free Form]</span></span>
|
|
||||||
|
|
||||||
For details on config read this: <span class="inline-ref">CAP Group Config</span>
|
For details on config read this: <code-inline>CAP Group Config</code-inline>
|
||||||
|
|
||||||
For now I set up 3 groups with the following names. <span class="inline-lua"><span class="lua-variable">CAP_A[1]1_Rota1</span></span>, <span class="inline-lua"><span class="lua-variable">CAP_A[1]1_Rota1-1</span></span>,
|
For now I set up 3 groups with the following names. <code-inline>CAP_A[1]1_Rota1</code-inline>, <code-inline>CAP_A[1]1_Rota1-1</code-inline>,
|
||||||
<span class="inline-lua"><span class="lua-variable">CAP_B[1]1_Rota1</span></span> <br />
|
<code-inline>CAP_B[1]1_Rota1</code-inline> <br />
|
||||||
The first two are marked with <span class="inline-lua"><span class="lua-variable">A</span></span> and will therefore be primary CAP units. They will be
|
The first two are marked with <code-inline>A</code-inline> and will therefore be primary CAP units. They will be
|
||||||
scheduled and make up for the total count. <br />
|
scheduled and make up for the total count. <br />
|
||||||
Meaning that for this airbase there is 2 CAP units max at a time flying out. <br />
|
Meaning that for this airbase there is 2 CAP units max at a time flying out. <br />
|
||||||
In this case all groups have <span class="inline-lua"><span class="lua-variable">[1]1</span></span> in the name, (This would be the same as <span class="inline-lua"><span class="lua-variable">[1]A</span></span>) which means
|
In this case all groups have <code-inline>[1]1</code-inline> in the name, (This would be the same as <code-inline>[1]A</code-inline>) which means
|
||||||
that when stage 1 is active the groups will activate and fly out to stage 1.
|
that when stage 1 is active the groups will activate and fly out to stage 1.
|
||||||
|
|
||||||
I also set up a few groups further back. One example: <span class="inline-lua"><span class="lua-variable">CAP_A[1-3]3_Group1</span></span>. This group will
|
I also set up a few groups further back. One example: <code-inline>CAP_A[1-3]3_Group1</code-inline>. This group will
|
||||||
protect zone 3 when zones 1 through 3 are active.
|
protect zone 3 when zones 1 through 3 are active.
|
||||||
|
|
||||||
CAP units fly out, fly their CAP zone for x amount of minutes and will then RTB. <br />
|
CAP units fly out, fly their CAP zone for x amount of minutes and will then RTB. <br />
|
||||||
@@ -121,21 +119,21 @@
|
|||||||
|
|
||||||
<h3 id="creating-cap-routes">Creating CAP Routes</h3>
|
<h3 id="creating-cap-routes">Creating CAP Routes</h3>
|
||||||
<p>
|
<p>
|
||||||
Creating CAP routes is not needed per se, but with a multi-stage stage (we have 2 stages with <span class="inline-lua"><span class="lua-variable">_1_</span></span>) it is recommended. <br/>
|
Creating CAP routes is not needed per se, but with a multi-stage stage (we have 2 stages with <code-inline>_1_</code-inline>) it is recommended. <br/>
|
||||||
Similarly with huge stages. <br/>
|
Similarly with huge stages. <br/>
|
||||||
If there is multiple zones it will "round-robin" over them. <br/>
|
If there is multiple zones it will "round-robin" over them. <br/>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
If no CAP route is present the unit will fly a route generated differently per zone: <br/>
|
If no CAP route is present the unit will fly a route generated differently per zone: <br/>
|
||||||
<span class="inline-lua"><span class="lua-variable">quad zone</span></span> => race-track between the corner closest to the origin airbase to the center point of the zone <br/>
|
<code-inline>quad zone</code-inline> => race-track between the corner closest to the origin airbase to the center point of the zone <br/>
|
||||||
<span class="inline-lua"><span class="lua-variable">circle zone</span></span> => race-track between the closest point on circle to the origin airbase to the center <br/>
|
<code-inline>circle zone</code-inline> => race-track between the closest point on circle to the origin airbase to the center <br/>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
If you want to create your own CAP Routes you can! <br/>
|
If you want to create your own CAP Routes you can! <br/>
|
||||||
For this example I created 2 CAP routes inside of the 2 <span class="inline-lua"><span class="lua-variable">_1_</span></span> stages. <br/>
|
For this example I created 2 CAP routes inside of the 2 <code-inline>_1_</code-inline> stages. <br/>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
As you can see below there's a nice feature you can exploit. As long as the <span class="inline-lua"><span class="lua-variable">X</span></span> of the zone is inside of the the <span class="inline-lua"><span class="lua-variable">CAPROUTE</span></span> will be used for that stage!
|
As you can see below there's a nice feature you can exploit. As long as the <code-inline>X</code-inline> of the zone is inside of the the <code-inline>CAPROUTE</code-inline> will be used for that stage!
|
||||||
</p>
|
</p>
|
||||||
<img src="../img/cap_routes.png" alt="CAP Routes Image" style="width: 100%;"></img>
|
<img src="../img/cap_routes.png" alt="CAP Routes Image" style="width: 100%;"></img>
|
||||||
|
|
||||||
@@ -155,7 +153,7 @@
|
|||||||
By default DCS will always keep 1 static object in 1 groups.
|
By default DCS will always keep 1 static object in 1 groups.
|
||||||
</note-box>
|
</note-box>
|
||||||
<p>
|
<p>
|
||||||
For this example I'll set up two missions. The first one is <span class="inline-lua"><span class="lua-variable">DEAD</span></span> mission and will consist of an SA-2 site with an additional "control center".
|
For this example I'll set up two missions. The first one is <code-inline>DEAD</code-inline> mission and will consist of an SA-2 site with an additional "control center".
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h3 id="mission-1-dead">Mission: DEAD</h3>
|
<h3 id="mission-1-dead">Mission: DEAD</h3>
|
||||||
@@ -173,32 +171,32 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
Important to note. It's all inside the triggerzone <span class="inline-lua"><span class="lua-variable">MISSION_DEAD_BYRON</span></span>. Which means it's a <span class="inline-lua"><span class="lua-variable">MISSION</span></span> of type <span class="inline-lua"><span class="lua-variable">DEAD</span></span> and with name <span class="inline-lua"><span class="lua-variable">BYRON</span></span>. <br/>
|
Important to note. It's all inside the triggerzone <code-inline>MISSION_DEAD_BYRON</code-inline>. Which means it's a <code-inline>MISSION</code-inline> of type <code-inline>DEAD</code-inline> and with name <code-inline>BYRON</code-inline>. <br/>
|
||||||
At the start Spearhead will detect the triggerzone, take all units and despawn them and only spawn when needed for better performance. <br/>
|
At the start Spearhead will detect the triggerzone, take all units and despawn them and only spawn when needed for better performance. <br/>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
The current list of mission types are:
|
The current list of mission types are:
|
||||||
<span class="inline-lua"><span class="lua-variable">DEAD</span></span>
|
<code-inline>DEAD</code-inline>
|
||||||
<span class="inline-lua"><span class="lua-variable">STRIKE</span></span>
|
<code-inline>STRIKE</code-inline>
|
||||||
<span class="inline-lua"><span class="lua-variable">BAI</span></span>
|
<code-inline>BAI</code-inline>
|
||||||
<span class="inline-lua"><span class="lua-variable">SAM</span></span> <br/>
|
<code-inline>SAM</code-inline> <br/>
|
||||||
For specific differences, please check the reference page.
|
For specific differences, please check the reference page.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Each type has some additional completion logic to it. <br/>
|
Each type has some additional completion logic to it. <br/>
|
||||||
<span class="inline-lua"><span class="lua-variable">DEAD</span></span> and <span class="inline-lua"><span class="lua-variable">SAM</span></span> missions will be marked complete when all air defences are destroyed. This includes Tracking Radars, Self tracking launchers and AAA guns if they are inside the zone. <br/>
|
<code-inline>DEAD</code-inline> and <code-inline>SAM</code-inline> missions will be marked complete when all air defences are destroyed. This includes Tracking Radars, Self tracking launchers and AAA guns if they are inside the zone. <br/>
|
||||||
If you want to add the Search radar or another random unit like the command tent to the target list you can add a <span class="inline-lua"><span class="lua-variable">TGT_</span></span> prefix to the unit or group you want destroyed. <br/>
|
If you want to add the Search radar or another random unit like the command tent to the target list you can add a <code-inline>TGT_</code-inline> prefix to the unit or group you want destroyed. <br/>
|
||||||
Please be aware that adding <span class="inline-lua"><span class="lua-variable">TGT_</span></span> to a group will make the entire group a target and therefore each unit needs to be destroyed. <br/>
|
Please be aware that adding <code-inline>TGT_</code-inline> to a group will make the entire group a target and therefore each unit needs to be destroyed. <br/>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h3 id="mission-2-strike">Mission: STRIKE</h3>
|
<h3 id="mission-2-strike">Mission: STRIKE</h3>
|
||||||
<p>
|
<p>
|
||||||
To show the power of <span class="inline-lua"><span class="lua-variable">TGT_</span></span> targets I'll create a strike mission next.
|
To show the power of <code-inline>TGT_</code-inline> targets I'll create a strike mission next.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
A nice supply strike mission will do. Add a ship, some containers and some additional units. <br/>
|
A nice supply strike mission will do. Add a ship, some containers and some additional units. <br/>
|
||||||
Even some SHORADS to spice the whole thing up. <br/>
|
Even some SHORADS to spice the whole thing up. <br/>
|
||||||
In the picture below all units that are selected and who show up as white (they are actually red) have the prefix <span class="inline-lua"><span class="lua-variable">TGT_</span></span> in front of their name. <br/>
|
In the picture below all units that are selected and who show up as white (they are actually red) have the prefix <code-inline>TGT_</code-inline> in front of their name. <br/>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
@@ -261,8 +259,8 @@
|
|||||||
So now we've created some missions we also want to add briefings to them. This is pretty easy with Spearhead. <br/>
|
So now we've created some missions we also want to add briefings to them. This is pretty easy with Spearhead. <br/>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
To do so click on <span class="inline-ref">draw</span> on the left hand pane in the mission editor. This opens up the drawing tools in the editor. <br/>
|
To do so click on <code-inline>draw</code-inline> on the left hand pane in the mission editor. This opens up the drawing tools in the editor. <br/>
|
||||||
On the right click <span class="inline-ref">TextBox</span> and click somewhere inside the zone to which you want to add the briefing. <br/>
|
On the right click <code-inline>TextBox</code-inline> and click somewhere inside the zone to which you want to add the briefing. <br/>
|
||||||
Give the briefing a name (It's not used, but can be nice to use to reference the briefing later) and add the briefing. <br/>
|
Give the briefing a name (It's not used, but can be nice to use to reference the briefing later) and add the briefing. <br/>
|
||||||
The text box is quite small, but can have a lot of text. Easiest is to edit the text in an editor of choice and paste it into the box afterwards. <br/>
|
The text box is quite small, but can have a lot of text. Easiest is to edit the text in an editor of choice and paste it into the box afterwards. <br/>
|
||||||
</p>
|
</p>
|
||||||
@@ -270,7 +268,7 @@
|
|||||||
Keep the binding layer to "Author" only. That way it doesn't show up for anyone other than in the mission editor.
|
Keep the binding layer to "Author" only. That way it doesn't show up for anyone other than in the mission editor.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
See the two images below. The left shows the <span class="inline-ref">Text Box</span> drawing. The right shows the briefing as shown in the mission.
|
See the two images below. The left shows the <code-inline>Text Box</code-inline> drawing. The right shows the briefing as shown in the mission.
|
||||||
</p>
|
</p>
|
||||||
<div style="display: flex">
|
<div style="display: flex">
|
||||||
<div style="flex: 50%">
|
<div style="flex: 50%">
|
||||||
|
|||||||
@@ -80,7 +80,9 @@ function InterceptGroup:SetTargetUnits(unitNames)
|
|||||||
self:UpdateTask()
|
self:UpdateTask()
|
||||||
|
|
||||||
if self._updateTaskID then
|
if self._updateTaskID then
|
||||||
timer.removeFunction(self._updateTaskID)
|
pcall(function()
|
||||||
|
timer.removeFunction(self._updateTaskID)
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
local updateContinous = function(selfA, time)
|
local updateContinous = function(selfA, time)
|
||||||
|
|||||||
+621
-621
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user