Skip to content

Commit cd50fb4

Browse files
committed
added spawnable aircrafts
1 parent bc0eb20 commit cd50fb4

File tree

4 files changed

+7122
-6640
lines changed

4 files changed

+7122
-6640
lines changed

build.cmd

+38
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,16 @@ set NPM_UPDATE=true
8989
:DontDefineDefaultDYNAMIC_SCRIPTS_PATH
9090
echo current value is "%DYNAMIC_SCRIPTS_PATH%"
9191

92+
echo ----------------------------------------
93+
echo DYNAMIC_LOAD_SCRIPTS if set to "true", will create a mission with all the scripts loaded dynamically by default
94+
echo defaults to "false"
95+
IF [%DYNAMIC_LOAD_SCRIPTS%] == [] GOTO DefineDefaultDYNAMIC_LOAD_SCRIPTS
96+
goto DontDefineDefaultDYNAMIC_LOAD_SCRIPTS
97+
:DefineDefaultDYNAMIC_LOAD_SCRIPTS
98+
set DYNAMIC_LOAD_SCRIPTS=false
99+
:DontDefineDefaultDYNAMIC_LOAD_SCRIPTS
100+
echo current value is "%DYNAMIC_LOAD_SCRIPTS%"
101+
92102
echo ----------------------------------------
93103
echo MISSION_FILE_SUFFIX1 (a string) will be appended to the mission file name to make it more unique
94104
echo defaults to empty
@@ -163,11 +173,39 @@ pushd %DYNAMIC_SCRIPTS_PATH%\src\scripts\veaf
163173
"%LUA%" veafMissionRadioPresetsEditor.lua %DYNAMIC_MISSION_PATH%\build\tempsrc %DYNAMIC_MISSION_PATH%\src\radio\radioSettings.lua %LUA_SCRIPTS_DEBUG_PARAMETER%
164174
popd
165175

176+
rem -- set the waypoints according to the settings file
177+
if exist %DYNAMIC_MISSION_PATH%\src\waypoints\waypointsSettings.lua (
178+
echo set the waypoints according to the settings file
179+
pushd %DYNAMIC_SCRIPTS_PATH%\src\scripts\veaf
180+
"%LUA%" veafMissionFlightPlanEditor.lua %DYNAMIC_MISSION_PATH%\build\tempsrc %DYNAMIC_MISSION_PATH%\src\waypoints\waypointsSettings.lua %LUA_SCRIPTS_DEBUG_PARAMETER%
181+
popd
182+
)
183+
184+
rem -- set the spawnable aircrafts according to the settings file
185+
if exist %DYNAMIC_MISSION_PATH%\src\spawnableAircrafts\settings.lua (
186+
echo set the spawnable aircrafts according to the settings file
187+
pushd %DYNAMIC_SCRIPTS_PATH%\src\scripts\veaf
188+
"%LUA%" veafSpawnableAircraftsEditor.lua %DYNAMIC_MISSION_PATH%\build\tempsrc %DYNAMIC_MISSION_PATH%\src\spawnableAircrafts\settings.lua %LUA_SCRIPTS_DEBUG_PARAMETER%
189+
popd
190+
)
191+
166192
rem -- set the dynamic load variables in the dictionary
167193
echo set the dynamic load variables in the dictionary
168194
powershell -Command "$temp='VEAF_DYNAMIC_PATH = [[' + [regex]::escape('%DYNAMIC_SCRIPTS_PATH%') + ']]'; (gc .\build\tempsrc\mission) -replace 'VEAF_DYNAMIC_PATH(\s*)=(\s*)\[\[.*\]\]', $temp | sc .\build\tempsrc\mission" >nul 2>&1
169195
powershell -Command "$temp='VEAF_DYNAMIC_MISSIONPATH = [[' + [regex]::escape('%DYNAMIC_MISSION_PATH%') + ']]'; (gc .\build\tempsrc\mission) -replace 'VEAF_DYNAMIC_MISSIONPATH(\s*)=(\s*)\[\[.*\]\]', $temp | sc .\build\tempsrc\mission" >nul 2>&1
170196

197+
if %DYNAMIC_LOAD_SCRIPTS%==true (
198+
rem -- set the loading to dynamic in the mission file
199+
echo set the loading to dynamic in the mission file
200+
powershell -Command "(gc '.\build\tempsrc\l10n\Default\dictionary') -replace 'return(\s*[^\s]+\s*)-- scripts', 'return true -- scripts' | sc '.\build\tempsrc\l10n\Default\dictionary'"
201+
powershell -Command "(gc '.\build\tempsrc\l10n\Default\dictionary') -replace 'return(\s*[^\s]+\s*)-- config', 'return true -- config' | sc '.\build\tempsrc\l10n\Default\dictionary'"
202+
) else (
203+
rem -- set the loading to static in the mission file
204+
echo set the loading to static in the mission file
205+
powershell -Command "(gc '.\build\tempsrc\l10n\Default\dictionary') -replace 'return(\s*[^\s]+\s*)-- scripts', 'return false -- scripts' | sc '.\build\tempsrc\l10n\Default\dictionary'"
206+
powershell -Command "(gc '.\build\tempsrc\l10n\Default\dictionary') -replace 'return(\s*[^\s]+\s*)-- config', 'return false -- config' | sc '.\build\tempsrc\l10n\Default\dictionary'"
207+
)
208+
171209
rem -- disable the C130 module requirement
172210
powershell -File replace.ps1 .\build\tempsrc\mission "\[\"Hercules\"\] = \"Hercules\"," " " >nul 2>&1
173211

0 commit comments

Comments
 (0)