Skip to content

Commit 04faf6f

Browse files
committed
create new Syria map template
1 parent d93c898 commit 04faf6f

File tree

17 files changed

+10082
-1
lines changed

17 files changed

+10082
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
"url": "git+https://github.com/VEAF/VEAF-Demo-Mission"
1111
},
1212
"dependencies": {
13-
"veaf-mission-creation-tools": "^2.11.1"
13+
"veaf-mission-creation-tools": "^2.14.0"
1414
}
1515
}
1.34 MB
Binary file not shown.

templates/Syria/build.cmd

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
@echo off
2+
set MISSION_NAME=TEMPLATE_Syria
3+
echo.
4+
echo ----------------------------------------
5+
echo building %MISSION_NAME%
6+
echo ----------------------------------------
7+
echo.
8+
9+
rem -- default options values
10+
echo This script can use these environment variables to customize its behavior :
11+
echo ----------------------------------------
12+
echo VERBOSE_LOG_FLAG if set to "true", will create a mission with tracing enabled (meaning that, when run, it will log a lot of details in the dcs log file)
13+
echo defaults to "false"
14+
IF [%VERBOSE_LOG_FLAG%] == [] GOTO DefineDefaultVERBOSE_LOG_FLAG
15+
goto DontDefineDefaultVERBOSE_LOG_FLAG
16+
:DefineDefaultVERBOSE_LOG_FLAG
17+
set VERBOSE_LOG_FLAG=false
18+
:DontDefineDefaultVERBOSE_LOG_FLAG
19+
echo current value is "%VERBOSE_LOG_FLAG%"
20+
21+
echo ----------------------------------------
22+
echo LUA_SCRIPTS_DEBUG_PARAMETER can be set to "-debug" or "-trace" (or not set) ; this will be passed to the lua helper scripts (e.g. veafMissionRadioPresetsEditor and veafMissionNormalizer)
23+
echo defaults to not set
24+
IF [%LUA_SCRIPTS_DEBUG_PARAMETER%] == [] GOTO DefineDefaultLUA_SCRIPTS_DEBUG_PARAMETER
25+
goto DontDefineDefaultLUA_SCRIPTS_DEBUG_PARAMETER
26+
:DefineDefaultLUA_SCRIPTS_DEBUG_PARAMETER
27+
set LUA_SCRIPTS_DEBUG_PARAMETER=
28+
:DontDefineDefaultLUA_SCRIPTS_DEBUG_PARAMETER
29+
echo current value is "%LUA_SCRIPTS_DEBUG_PARAMETER%"
30+
31+
echo ----------------------------------------
32+
echo SECURITY_DISABLED_FLAG if set to "true", will create a mission with security disabled (meaning that no password is ever required)
33+
echo defaults to "false"
34+
IF [%SECURITY_DISABLED_FLAG%] == [] GOTO DefineDefaultSECURITY_DISABLED_FLAG
35+
goto DontDefineDefaultSECURITY_DISABLED_FLAG
36+
:DefineDefaultSECURITY_DISABLED_FLAG
37+
set SECURITY_DISABLED_FLAG=false
38+
:DontDefineDefaultSECURITY_DISABLED_FLAG
39+
echo current value is "%SECURITY_DISABLED_FLAG%"
40+
41+
echo ----------------------------------------
42+
echo MISSION_FILE_SUFFIX (a string) will be appended to the mission file name to make it more unique
43+
echo defaults to the current iso date
44+
IF [%MISSION_FILE_SUFFIX%] == [] GOTO DefineDefaultMISSION_FILE_SUFFIX
45+
goto DontDefineDefaultMISSION_FILE_SUFFIX
46+
:DefineDefaultMISSION_FILE_SUFFIX
47+
set TIMEBUILD=%TIME: =0%
48+
set MISSION_FILE_SUFFIX=%date:~-4,4%%date:~-7,2%%date:~-10,2%
49+
:DontDefineDefaultMISSION_FILE_SUFFIX
50+
set MISSION_FILE=.\build\%MISSION_NAME%_%MISSION_FILE_SUFFIX%
51+
echo current value is "%MISSION_FILE_SUFFIX%"
52+
53+
echo ----------------------------------------
54+
echo SEVENZIP (a string) points to the 7za executable
55+
echo defaults "7za", so it needs to be in the path
56+
IF ["%SEVENZIP%"] == [""] GOTO DefineDefaultSEVENZIP
57+
goto DontDefineDefaultSEVENZIP
58+
:DefineDefaultSEVENZIP
59+
set SEVENZIP=7za
60+
:DontDefineDefaultSEVENZIP
61+
echo current value is "%SEVENZIP%"
62+
63+
echo ----------------------------------------
64+
echo LUA (a string) points to the lua executable
65+
echo defaults "lua", so it needs to be in the path
66+
IF ["%LUA%"] == [""] GOTO DefineDefaultLUA
67+
goto DontDefineDefaultLUA
68+
:DefineDefaultLUA
69+
set LUA=lua
70+
:DontDefineDefaultLUA
71+
echo current value is "%LUA%"
72+
73+
echo ----------------------------------------
74+
echo DYNAMIC_MISSION_PATH (a string) points to folder where this mission is located
75+
echo defaults this folder
76+
IF ["%DYNAMIC_MISSION_PATH%"] == [""] GOTO DefineDefaultDYNAMIC_MISSION_PATH
77+
goto DontDefineDefaultDYNAMIC_MISSION_PATH
78+
:DefineDefaultDYNAMIC_MISSION_PATH
79+
set DYNAMIC_MISSION_PATH=%~dp0
80+
:DontDefineDefaultDYNAMIC_MISSION_PATH
81+
echo current value is "%DYNAMIC_MISSION_PATH%"
82+
83+
echo ----------------------------------------
84+
echo DYNAMIC_SCRIPTS_PATH (a string) points to folder where the VEAF-mission-creation-tools are located
85+
echo defaults this folder
86+
IF ["%DYNAMIC_SCRIPTS_PATH%"] == [""] GOTO DefineDefaultDYNAMIC_SCRIPTS_PATH
87+
goto DontDefineDefaultDYNAMIC_SCRIPTS_PATH
88+
:DefineDefaultDYNAMIC_SCRIPTS_PATH
89+
set DYNAMIC_SCRIPTS_PATH=%~dp0node_modules\veaf-mission-creation-tools\
90+
:DontDefineDefaultDYNAMIC_SCRIPTS_PATH
91+
echo current value is "%DYNAMIC_SCRIPTS_PATH%"
92+
93+
echo ----------------------------------------
94+
95+
echo.
96+
echo prepare the folders
97+
rd /s /q .\build
98+
mkdir .\build
99+
100+
echo.
101+
echo fetch the veaf-mission-creation-tools package
102+
call npm update
103+
rem echo on
104+
105+
echo.
106+
echo prepare the veaf-mission-creation-tools scripts
107+
rem -- copy the scripts folder
108+
xcopy /s /y /e .\node_modules\veaf-mission-creation-tools\src\scripts\* .\build\tempscripts\ >nul 2>&1
109+
110+
rem -- set the flags in the scripts according to the options
111+
echo set the flags in the scripts according to the options
112+
powershell -Command "(gc .\build\tempscripts\veaf\veaf.lua) -replace 'veaf.Development = false', 'veaf.Development = %VERBOSE_LOG_FLAG%' | sc .\build\tempscripts\veaf\veaf.lua" >nul 2>&1
113+
powershell -Command "(gc .\build\tempscripts\veaf\veaf.lua) -replace 'veaf.SecurityDisabled = false', 'veaf.SecurityDisabled = %SECURITY_DISABLED_FLAG%' | sc .\build\tempscripts\veaf\veaf.lua" >nul 2>&1
114+
115+
rem -- comment all the trace and debug code
116+
echo comment all the trace and debug code
117+
FOR %%f IN (.\build\tempscripts\veaf\*.lua) DO powershell -Command "(gc %%f) -replace '(^\s*)(veaf.*\.[^\(^\s]*log(Trace|Debug))', '$1--$2' | sc %%f" >nul 2>&1
118+
119+
echo building the mission
120+
rem -- copy all the source mission files and mission-specific scripts
121+
xcopy /y /e src\mission .\build\tempsrc\ >nul 2>&1
122+
xcopy /y src\options .\build\tempsrc\ >nul 2>&1
123+
xcopy /y /e src\scripts\*.lua .\build\tempsrc\l10n\Default\ >nul 2>&1
124+
125+
rem -- set the radio presets according to the settings file
126+
echo set the radio presets according to the settings file
127+
pushd node_modules\veaf-mission-creation-tools\src\scripts\veaf
128+
"%LUA%" veafMissionRadioPresetsEditor.lua ..\..\..\..\..\build\tempsrc ..\..\..\..\..\src\radio\radioSettings.lua %LUA_SCRIPTS_DEBUG_PARAMETER% >nul 2>&1
129+
popd
130+
131+
rem -- set the dynamic load variables in the dictionary
132+
echo set the dynamic load variables in the dictionary
133+
powershell -Command "$temp='VEAF_DYNAMIC_PATH = [[' + [regex]::escape('%DYNAMIC_SCRIPTS_PATH%') + ']]'; (gc .\build\tempsrc\l10n\DEFAULT\dictionary) -replace 'VEAF_DYNAMIC_PATH(\s*)=(\s*)\[\[.*\]\]', $temp | sc .\build\tempsrc\l10n\DEFAULT\dictionary" >nul 2>&1
134+
powershell -Command "$temp='VEAF_DYNAMIC_MISSIONPATH = [[' + [regex]::escape('%DYNAMIC_MISSION_PATH%') + ']]'; (gc .\build\tempsrc\l10n\DEFAULT\dictionary) -replace 'VEAF_DYNAMIC_MISSIONPATH(\s*)=(\s*)\[\[.*\]\]', $temp | sc .\build\tempsrc\l10n\DEFAULT\dictionary" >nul 2>&1
135+
136+
rem -- copy the documentation images to the kneeboard
137+
xcopy /y /e doc\*.jpg .\build\tempsrc\KNEEBOARD\IMAGES\ >nul 2>&1
138+
139+
rem -- copy all the community scripts
140+
copy .\src\scripts\community\*.lua .\build\tempsrc\l10n\Default >nul 2>&1
141+
copy .\build\tempscripts\community\*.lua .\build\tempsrc\l10n\Default >nul 2>&1
142+
143+
rem -- copy all the common scripts
144+
copy .\build\tempscripts\veaf\*.lua .\build\tempsrc\l10n\Default >nul 2>&1
145+
146+
rem -- normalize the mission files
147+
pushd node_modules\veaf-mission-creation-tools\src\scripts\veaf
148+
"%LUA%" veafMissionNormalizer.lua ..\..\..\..\..\build\tempsrc %LUA_SCRIPTS_DEBUG_PARAMETER%
149+
popd
150+
151+
rem -- compile the mission
152+
"%SEVENZIP%" a -r -tzip %MISSION_FILE%.miz .\build\tempsrc\* -mem=AES256 >nul 2>&1
153+
154+
rem -- cleanup the mission files
155+
rd /s /q .\build\tempsrc
156+
157+
rem -- cleanup the veaf-mission-creation-tools scripts
158+
rd /s /q .\build\tempscripts
159+
160+
rem -- generate the time and weather versions
161+
echo generate the time and weather versions
162+
echo ----------------------------------------
163+
node node_modules\veaf-mission-creation-tools\src\nodejs\app.js injectall --quiet "%MISSION_FILE%.miz" "%MISSION_FILE%-${version}.miz" src\weatherAndTime\versions.json
164+
165+
echo.
166+
echo ----------------------------------------
167+
rem -- done !
168+
echo Built %MISSION_FILE%.miz
169+
echo ----------------------------------------
170+
171+
pause

