mirror of
https://github.com/FlightControl-Master/MOOSE_Demos.git
synced 2025-08-15 10:37:47 +00:00
Create a mission for every terrain to get Airbase.Wrapper data
This commit is contained in:
parent
1b2aef4224
commit
c7cb9ca869
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Wrapper/Airbase/900-Airbase-data/AFB-900-Airbase-data-Nevada.miz
Normal file
BIN
Wrapper/Airbase/900-Airbase-data/AFB-900-Airbase-data-Nevada.miz
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Wrapper/Airbase/900-Airbase-data/AFB-900-Airbase-data-Sinai.miz
Normal file
BIN
Wrapper/Airbase/900-Airbase-data/AFB-900-Airbase-data-Sinai.miz
Normal file
Binary file not shown.
BIN
Wrapper/Airbase/900-Airbase-data/AFB-900-Airbase-data-Syria.miz
Normal file
BIN
Wrapper/Airbase/900-Airbase-data/AFB-900-Airbase-data-Syria.miz
Normal file
Binary file not shown.
@ -9,7 +9,10 @@
|
||||
--
|
||||
-- # Description:
|
||||
--
|
||||
-- This mission can be used to create data for the Wrapper.Airbase class.
|
||||
-- This script can be used to create data for the Wrapper.Airbase class.
|
||||
-- Create an empty mission with the terrain you want the data for.
|
||||
-- Add Moose and this script.
|
||||
-- Or use one of the already created missions in this folder.
|
||||
--
|
||||
-- NOTE: io & lfs must be desanitized for this mission to work!
|
||||
--
|
||||
@ -18,8 +21,8 @@
|
||||
-- 1. Start the mission.
|
||||
-- 2. When you see the message "Wrapper.Airbase data written..." you can quit the mission.
|
||||
-- 3. Open your "Saved Games\DCS\Missions" folder.
|
||||
-- 4. The file airbase-normandy.txt should be saved there and contain all needed data.
|
||||
-- 5. This date can be used to replace the specific parts of Wrapper.Airbase.lua
|
||||
-- 4. The file airbase-<terrain>.txt should be saved there and contain all needed data.
|
||||
-- 5. This data can be used to replace the specific parts of Wrapper.Airbase.lua
|
||||
|
||||
-- Create a SET with all airbase of this map.
|
||||
local bases = SET_AIRBASE:New():FilterOnce()
|
||||
@ -27,13 +30,15 @@ local bases = SET_AIRBASE:New():FilterOnce()
|
||||
local Airbases1 = {}
|
||||
local Airbases2 = {}
|
||||
|
||||
local terrainName = UTILS.GetDCSMap()
|
||||
|
||||
bases:ForEachAirbase(
|
||||
function(afb)
|
||||
local ab = afb -- Wrapper.Airbase#AIRBASE
|
||||
local name = ab:GetName()
|
||||
local nice = string.gsub(name,"([%s%c%p]+","_")
|
||||
local text1 = string.format(' ["%s"] = "%s",',nice,name)
|
||||
local text2 = string.format('-- * AIRBASE.Normandy.%s',nice)
|
||||
local nice = string.gsub( name, "([%s%c%p]+", "_" )
|
||||
local text1 = string.format( ' ["%s"] = "%s",', nice, name )
|
||||
local text2 = string.format( '-- * AIRBASE.%s.%s', terrainName, nice )
|
||||
MESSAGE:New(nice, 10):ToLog()
|
||||
Airbases1[nice] = text1
|
||||
Airbases2[nice] = text2
|
||||
@ -60,7 +65,7 @@ for _, k in ipairs(tkeys2) do
|
||||
list2 = list2 .. Airbases2[k] .. "\n"
|
||||
end
|
||||
|
||||
filename = lfs.writedir() ..[[Missions\airbase-normandy.txt]]
|
||||
filename = lfs.writedir() .."Missions\\airbase-" .. terrainName .. ".txt"
|
||||
filehandle = io.open( filename, "w")
|
||||
filehandle:write(list1)
|
||||
filehandle:write(list2)
|
||||
Loading…
x
Reference in New Issue
Block a user