mirror of
https://github.com/FlightControl-Master/MOOSE_DOCS.git
synced 2025-08-15 10:37:49 +00:00
MOOSE generated documentation [skip ci]
This commit is contained in:
@@ -2036,8 +2036,113 @@ There is a risk involved in doing that; if you do not know what that means, this
|
||||
</code></pre>
|
||||
|
||||
<p><strong>Caveat:</strong>
|
||||
If you use units build by multiple templates, they will effectively double on loading. Dropped crates are not saved. Current stock is not saved.
|
||||
</p>
|
||||
If you use units build by multiple templates, they will effectively double on loading. Dropped crates are not saved. Current stock is not saved.</p>
|
||||
|
||||
<h2>7. Complex example - Build a complete FARP from a CTLD crate drop</h2>
|
||||
|
||||
<p>Prerequisites - you need to add a cargo of type FOB to your CTLD instance, for simplification reasons we call it FOB:</p>
|
||||
|
||||
<pre><code> my_ctld:AddCratesCargo("FARP",{"FOB"},CTLD_CARGO.Enum.FOB,2)
|
||||
</code></pre>
|
||||
|
||||
<p>Also, you need to have <strong>all statics with the fitting names</strong> as per the script in your mission already, as we're going to copy them, and a template
|
||||
for FARP vehicles, so -- services are goin to work (e.g. for the blue side: an unarmed humvee, two trucks and a fuel truck. Optionally add a fire fighter).</p>
|
||||
|
||||
<p>The following code will build a FARP at the coordinate the FOB was dropped and built:</p>
|
||||
|
||||
<pre><code> -- FARP Radio. First one has 130AM, next 131 and for forth
|
||||
local FARPFreq = 130
|
||||
local FARPName = 1 -- numbers 1..10
|
||||
|
||||
local FARPClearnames = {
|
||||
[1]="London",
|
||||
[2]="Dallas",
|
||||
[3]="Paris",
|
||||
[4]="Moscow",
|
||||
[5]="Berlin",
|
||||
[6]="Rome",
|
||||
[7]="Madrid",
|
||||
[8]="Warsaw",
|
||||
[9]="Dublin",
|
||||
[10]="Perth",
|
||||
}
|
||||
|
||||
function BuildAFARP(Coordinate)
|
||||
local coord = Coordinate -- Core.Point#COORDINATE
|
||||
|
||||
local FarpName = ((FARPName-1)%10)+1
|
||||
local FName = FARPClearnames[FarpName]
|
||||
|
||||
FARPFreq = FARPFreq + 1
|
||||
FARPName = FARPName + 1
|
||||
|
||||
-- Create a SPAWNSTATIC object from a template static FARP object.
|
||||
local SpawnStaticFarp=SPAWNSTATIC:NewFromStatic("Static Invisible FARP-1", country.id.USA)
|
||||
|
||||
-- Spawning FARPs is special in DCS. Therefore, we need to specify that this is a FARP. We also set the callsign and the frequency.
|
||||
SpawnStaticFarp:InitFARP(FARPName, FARPFreq, 0)
|
||||
SpawnStaticFarp:InitDead(false)
|
||||
|
||||
-- Spawn FARP
|
||||
local ZoneSpawn = ZONE_RADIUS:New("FARP "..FName,Coordinate:GetVec2(),160,false)
|
||||
local Heading = 0
|
||||
local FarpBerlin=SpawnStaticFarp:SpawnFromZone(ZoneSpawn, Heading, "FARP "..FName)
|
||||
|
||||
-- ATC and services - put them 125m from the center of the zone towards North
|
||||
local FarpVehicles = SPAWN:NewWithAlias("FARP Vehicles Template","FARP "..FName.." Technicals")
|
||||
FarpVehicles:InitHeading(180)
|
||||
local FarpVCoord = coord:Translate(125,0)
|
||||
FarpVehicles:SpawnFromCoordinate(FarpVCoord)
|
||||
|
||||
-- We will put the rest of the statics in a nice circle around the center
|
||||
local base = 330
|
||||
local delta = 30
|
||||
|
||||
local windsock = SPAWNSTATIC:NewFromStatic("Static Windsock-1",country.id.USA)
|
||||
local sockcoord = coord:Translate(125,base)
|
||||
windsock:SpawnFromCoordinate(sockcoord,Heading,"Windsock "..FName)
|
||||
base=base-delta
|
||||
|
||||
local fueldepot = SPAWNSTATIC:NewFromStatic("Static FARP Fuel Depot-1",country.id.USA)
|
||||
local fuelcoord = coord:Translate(125,base)
|
||||
fueldepot:SpawnFromCoordinate(fuelcoord,Heading,"Fueldepot "..FName)
|
||||
base=base-delta
|
||||
|
||||
local ammodepot = SPAWNSTATIC:NewFromStatic("Static FARP Ammo Storage-2-1",country.id.USA)
|
||||
local ammocoord = coord:Translate(125,base)
|
||||
ammodepot:SpawnFromCoordinate(ammocoord,Heading,"Ammodepot "..FName)
|
||||
base=base-delta
|
||||
|
||||
local CommandPost = SPAWNSTATIC:NewFromStatic("Static FARP Command Post-1",country.id.USA)
|
||||
local CommandCoord = coord:Translate(125,base)
|
||||
CommandPost:SpawnFromCoordinate(CommandCoord,Heading,"Command Post "..FName)
|
||||
base=base-delta
|
||||
|
||||
local Tent1 = SPAWNSTATIC:NewFromStatic("Static FARP Tent-11",country.id.USA)
|
||||
local Tent1Coord = coord:Translate(125,base)
|
||||
Tent1:SpawnFromCoordinate(Tent1Coord,Heading,"Command Tent "..FName)
|
||||
base=base-delta
|
||||
|
||||
local Tent2 = SPAWNSTATIC:NewFromStatic("Static FARP Tent-11",country.id.USA)
|
||||
local Tent2Coord = coord:Translate(125,base)
|
||||
Tent2:SpawnFromCoordinate(Tent2Coord,Heading,"Command Tent2 "..FName)
|
||||
|
||||
-- add a loadzone to CTLD
|
||||
my_ctld:AddCTLDZone("FARP "..FName,CTLD.CargoZoneType.LOAD,SMOKECOLOR.Blue,true,true)
|
||||
local m = MESSAGE:New(string.format("FARP %s in operation!",FName),15,"CTLD"):ToBlue()
|
||||
end
|
||||
|
||||
function my_ctld:OnAfterCratesBuild(From,Event,To,Group,Unit,Vehicle)
|
||||
local name = Vehicle:GetName()
|
||||
if string.match(name,"FOB",1,true) then
|
||||
local Coord = Vehicle:GetCoordinate()
|
||||
Vehicle:Destroy(false)
|
||||
BuildAFARP(Coord)
|
||||
end
|
||||
end
|
||||
</code></pre>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
@@ -7310,7 +7415,7 @@ When Moose is loaded statically, (as one file), tracing is switched off by defau
|
||||
<div>
|
||||
<div class="w3-card-2 w3-padding-small w3-margin-top">
|
||||
|
||||
#table
|
||||
|
||||
<a id="#(CTLD).CtldUnits" ><strong>CTLD.CtldUnits</strong></a>
|
||||
|
||||
|
||||
@@ -7332,7 +7437,7 @@ When Moose is loaded statically, (as one file), tracing is switched off by defau
|
||||
<div>
|
||||
<div class="w3-card-2 w3-padding-small w3-margin-top">
|
||||
|
||||
#table
|
||||
|
||||
<a id="#(CTLD).DroppedTroops" ><strong>CTLD.DroppedTroops</strong></a>
|
||||
|
||||
|
||||
@@ -7357,28 +7462,11 @@ When Moose is loaded statically, (as one file), tracing is switched off by defau
|
||||
<div>
|
||||
<div class="w3-card-2 w3-padding-small w3-margin-top">
|
||||
|
||||
#number
|
||||
<a id="#(CTLD).Engineers" ><strong>CTLD.Engineers</strong></a>
|
||||
|
||||
|
||||
|
||||
|
||||
<p>use as counter</p>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div>
|
||||
<div class="w3-card-2 w3-padding-small w3-margin-top">
|
||||
|
||||
#table
|
||||
<a id="#(CTLD).EngineersInField" ><strong>CTLD.EngineersInField</strong></a>
|
||||
|
||||
|
||||
|
||||
|
||||
<p>holds #CTLD_ENGINEERING objects</p>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -7410,7 +7498,7 @@ When Moose is loaded statically, (as one file), tracing is switched off by defau
|
||||
<div>
|
||||
<div class="w3-card-2 w3-padding-small w3-margin-top">
|
||||
|
||||
|
||||
#table
|
||||
<a id="#(CTLD).FreeFMFrequencies" ><strong>CTLD.FreeFMFrequencies</strong></a>
|
||||
|
||||
|
||||
@@ -7609,11 +7697,14 @@ When Moose is loaded statically, (as one file), tracing is switched off by defau
|
||||
<div>
|
||||
<div class="w3-card-2 w3-padding-small w3-margin-top">
|
||||
|
||||
#string
|
||||
|
||||
<a id="#(CTLD).RadioPath" ><strong>CTLD.RadioPath</strong></a>
|
||||
|
||||
|
||||
|
||||
|
||||
<p> Folderpath.</p>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -16290,7 +16381,7 @@ However, if you create a new folder inside the miz file, which contains the soun
|
||||
<div>
|
||||
<div class="w3-card-2 w3-padding-small w3-margin-top">
|
||||
|
||||
#table
|
||||
|
||||
<a id="#(CTLD).CtldUnits" ><strong>CTLD.CtldUnits</strong></a>
|
||||
|
||||
|
||||
@@ -16312,7 +16403,7 @@ However, if you create a new folder inside the miz file, which contains the soun
|
||||
<div>
|
||||
<div class="w3-card-2 w3-padding-small w3-margin-top">
|
||||
|
||||
#table
|
||||
|
||||
<a id="#(CTLD).DroppedTroops" ><strong>CTLD.DroppedTroops</strong></a>
|
||||
|
||||
|
||||
@@ -16337,28 +16428,11 @@ However, if you create a new folder inside the miz file, which contains the soun
|
||||
<div>
|
||||
<div class="w3-card-2 w3-padding-small w3-margin-top">
|
||||
|
||||
#number
|
||||
<a id="#(CTLD).Engineers" ><strong>CTLD.Engineers</strong></a>
|
||||
|
||||
|
||||
|
||||
|
||||
<p>use as counter</p>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div>
|
||||
<div class="w3-card-2 w3-padding-small w3-margin-top">
|
||||
|
||||
#table
|
||||
<a id="#(CTLD).EngineersInField" ><strong>CTLD.EngineersInField</strong></a>
|
||||
|
||||
|
||||
|
||||
|
||||
<p>holds #CTLD_ENGINEERING objects</p>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -16390,7 +16464,7 @@ However, if you create a new folder inside the miz file, which contains the soun
|
||||
<div>
|
||||
<div class="w3-card-2 w3-padding-small w3-margin-top">
|
||||
|
||||
|
||||
#table
|
||||
<a id="#(CTLD).FreeFMFrequencies" ><strong>CTLD.FreeFMFrequencies</strong></a>
|
||||
|
||||
|
||||
@@ -16589,11 +16663,14 @@ However, if you create a new folder inside the miz file, which contains the soun
|
||||
<div>
|
||||
<div class="w3-card-2 w3-padding-small w3-margin-top">
|
||||
|
||||
#string
|
||||
|
||||
<a id="#(CTLD).RadioPath" ><strong>CTLD.RadioPath</strong></a>
|
||||
|
||||
|
||||
|
||||
|
||||
<p> Folderpath.</p>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -18759,7 +18836,7 @@ However, if you create a new folder inside the miz file, which contains the soun
|
||||
<div>
|
||||
<div class="w3-card-2 w3-padding-small w3-margin-top">
|
||||
|
||||
#table
|
||||
|
||||
<a id="#(CTLD).CtldUnits" ><strong>CTLD.CtldUnits</strong></a>
|
||||
|
||||
|
||||
@@ -18781,7 +18858,7 @@ However, if you create a new folder inside the miz file, which contains the soun
|
||||
<div>
|
||||
<div class="w3-card-2 w3-padding-small w3-margin-top">
|
||||
|
||||
#table
|
||||
|
||||
<a id="#(CTLD).DroppedTroops" ><strong>CTLD.DroppedTroops</strong></a>
|
||||
|
||||
|
||||
@@ -18806,28 +18883,11 @@ However, if you create a new folder inside the miz file, which contains the soun
|
||||
<div>
|
||||
<div class="w3-card-2 w3-padding-small w3-margin-top">
|
||||
|
||||
#number
|
||||
<a id="#(CTLD).Engineers" ><strong>CTLD.Engineers</strong></a>
|
||||
|
||||
|
||||
|
||||
|
||||
<p>use as counter</p>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div>
|
||||
<div class="w3-card-2 w3-padding-small w3-margin-top">
|
||||
|
||||
#table
|
||||
<a id="#(CTLD).EngineersInField" ><strong>CTLD.EngineersInField</strong></a>
|
||||
|
||||
|
||||
|
||||
|
||||
<p>holds #CTLD_ENGINEERING objects</p>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -18859,7 +18919,7 @@ However, if you create a new folder inside the miz file, which contains the soun
|
||||
<div>
|
||||
<div class="w3-card-2 w3-padding-small w3-margin-top">
|
||||
|
||||
|
||||
#table
|
||||
<a id="#(CTLD).FreeFMFrequencies" ><strong>CTLD.FreeFMFrequencies</strong></a>
|
||||
|
||||
|
||||
@@ -19058,11 +19118,14 @@ However, if you create a new folder inside the miz file, which contains the soun
|
||||
<div>
|
||||
<div class="w3-card-2 w3-padding-small w3-margin-top">
|
||||
|
||||
#string
|
||||
|
||||
<a id="#(CTLD).RadioPath" ><strong>CTLD.RadioPath</strong></a>
|
||||
|
||||
|
||||
|
||||
|
||||
<p> Folderpath.</p>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -23809,17 +23872,6 @@ When moose is loading dynamically (for moose class development), tracing is swit
|
||||
|
||||
<p>Flag for direct loading.</p>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div>
|
||||
<div class="w3-card-2 w3-padding-small w3-margin-top">
|
||||
|
||||
|
||||
<a id="#(CTLD_CARGO).Mark" ><strong>CTLD_CARGO.Mark</strong></a>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -23969,17 +24021,6 @@ When moose is loading dynamically (for moose class development), tracing is swit
|
||||
|
||||
<p>Flag for direct loading.</p>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div>
|
||||
<div class="w3-card-2 w3-padding-small w3-margin-top">
|
||||
|
||||
|
||||
<a id="#(CTLD_CARGO).Mark" ><strong>CTLD_CARGO.Mark</strong></a>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -27590,17 +27631,6 @@ When moose is loading dynamically (for moose class development), tracing is swit
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div>
|
||||
<div class="w3-card-2 w3-padding-small w3-margin-top">
|
||||
|
||||
<a href="Core.Point.html##(COORDINATE)">Core.Point#COORDINATE</a>
|
||||
<a id="#(CTLD_ENGINEERING).currwpt" ><strong>CTLD_ENGINEERING.currwpt</strong></a>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -28254,17 +28284,6 @@ When moose is loading dynamically (for moose class development), tracing is swit
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div>
|
||||
<div class="w3-card-2 w3-padding-small w3-margin-top">
|
||||
|
||||
<a href="Core.Point.html##(COORDINATE)">Core.Point#COORDINATE</a>
|
||||
<a id="#(CTLD_ENGINEERING).currwpt" ><strong>CTLD_ENGINEERING.currwpt</strong></a>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user