mirror of
https://github.com/FlightControl-Master/MOOSE_Demos.git
synced 2025-08-15 10:37:47 +00:00
Updated Moose.lua
This commit is contained in:
Binary file not shown.
@@ -1,41 +1,41 @@
|
||||
---
|
||||
-- Author: FlightControl
|
||||
-- Created: 09.04.2017
|
||||
-- Contributors: kaltokri
|
||||
-- Modified: 01.03.2024
|
||||
--
|
||||
-- # Documentation:
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.SpawnStatic.html
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Static.html
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Zone.html
|
||||
--
|
||||
-- # Description:
|
||||
--
|
||||
-- In this mission we spawn a static near Gudauta.
|
||||
-- Around this object we create two circles with containers to mark the target area.
|
||||
-- NOTE: Instead of a STATIC object you can also use other objects (like UNITS) to define the center position!
|
||||
--
|
||||
-- # Guide:
|
||||
--
|
||||
-- 1. Observe that the static is spawned.
|
||||
|
||||
-- Get object of ZONE placed in mission editor.
|
||||
local zonePosition = ZONE:New( "Position" )
|
||||
|
||||
-- Create SPAWNSTATIC objects.
|
||||
local spawnCommandCenter = SPAWNSTATIC:NewFromStatic( "CommandCenter", country.id.GERMANY )
|
||||
local spawnBarrack = SPAWNSTATIC:NewFromStatic( "Barrack", country.id.GERMANY )
|
||||
|
||||
-- Get the position of the zone.
|
||||
local zonePointVec2 = zonePosition:GetPointVec2()
|
||||
|
||||
-- Spawn the CommandCenter in the center of the zone.
|
||||
local commandCenter = spawnCommandCenter:SpawnFromZone( zonePosition, 0 )
|
||||
|
||||
-- Create 6 barracks around the CommandCenter.
|
||||
for Heading = 0, 360, 60 do
|
||||
local radial = Heading * ( math.pi*2 ) / 360
|
||||
local x = zonePointVec2:GetLat() + math.cos( radial ) * 150
|
||||
local y = zonePointVec2:GetLon() + math.sin( radial ) * 150
|
||||
spawnBarrack:SpawnFromPointVec2( POINT_VEC2:New( x, y ), Heading + 90 )
|
||||
end
|
||||
---
|
||||
-- Author: FlightControl
|
||||
-- Created: 09.04.2017
|
||||
-- Contributors: kaltokri
|
||||
-- Modified: 01.03.2024
|
||||
--
|
||||
-- # Documentation:
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.SpawnStatic.html
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Static.html
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Zone.html
|
||||
--
|
||||
-- # Description:
|
||||
--
|
||||
-- In this mission we spawn a static near Gudauta.
|
||||
-- Around this object we create two circles with containers to mark the target area.
|
||||
-- NOTE: Instead of a STATIC object you can also use other objects (like UNITS) to define the center position!
|
||||
--
|
||||
-- # Guide:
|
||||
--
|
||||
-- 1. Observe that the static is spawned.
|
||||
|
||||
-- Get object of ZONE placed in mission editor.
|
||||
local zonePosition = ZONE:New( "Position" )
|
||||
|
||||
-- Create SPAWNSTATIC objects.
|
||||
local spawnCommandCenter = SPAWNSTATIC:NewFromStatic( "CommandCenter", country.id.GERMANY )
|
||||
local spawnBarrack = SPAWNSTATIC:NewFromStatic( "Barrack", country.id.GERMANY )
|
||||
|
||||
-- Get the position of the zone.
|
||||
local zonePointVec2 = zonePosition:GetPointVec2()
|
||||
|
||||
-- Spawn the CommandCenter in the center of the zone.
|
||||
local commandCenter = spawnCommandCenter:SpawnFromZone( zonePosition, 0 )
|
||||
|
||||
-- Create 6 barracks around the CommandCenter.
|
||||
for Heading = 0, 360, 60 do
|
||||
local radial = Heading * ( math.pi*2 ) / 360
|
||||
local x = zonePointVec2:GetLat() + math.cos( radial ) * 150
|
||||
local y = zonePointVec2:GetLon() + math.sin( radial ) * 150
|
||||
spawnBarrack:SpawnFromPointVec2( POINT_VEC2:New( x, y ), Heading + 90 )
|
||||
end
|
||||
|
||||
Binary file not shown.
@@ -1,57 +1,57 @@
|
||||
---
|
||||
-- Author: buur
|
||||
-- Created: 29.02.2024
|
||||
-- Contributors: kaltokri
|
||||
-- Modified: 01.03.2024
|
||||
--
|
||||
-- # Documentation:
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.SpawnStatic.html
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Static.html
|
||||
--
|
||||
-- # Description:
|
||||
--
|
||||
-- In this mission we search for a placed container with the UNIT name CircleCenterContainer.
|
||||
-- Around this object we create two circles with containers to mark the target area.
|
||||
-- NOTE: Instead of a STATIC object you can also use other objects (like UNITS) to define the center position!
|
||||
--
|
||||
-- # Guide:
|
||||
--
|
||||
-- 1. Start the mission and take a look at the placed containers.
|
||||
|
||||
--- Creates a circle with static objects around a given coordinate.
|
||||
-- @param Core.Point#COORDINATE circleCenter The coordinate for the center of the circle.
|
||||
-- @param #number radius (Optional) The radius of the circle. Default 150.
|
||||
-- @param #number step (Optional) The distance in degrees between the objects. Default 15.
|
||||
-- @param #string prefix (Optional) The prefix for the name of the STATIC objects. Default is innerCircle.
|
||||
-- @param #string category (Optional) The category of the STATIC object to use. Default is Fortifications.
|
||||
-- @param #string staticType (Optional) The type of the STATIC object to use. Default is container_40ft.
|
||||
-- @param #string staticShape (Optional) The shape of the STATIC object to use. Default is container_40ft.
|
||||
-- @param #string staticLivery (Optional) The livery name of the STATIC object to use. Default is summer.
|
||||
function targetcircle( circleCenter, radius, step, prefix, category, staticType, staticShape, staticLivery )
|
||||
local circleCenter = circleCenter
|
||||
local radius = radius or 150
|
||||
local step = step or 15
|
||||
local prefix = prefix or "innerCircle" -- Must be unique!
|
||||
local category = category or "Fortifications"
|
||||
local staticType = statictype or "container_40ft"
|
||||
local staticShape = staticshape or "container_40ft"
|
||||
local staticLivery = staticlivery or "summer"
|
||||
|
||||
for angle = 0, 360-step , step do
|
||||
local name = string.format( "%s#%f", prefix, angle )
|
||||
local circle = circleCenter:Translate( radius, angle, false, false )
|
||||
SPAWNSTATIC
|
||||
:NewFromType( staticType, category )
|
||||
:InitCoordinate( circle )
|
||||
:InitLivery( staticLivery )
|
||||
:InitHeading( angle )
|
||||
:InitShape( staticShape )
|
||||
:Spawn( nil, name )
|
||||
end
|
||||
end
|
||||
|
||||
local circleCenter = STATIC:FindByName( "CircleCenterContainer", true ):GetCoordinate()
|
||||
targetcircle( circleCenter )
|
||||
targetcircle( circleCenter, 250, nil, "outerCircle" )
|
||||
|
||||
MESSAGE:New( "Containers are in place now", 35, "INFO" ):ToAll():ToLog()
|
||||
---
|
||||
-- Author: buur
|
||||
-- Created: 29.02.2024
|
||||
-- Contributors: kaltokri
|
||||
-- Modified: 01.03.2024
|
||||
--
|
||||
-- # Documentation:
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.SpawnStatic.html
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Static.html
|
||||
--
|
||||
-- # Description:
|
||||
--
|
||||
-- In this mission we search for a placed container with the UNIT name CircleCenterContainer.
|
||||
-- Around this object we create two circles with containers to mark the target area.
|
||||
-- NOTE: Instead of a STATIC object you can also use other objects (like UNITS) to define the center position!
|
||||
--
|
||||
-- # Guide:
|
||||
--
|
||||
-- 1. Start the mission and take a look at the placed containers.
|
||||
|
||||
--- Creates a circle with static objects around a given coordinate.
|
||||
-- @param Core.Point#COORDINATE circleCenter The coordinate for the center of the circle.
|
||||
-- @param #number radius (Optional) The radius of the circle. Default 150.
|
||||
-- @param #number step (Optional) The distance in degrees between the objects. Default 15.
|
||||
-- @param #string prefix (Optional) The prefix for the name of the STATIC objects. Default is innerCircle.
|
||||
-- @param #string category (Optional) The category of the STATIC object to use. Default is Fortifications.
|
||||
-- @param #string staticType (Optional) The type of the STATIC object to use. Default is container_40ft.
|
||||
-- @param #string staticShape (Optional) The shape of the STATIC object to use. Default is container_40ft.
|
||||
-- @param #string staticLivery (Optional) The livery name of the STATIC object to use. Default is summer.
|
||||
function targetcircle( circleCenter, radius, step, prefix, category, staticType, staticShape, staticLivery )
|
||||
local circleCenter = circleCenter
|
||||
local radius = radius or 150
|
||||
local step = step or 15
|
||||
local prefix = prefix or "innerCircle" -- Must be unique!
|
||||
local category = category or "Fortifications"
|
||||
local staticType = statictype or "container_40ft"
|
||||
local staticShape = staticshape or "container_40ft"
|
||||
local staticLivery = staticlivery or "summer"
|
||||
|
||||
for angle = 0, 360-step , step do
|
||||
local name = string.format( "%s#%f", prefix, angle )
|
||||
local circle = circleCenter:Translate( radius, angle, false, false )
|
||||
SPAWNSTATIC
|
||||
:NewFromType( staticType, category )
|
||||
:InitCoordinate( circle )
|
||||
:InitLivery( staticLivery )
|
||||
:InitHeading( angle )
|
||||
:InitShape( staticShape )
|
||||
:Spawn( nil, name )
|
||||
end
|
||||
end
|
||||
|
||||
local circleCenter = STATIC:FindByName( "CircleCenterContainer", true ):GetCoordinate()
|
||||
targetcircle( circleCenter )
|
||||
targetcircle( circleCenter, 250, nil, "outerCircle" )
|
||||
|
||||
MESSAGE:New( "Containers are in place now", 35, "INFO" ):ToAll():ToLog()
|
||||
|
||||
Binary file not shown.
@@ -1,77 +1,77 @@
|
||||
---
|
||||
-- Author: Unknown
|
||||
-- Created: Unknown
|
||||
-- Contributors: kaltokri
|
||||
-- Modified: 01.03.2024
|
||||
--
|
||||
-- # Documentation:
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.SpawnStatic.html
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Static.html
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Zone.html
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Airbase.html
|
||||
--
|
||||
-- # Description:
|
||||
--
|
||||
-- This demo shows how to dynamically spawn FARPs into a mission.
|
||||
--
|
||||
-- We spawn two FARPS in a zone near Batumi.
|
||||
-- The first FARP is named "FARP Berlin" and the second "FARP London".
|
||||
-- We put colored smoke on the spawned objects to mark them.
|
||||
--
|
||||
-- The data is taken from "template" FARPS. Note that if the same
|
||||
-- name as the template is used, the original object is despawned
|
||||
-- automatically when the new object is spawned.
|
||||
--
|
||||
-- As FARPS in DCS are strange creatures, which are hybrids of groups
|
||||
-- and statics, the function :InitFARP is necessary.
|
||||
--
|
||||
-- # Guide:
|
||||
--
|
||||
-- 1. Start the mission and watch the created FARPs.
|
||||
|
||||
|
||||
-- Zone near Batumi on land.
|
||||
local zoneSpawn1 = ZONE:FindByName( "SpawnZone1" )
|
||||
local zoneSpawn2 = ZONE:FindByName( "SpawnZone2" )
|
||||
|
||||
-- Create a SPAWNSTATIC object from a template static FARP object.
|
||||
local spawnStaticFarp = SPAWNSTATIC:NewFromStatic( "Static FARP Template-1", country.id.GERMANY )
|
||||
|
||||
-- Spawning FARPS is special in DCS. Therefore, we need to specify that this is a FARP.
|
||||
-- We also set the call sign and the frequency.
|
||||
spawnStaticFarp:InitFARP( CALLSIGN.FARP.Berlin, 130.000, 0 )
|
||||
|
||||
-- Spawn FARP with heading 90°. It's name will be "FARP Berlin".
|
||||
local farpBerlin = spawnStaticFarp:SpawnFromZone( zoneSpawn1, 90, "FARP Berlin" )
|
||||
|
||||
-- Smoke static green.
|
||||
farpBerlin:GetCoordinate():SmokeGreen()
|
||||
|
||||
|
||||
-- The second FAPR gets call sign London and used radio frequency 131 MHz.
|
||||
spawnStaticFarp:InitFARP( CALLSIGN.FARP.London, 131.000, 0 )
|
||||
|
||||
-- We set the country to UK.
|
||||
spawnStaticFarp:InitCountry( country.id.UK )
|
||||
|
||||
-- Spawn the FARP at a random location inside the zone.
|
||||
local FarpLondon = spawnStaticFarp:SpawnFromCoordinate( zoneSpawn2:GetRandomCoordinate(), nil, "FARP London" )
|
||||
|
||||
-- Put red smoke at FARP London.
|
||||
FarpLondon:GetCoordinate():SmokeRed()
|
||||
|
||||
|
||||
-- Function to check if the STATIC/AIRBASE objects can be found.
|
||||
local function check()
|
||||
-- Try to find static.
|
||||
local staticBerlin = STATIC:FindByName( "FARP Berlin" )
|
||||
|
||||
-- Launch red flare.
|
||||
staticBerlin:GetCoordinate():FlareRed()
|
||||
|
||||
-- Get the airbase object and mark the parking spots.
|
||||
local AirbaseBerlin = AIRBASE:FindByName("FARP Berlin")
|
||||
AirbaseBerlin:MarkParkingSpots()
|
||||
end
|
||||
|
||||
TIMER:New( check ):Start( 2, 5 )
|
||||
---
|
||||
-- Author: Unknown
|
||||
-- Created: Unknown
|
||||
-- Contributors: kaltokri
|
||||
-- Modified: 01.03.2024
|
||||
--
|
||||
-- # Documentation:
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.SpawnStatic.html
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Static.html
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Zone.html
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Airbase.html
|
||||
--
|
||||
-- # Description:
|
||||
--
|
||||
-- This demo shows how to dynamically spawn FARPs into a mission.
|
||||
--
|
||||
-- We spawn two FARPS in a zone near Batumi.
|
||||
-- The first FARP is named "FARP Berlin" and the second "FARP London".
|
||||
-- We put colored smoke on the spawned objects to mark them.
|
||||
--
|
||||
-- The data is taken from "template" FARPS. Note that if the same
|
||||
-- name as the template is used, the original object is despawned
|
||||
-- automatically when the new object is spawned.
|
||||
--
|
||||
-- As FARPS in DCS are strange creatures, which are hybrids of groups
|
||||
-- and statics, the function :InitFARP is necessary.
|
||||
--
|
||||
-- # Guide:
|
||||
--
|
||||
-- 1. Start the mission and watch the created FARPs.
|
||||
|
||||
|
||||
-- Zone near Batumi on land.
|
||||
local zoneSpawn1 = ZONE:FindByName( "SpawnZone1" )
|
||||
local zoneSpawn2 = ZONE:FindByName( "SpawnZone2" )
|
||||
|
||||
-- Create a SPAWNSTATIC object from a template static FARP object.
|
||||
local spawnStaticFarp = SPAWNSTATIC:NewFromStatic( "Static FARP Template-1", country.id.GERMANY )
|
||||
|
||||
-- Spawning FARPS is special in DCS. Therefore, we need to specify that this is a FARP.
|
||||
-- We also set the call sign and the frequency.
|
||||
spawnStaticFarp:InitFARP( CALLSIGN.FARP.Berlin, 130.000, 0 )
|
||||
|
||||
-- Spawn FARP with heading 90°. It's name will be "FARP Berlin".
|
||||
local farpBerlin = spawnStaticFarp:SpawnFromZone( zoneSpawn1, 90, "FARP Berlin" )
|
||||
|
||||
-- Smoke static green.
|
||||
farpBerlin:GetCoordinate():SmokeGreen()
|
||||
|
||||
|
||||
-- The second FAPR gets call sign London and used radio frequency 131 MHz.
|
||||
spawnStaticFarp:InitFARP( CALLSIGN.FARP.London, 131.000, 0 )
|
||||
|
||||
-- We set the country to UK.
|
||||
spawnStaticFarp:InitCountry( country.id.UK )
|
||||
|
||||
-- Spawn the FARP at a random location inside the zone.
|
||||
local FarpLondon = spawnStaticFarp:SpawnFromCoordinate( zoneSpawn2:GetRandomCoordinate(), nil, "FARP London" )
|
||||
|
||||
-- Put red smoke at FARP London.
|
||||
FarpLondon:GetCoordinate():SmokeRed()
|
||||
|
||||
|
||||
-- Function to check if the STATIC/AIRBASE objects can be found.
|
||||
local function check()
|
||||
-- Try to find static.
|
||||
local staticBerlin = STATIC:FindByName( "FARP Berlin" )
|
||||
|
||||
-- Launch red flare.
|
||||
staticBerlin:GetCoordinate():FlareRed()
|
||||
|
||||
-- Get the airbase object and mark the parking spots.
|
||||
local AirbaseBerlin = AIRBASE:FindByName("FARP Berlin")
|
||||
AirbaseBerlin:MarkParkingSpots()
|
||||
end
|
||||
|
||||
TIMER:New( check ):Start( 2, 5 )
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user