Skip to content

Commit bcc7401

Browse files
committed
updated to match VeafCreationTools v2.34.0
1 parent 04faf6f commit bcc7401

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+4236
-11801
lines changed

.gitignore

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
/node_modules/
44
/7za.exe
55
/setup_*.cmd
6+
configuration.json
67
package-lock.json
78
cache/
8-
templates/*/build
9-
templates/*/node_modules/
10-
configuration.json
9+
/templates/*/build
10+
/templates/*/node_modules/
11+
build-*.cmd

build-zip.cmd

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
@echo off
2+
set NOPAUSE=true
23
set DYNAMIC_SCRIPTS_PATH="d:\dev\_VEAF\VEAF-Mission-Creation-Tools"
3-
call build.cmd
4+
call build.cmd
5+
copy build\*.miz .
6+
pause

build.cmd

Lines changed: 67 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@ echo.
88

99
rem -- default options values
1010
echo This script can use these environment variables to customize its behavior :
11+
echo ----------------------------------------
12+
echo NOPAUSE if set to "true", will not pause at the end of the script (useful to chain calls to this script)
13+
echo defaults to "false"
14+
IF [%NOPAUSE%] == [] GOTO DefineDefaultNOPAUSE
15+
goto DontDefineDefaultNOPAUSE
16+
:DefineDefaultNOPAUSE
17+
set NOPAUSE=false
18+
:DontDefineDefaultNOPAUSE
19+
echo current value is "%NOPAUSE%"
20+
1121
echo ----------------------------------------
1222
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)
1323
echo defaults to "false"
@@ -38,18 +48,6 @@ set SECURITY_DISABLED_FLAG=false
3848
:DontDefineDefaultSECURITY_DISABLED_FLAG
3949
echo current value is "%SECURITY_DISABLED_FLAG%"
4050

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-
5351
echo ----------------------------------------
5452
echo SEVENZIP (a string) points to the 7za executable
5553
echo defaults "7za", so it needs to be in the path
@@ -91,30 +89,69 @@ set DYNAMIC_SCRIPTS_PATH=%~dp0node_modules\veaf-mission-creation-tools\
9189
echo current value is "%DYNAMIC_SCRIPTS_PATH%"
9290

9391
echo ----------------------------------------
92+
echo DISABLE_C130_MODULE if set to "true", will create a mission with the requirement for the C130 module disabled (meaning that no one will be able to actually fly the thing, but people without the module will be able to connect)
93+
echo defaults to "true"
94+
IF [%DISABLE_C130_MODULE%] == [] GOTO DefineDefaultDISABLE_C130_MODULE
95+
goto DontDefineDefaultDISABLE_C130_MODULE
96+
:DefineDefaultDISABLE_C130_MODULE
97+
set DISABLE_C130_MODULE=true
98+
:DontDefineDefaultDISABLE_C130_MODULE
99+
echo current value is "%DISABLE_C130_MODULE%"
100+
101+
echo ----------------------------------------
102+
echo MISSION_FILE_SUFFIX1 (a string) will be appended to the mission file name to make it more unique
103+
echo defaults to empty
104+
IF [%MISSION_FILE_SUFFIX1%] == [] GOTO DefineDefaultMISSION_FILE_SUFFIX1
105+
goto DontDefineDefaultMISSION_FILE_SUFFIX1
106+
:DefineDefaultMISSION_FILE_SUFFIX1
107+
set MISSION_FILE_SUFFIX1=
108+
:DontDefineDefaultMISSION_FILE_SUFFIX1
109+
echo current value is "%MISSION_FILE_SUFFIX1%"
110+
111+
echo ----------------------------------------
112+
echo MISSION_FILE_SUFFIX2 (a string) will be appended to the mission file name to make it more unique
113+
echo defaults to the current iso date
114+
IF [%MISSION_FILE_SUFFIX2%] == [] GOTO DefineDefaultMISSION_FILE_SUFFIX2
115+
goto DontDefineDefaultMISSION_FILE_SUFFIX2
116+
:DefineDefaultMISSION_FILE_SUFFIX2
117+
set TIMEBUILD=%TIME: =0%
118+
set MISSION_FILE_SUFFIX2=%date:~-4,4%%date:~-7,2%%date:~-10,2%
119+
:DontDefineDefaultMISSION_FILE_SUFFIX2
120+
echo current value is "%MISSION_FILE_SUFFIX2%"
121+
122+
echo ----------------------------------------
123+
124+
IF [%MISSION_FILE_SUFFIX1%] == [] GOTO DontUseSuffix1
125+
set MISSION_FILE=.\build\%MISSION_NAME%_%MISSION_FILE_SUFFIX1%_%MISSION_FILE_SUFFIX2%
126+
goto EndOfSuffix1
127+
:DontUseSuffix1
128+
set MISSION_FILE=.\build\%MISSION_NAME%_%MISSION_FILE_SUFFIX2%
129+
:EndOfSuffix1
130+
131+
echo.
132+
echo Building %MISSION_FILE%.miz
94133