templates/Syria/extract.cmd

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
@echo off
2+
set MISSION_NAME=TEMPLATE_Syria
3+
echo.
4+
echo ----------------------------------------
5+
echo extracting %MISSION_NAME%
6+
echo ----------------------------------------
7+
echo.
8+
9+
rem -- default options values
10+
echo This script can use these environment variables to customize its behavior :
11+
12+
echo ----------------------------------------
13+
echo LUA_SCRIPTS_DEBUG_PARAMETER can be set to "-debug" or "-trace" (or not set) ; this will be passed to the lua helper scripts (e.g. veafMissionRadioPresetsEditor and veafMissionNormalizer)
14+
echo defaults to not set
15+
IF [%LUA_SCRIPTS_DEBUG_PARAMETER%] == [] GOTO DefineDefaultLUA_SCRIPTS_DEBUG_PARAMETER
16+
goto DontDefineDefaultLUA_SCRIPTS_DEBUG_PARAMETER
17+
:DefineDefaultLUA_SCRIPTS_DEBUG_PARAMETER
18+
set LUA_SCRIPTS_DEBUG_PARAMETER=
19+
:DontDefineDefaultLUA_SCRIPTS_DEBUG_PARAMETER
20+
echo current value is "%LUA_SCRIPTS_DEBUG_PARAMETER%"
21+
22+
echo ----------------------------------------
23+
echo SEVENZIP (a string) points to the 7za executable
24+
echo defaults "7za", so it needs to be in the path
25+
IF [%SEVENZIP%] == [] GOTO DefineDefaultSEVENZIP
26+
goto DontDefineDefaultSEVENZIP
27+
:DefineDefaultSEVENZIP
28+
set SEVENZIP=7za
29+
:DontDefineDefaultSEVENZIP
30+
echo current value is "%SEVENZIP%"
31+
32+
echo ----------------------------------------
33+
echo LUA (a string) points to the lua executable
34+
echo defaults "lua", so it needs to be in the path
35+
IF [%LUA%] == [] GOTO DefineDefaultLUA
36+
goto DontDefineDefaultLUA
37+
:DefineDefaultLUA
38+
set LUA=lua
39+
:DontDefineDefaultLUA
40+
echo current value is "%LUA%"
41+
echo ----------------------------------------
42+
43+
echo.
44+
echo fetching the veaf-mission-creation-tools package
45+
call npm update
46+
rem echo on
47+
48+
rem extracting MIZ files
49+
echo extracting MIZ files
50+
set MISSION_PATH=%cd%\src\mission
51+
"%SEVENZIP%" x -y *%MISSION_NAME%*.miz -o"%MISSION_PATH%\"
52+
53+
rem -- set the loading to static in the mission file
54+
echo set the loading to static in the mission file
55+
powershell -Command "(gc %MISSION_PATH%\l10n\Default\dictionary) -replace 'return(\s*[^\s]+\s*)--true=dynamic, false=static', 'return false --true=dynamic, false=static' | sc %MISSION_PATH%\l10n\Default\dictionary"
56+
57+
rem removing unwanted elements
58+
echo removing unwanted elements
59+
del /f /q "%MISSION_PATH%\l10n\Default\*.lua"
60+
del /f /q "%MISSION_PATH%\options"
61+
rd /s /q "%MISSION_PATH%\Config"
62+
rd /s /q "%MISSION_PATH%\Scripts"
63+
rd /s /q "%MISSION_PATH%\track"
64+
rd /s /q "%MISSION_PATH%\track_data"
65+
66+
rem setting the radio presets according to the settings file
67+
echo setting the radio presets according to the settings file
68+
pushd node_modules\veaf-mission-creation-tools\src\scripts\veaf
69+
"%LUA%" veafMissionRadioPresetsEditor.lua "%MISSION_PATH%" "%MISSION_PATH%\..\radio\radioSettings.lua" %LUA_SCRIPTS_DEBUG_PARAMETER%
70+
popd
71+
72+
rem normalizing the mission files
73+
echo normalizing the mission files
74+
pushd node_modules\veaf-mission-creation-tools\src\scripts\veaf
75+
"%LUA%" veafMissionNormalizer.lua "%MISSION_PATH%" %LUA_SCRIPTS_DEBUG_PARAMETER%
76+
popd
77+
78+
rem -- cleanup
79+
rem del *%MISSION_NAME%*.miz
80+
81+
echo.
82+
echo ----------------------------------------
83+
rem -- done !
84+
echo Extracted %MISSION_NAME%
85+
echo ----------------------------------------
86+
87+
pause

