@@ -89,6 +89,16 @@ set NPM_UPDATE=true
89
89
:DontDefineDefaultDYNAMIC_SCRIPTS_PATH
90
90
echo current value is " %DYNAMIC_SCRIPTS_PATH% "
91
91
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
+
92
102
echo ----------------------------------------
93
103
echo MISSION_FILE_SUFFIX1 (a string) will be appended to the mission file name to make it more unique
94
104
echo defaults to empty
@@ -163,11 +173,39 @@ pushd %DYNAMIC_SCRIPTS_PATH%\src\scripts\veaf
163
173
" %LUA% " veafMissionRadioPresetsEditor.lua %DYNAMIC_MISSION_PATH% \build\tempsrc %DYNAMIC_MISSION_PATH% \src\radio\radioSettings.lua %LUA_SCRIPTS_DEBUG_PARAMETER%
164
174
popd
165
175
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
+
166
192
rem -- set the dynamic load variables in the dictionary
167
193
echo set the dynamic load variables in the dictionary
168
194
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
169
195
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
170
196
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
+
171
209
rem -- disable the C130 module requirement
172
210
powershell -File replace.ps1 .\build\tempsrc\mission " \[\" Hercules\" \] = \" Hercules\" ," " " > nul 2 >& 1
173
211
0 commit comments