95134
echo.
96135
echo prepare the folders
97136
rd /s /q .\build
98137
mkdir .\build
99138

100-
echo.
101139
echo fetch the veaf-mission-creation-tools package
102140
call npm update
103141
rem echo on
104142

105-
echo.
106143
echo prepare the veaf-mission-creation-tools scripts
107144
rem -- copy the scripts folder
108145
xcopy /s /y /e .\node_modules\veaf-mission-creation-tools\src\scripts\* .\build\tempscripts\ >nul 2>&1
109146

110147
rem -- set the flags in the scripts according to the options
111148
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
149+
powershell -File replace.ps1 .\build\tempscripts\veaf\veaf.lua "veaf.Development = (true|false)" "veaf.Development = %VERBOSE_LOG_FLAG%" >nul 2>&1
150+
powershell -File replace.ps1 .\build\tempscripts\veaf\veaf.lua "veaf.SecurityDisabled = (true|false)" "veaf.SecurityDisabled = %SECURITY_DISABLED_FLAG%" >nul 2>&1
114151

115152
rem -- comment all the trace and debug code
116153
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
154+
FOR %%f IN (.\build\tempscripts\veaf\*.lua) DO powershell -File replace.ps1 %%f "(^\s*)(veaf.*\.[^\(^\s]*log(Trace|Debug|Marker))" "$1--$2" >nul 2>&1
118155

119156
echo building the mission
120157
rem -- copy all the source mission files and mission-specific scripts
@@ -133,6 +170,11 @@ echo set the dynamic load variables in the dictionary
133170
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
134171
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
135172

173+
rem -- disable the C130 module requirement
174+
IF [%DISABLE_C130_MODULE%] == [false] GOTO SkipDISABLE_C130_MODULE
175+
powershell -File replace.ps1 .\build\tempsrc\mission "\[\"Hercules\"\] = \"Hercules\"," " " >nul 2>&1
176+
:SkipDISABLE_C130_MODULE
177+
136178
rem -- copy the documentation images to the kneeboard
137179
xcopy /y /e doc\*.jpg .\build\tempsrc\KNEEBOARD\IMAGES\ >nul 2>&1
138180

@@ -158,14 +200,18 @@ rem -- cleanup the veaf-mission-creation-tools scripts
158200
rd /s /q .\build\tempscripts
159201

160202
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
203+
rem echo generate the time and weather versions
204+
rem echo ----------------------------------------
205+
rem we'll do it on the server
206+
rem node node_modules\veaf-mission-creation-tools\src\nodejs\app.js injectall --quiet "%MISSION_FILE%.miz" "%MISSION_FILE%-${version}.miz" src\weatherAndTime\versions.json
164207

165208
echo.
166209
echo ----------------------------------------
167210
rem -- done !
168211
echo Built %MISSION_FILE%.miz
169212
echo ----------------------------------------
213+
echo.
170214

171-
pause
215+
IF [%NOPAUSE%] == [true] GOTO EndOfFile
216+
pause
217+
:EndOfFile

extract.cmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ set MISSION_PATH=%cd%\src\mission
5252

5353
rem -- set the loading to static in the mission file
5454
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"
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'"
5656

5757
rem removing unwanted elements
5858
echo removing unwanted elements
@@ -76,7 +76,7 @@ pushd node_modules\veaf-mission-creation-tools\src\scripts\veaf
7676
popd
7777