templates/Syria/package.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "veaf-open-training-mission-sr",
3+
"version": "1.0.0",
4+
"description": "OpenTraining mission in the Syria map",
5+
"main": "",
6+
"author": "Zip",
7+
"license": "MIT",
8+
"repository": {
9+
"type": "git",
10+
"url": "git+https://github.com/VEAF-Open-Training-Mission.git"
11+
},
12+
"dependencies": {
13+
"veaf-mission-creation-tools": "^2.14.1"
14+
}
15+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
dictionary = {
2+
["DictKey_ActionText_383"] = "env.info(\"DYNAMIC CONFIGURATION\")\
3+
local script = VEAF_DYNAMIC_MISSIONPATH .. \"/src/scripts/missionConfig.lua\"\
4+
assert(loadfile(script))()\
5+
",
6+
["DictKey_ActionText_384"] = "VEAF_DYNAMIC_PATH = [[D:\\dev\\_VEAF\\VEAF-Demo-Mission\\templates\\Syria\\node_modules\\veaf-mission-creation-tools\\]]",
7+
["DictKey_ActionText_385"] = "return VEAF_DYNAMIC_PATH~=nil",
8+
["DictKey_ActionText_386"] = "return VEAF_DYNAMIC_PATH==nil",
9+
["DictKey_ActionText_445"] = "return false --true=dynamic, false=static",
10+
["DictKey_ActionText_468"] = "env.info(\"DYNAMIC LOADING\")\
11+
",
12+
["DictKey_ActionText_492"] = "return VEAF_DYNAMIC_PATH~=nil",
13+
["DictKey_ActionText_493"] = "return VEAF_DYNAMIC_PATH==nil",
14+
["DictKey_ActionText_581"] = "local script = VEAF_DYNAMIC_PATH .. \"/src/scripts/community/mist.lua\"\
15+
assert(loadfile(script))()\
16+
",
17+
["DictKey_ActionText_582"] = "local script = VEAF_DYNAMIC_PATH .. \"/src//scripts/VeafDynamicLoader.lua\"\
18+
assert(loadfile(script))()\
19+
",
20+
["DictKey_ActionText_583"] = "local script = VEAF_DYNAMIC_PATH .. \"/src//scripts/community/Moose.lua\"\
21+
assert(loadfile(script))()\
22+
",
23+
["DictKey_ActionText_584"] = "local script = VEAF_DYNAMIC_PATH .. \"/src//scripts/community/CTLD.lua\"\
24+
assert(loadfile(script))()\
25+
",
26+
["DictKey_ActionText_585"] = "local script = VEAF_DYNAMIC_PATH .. \"/src//scripts/community/WeatherMark.lua\"\
27+
assert(loadfile(script))()\
28+
",
29+
["DictKey_ActionText_586"] = "local script = VEAF_DYNAMIC_PATH .. \"/src//scripts/community/NIOD.lua\"\
30+
assert(loadfile(script))()\
31+
",
32+
["DictKey_ActionText_614"] = "VEAF_DYNAMIC_MISSIONPATH = [[D:\\dev\\_VEAF\\VEAF-Demo-Mission\\templates\\Syria\\]]",
33+
["DictKey_descriptionBlueTask_3"] = "",
34+
["DictKey_descriptionNeutralsTask_4"] = "",
35+
["DictKey_descriptionRedTask_2"] = "",
36+
["DictKey_descriptionText_1"] = "Demonstration mission for VEAF-Mission-Creation-Tools\
37+
Weather : UGKO 221130Z 24011KT 9999 SCT034 OVC063 23/15 Q1006 NOSIG",
38+
["DictKey_sortie_5"] = "",
39+
} -- end of dictionary
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
mapResource = {
2+
["ResKey_Action_382"] = "missionConfig.lua",
3+
["ResKey_Action_473"] = "mist.lua",
4+
["ResKey_Action_474"] = "dcsUnits.lua",
5+
["ResKey_Action_475"] = "veafAssets.lua",
6+
["ResKey_Action_476"] = "veafCarrierOperations.lua",
7+
["ResKey_Action_477"] = "veafCasMission.lua",
8+
["ResKey_Action_478"] = "veafCombatZone.lua",
9+
["ResKey_Action_479"] = "veafGrass.lua",
10+
["ResKey_Action_480"] = "veafMarkers.lua",
11+
["ResKey_Action_481"] = "veafMove.lua",
12+
["ResKey_Action_482"] = "veafNamedPoints.lua",
13+
["ResKey_Action_483"] = "veafRadio.lua",
14+
["ResKey_Action_484"] = "veafSecurity.lua",
15+
["ResKey_Action_485"] = "veafSpawn.lua",
16+
["ResKey_Action_486"] = "veafTransportMission.lua",
17+
["ResKey_Action_487"] = "veafUnits.lua",
18+
["ResKey_Action_488"] = "veafShortcuts.lua",
19+
["ResKey_Action_489"] = "veafInterpreter.lua",
20+
["ResKey_Action_490"] = "veafCombatMission.lua",
21+
["ResKey_Action_494"] = "veafCarrierOperations2.lua",
22+
["ResKey_Action_615"] = "Moose.lua",
23+
["ResKey_Action_616"] = "CTLD.lua",
24+
["ResKey_Action_617"] = "WeatherMark.lua",
25+
["ResKey_Action_618"] = "NIOD.lua",
26+
["ResKey_Action_619"] = "veaf.lua",
27+
["ResKey_Action_620"] = "veafRemote.lua",
28+
} -- end of mapResource

0 commit comments

Comments
 (0)