mirror of
https://github.com/FlightControl-Master/MOOSE_MISSIONS.git
synced 2025-08-15 10:37:46 +00:00
Add files via upload
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
-------------------------------------------------------------------------
|
||||
-- SET-SCENERY-100 - Scenery Set From Zone
|
||||
-------------------------------------------------------------------------
|
||||
-- Documentation
|
||||
--
|
||||
-- SET_SCENERY: https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Set.html##(SET_SCENERY)
|
||||
--
|
||||
-------------------------------------------------------------------------
|
||||
-- Join the game master slot initially, and then the Tank in
|
||||
-- Combined Arms after a few seconds. Shoot and destroy on of the tanks
|
||||
-- ahead.
|
||||
-------------------------------------------------------------------------
|
||||
-- Date: November 2022
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
-- Get our ZONE object and draw it
|
||||
local zone = ZONE:FindByName("OilTankZone")
|
||||
zone:DrawZone(-1,{0,0,1},nil,nil,nil,1)
|
||||
-- Create a SET_SCENERY from the map objects in the zone
|
||||
local oilstation = SET_SCENERY:NewFromZone(zone)
|
||||
-- we'll use this SET for further filtering
|
||||
local oiltanks = SET_SCENERY:New()
|
||||
|
||||
-- An Airbase has a lot of map objects, but we only want to have tanks
|
||||
oilstation:ForEachScenery(
|
||||
function(object)
|
||||
local scenery = object --Wrapper.Scenery#SCENERY
|
||||
local name = scenery:GetName()
|
||||
local desc = scenery:GetDesc()
|
||||
BASE:I({desc.typeName})
|
||||
if string.find(string.lower(desc.typeName),"tank") then
|
||||
oiltanks:AddObject(scenery)
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
-- Count how many we have
|
||||
local NumberTanks0 = oiltanks:CountAlive()
|
||||
-- user flag OilTanks will be zero initially
|
||||
local flag = USERFLAG:New("OilTanks")
|
||||
flag:Set(0)
|
||||
|
||||
-- Function to check number of alive tanks regularly
|
||||
function CheckOnOilTanks(TankSet,InitialNo,Threshold)
|
||||
local NumberTanks = TankSet:CountAlive()
|
||||
MESSAGE:New("Oil Tanks alive: "..NumberTanks,15,"OilTanks"):ToAll()
|
||||
if NumberTanks <= InitialNo*Threshold then
|
||||
-- Success!
|
||||
MESSAGE:New("Success! Oil Tanks have been diminished!",15,"OilTanks"):ToAll()
|
||||
-- Set a Flag in Mission Editor
|
||||
flag:Set(999)
|
||||
end
|
||||
end
|
||||
|
||||
-- Create a timer to run the check function
|
||||
local TankTimer = TIMER:New(CheckOnOilTanks,oiltanks,NumberTanks0,0.2)
|
||||
-- check every minute
|
||||
TankTimer:Start(10,30,3600)
|
||||
Binary file not shown.
@@ -0,0 +1,10 @@
|
||||
$dir = split-path -parent $MyInvocation.MyCommand.Definition
|
||||
cd $dir
|
||||
$file = Split-Path $dir -leaf
|
||||
|
||||
$dir
|
||||
$file
|
||||
|
||||
cd "_unpacked"
|
||||
. 7z a -r -y -tzip "..\$file.miz" *
|
||||
cd ..
|
||||
@@ -0,0 +1,7 @@
|
||||
$dir = split-path -parent $MyInvocation.MyCommand.Definition
|
||||
cd $dir
|
||||
$file = Split-Path $dir -leaf
|
||||
Remove-Item .\_unpacked -Force -Recurse
|
||||
md "_unpacked"
|
||||
cd "_unpacked"
|
||||
. 7z x -r -y "..\$file.miz" *
|
||||
Reference in New Issue
Block a user