7878
rem -- cleanup
79-
del *%MISSION_NAME%*.miz
79+
rem del *%MISSION_NAME%*.miz
8080

8181
echo.
8282
echo ----------------------------------------

replace.ps1

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Replace content in a file
2+
param (
3+
[Parameter(Mandatory, Position=0)]
4+
[string] $FilePath,
5+
6+
[Parameter(Mandatory, Position=1)]
7+
[string] $ReplaceThis,
8+
9+
[Parameter(Mandatory, Position=2)]
10+
[string] $WithThat
11+
)
12+
echo $FilePath
13+
echo $ReplaceThis
14+
echo $WithThat
15+
16+
(Get-Content $FilePath) -replace $ReplaceThis, $WithThat | Set-Content $FilePath

src/mission/l10n/DEFAULT/dictionary

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ dictionary = {
33
local script = VEAF_DYNAMIC_MISSIONPATH .. \"/src/scripts/missionConfig.lua\"\
44
assert(loadfile(script))()\
55
",
6-
["DictKey_ActionText_384"] = "VEAF_DYNAMIC_PATH = [[D:/DEV/_veaf/VEAF-Mission-Creation-Tools]]",
6+
["DictKey_ActionText_384"] = "VEAF_DYNAMIC_PATH = [[D:\\dev\\_VEAF\\VEAF-Demo-Mission\\node_modules\\veaf-mission-creation-tools\\]]",
77
["DictKey_ActionText_385"] = "return VEAF_DYNAMIC_PATH~=nil",
88
["DictKey_ActionText_386"] = "return VEAF_DYNAMIC_PATH==nil",
99
["DictKey_ActionText_445"] = "return false --true=dynamic, false=static",
@@ -26,10 +26,14 @@ assert(loadfile(script))()\
2626
["DictKey_ActionText_585"] = "local script = VEAF_DYNAMIC_PATH .. \"/src//scripts/community/WeatherMark.lua\"\
2727
assert(loadfile(script))()\
2828
",
29-
["DictKey_ActionText_586"] = "local script = VEAF_DYNAMIC_PATH .. \"/src//scripts/community/NIOD.lua\"\
29+
["DictKey_ActionText_614"] = "VEAF_DYNAMIC_MISSIONPATH = [[D:\\dev\\_VEAF\\VEAF-Demo-Mission\\]]",
30+
["DictKey_ActionText_615"] = "local script = VEAF_DYNAMIC_PATH .. \"/src//scripts/community/Hercules_Cargo.lua\"\
3031
assert(loadfile(script))()\
3132
",
32-
["DictKey_ActionText_614"] = "VEAF_DYNAMIC_MISSIONPATH = [[D:/DEV/_veaf/VEAF-Demo-Mission]]",
33+
["DictKey_ActionText_618"] = "local script = VEAF_DYNAMIC_PATH .. \"/src//scripts/community/skynet-iads-compiled.lua\"\
34+
assert(loadfile(script))()\
35+
",
36+
["DictKey_ActionText_626"] = "env.info(\"STATIC LOADING\")",
3337
["DictKey_descriptionBlueTask_3"] = "",
3438
["DictKey_descriptionNeutralsTask_4"] = "",
3539
["DictKey_descriptionRedTask_2"] = "",

src/mission/l10n/DEFAULT/mapResource

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,11 @@ mapResource = {
1919
["ResKey_Action_489"] = "veafInterpreter.lua",
2020
["ResKey_Action_490"] = "veafCombatMission.lua",
2121
["ResKey_Action_494"] = "veafCarrierOperations2.lua",
22+
["ResKey_Action_619"] = "veafSkynetIadsHelper.lua",
23+
["ResKey_Action_620"] = "mist.lua",
24+
["ResKey_Action_621"] = "Moose.lua",
25+
["ResKey_Action_622"] = "CTLD.lua",
26+
["ResKey_Action_623"] = "WeatherMark.lua",
27+
["ResKey_Action_624"] = "skynet-iads-compiled.lua",
28+
["ResKey_Action_625"] = "Hercules_Cargo.lua",
2229
} -- end of mapResource

0 commit comments

Comments
 (0)