Skip to content

Commit

Permalink
Merge branch 'escorts-linked-with-their-assets'
Browse files Browse the repository at this point in the history
  • Loading branch information
davidp57 committed Jan 10, 2020
2 parents 884bedd + 43243a4 commit 28838ce
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 22 deletions.
1 change: 0 additions & 1 deletion buildMission.cmd → buildDemoMission.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ rem -- copy the documentation images to the kneeboard
xcopy /y /e %MISSION_PATH%\doc\*.png .\build\tempsrc\KNEEBOARD\IMAGES >nul 2>&1

rem -- copy all the community scripts
copy %MISSION_PATH%\src\scripts\community\*.lua .\build\tempsrc\l10n\Default >nul 2>&1
copy .\scripts\community\*.lua .\build\tempsrc\l10n\Default >nul 2>&1

rem -- copy all the common scripts
Expand Down
82 changes: 63 additions & 19 deletions buildOTMission.cmd
Original file line number Diff line number Diff line change
@@ -1,60 +1,99 @@
@echo off
set MISSION_NAME=VEAF-Open-Training-Mission
set MISSION_PATH=..\VEAF-Open-Training-Mission\
set MISSION_PATH=..\VEAF-Open-Training-Mission
set SECURITY_DISABLED_FLAG=true
set VERBOSE_LOG_FLAG=true

echo ------------------------------
echo building VEAF-Open-Training-Mission
echo ------------------------------

rem -- prepare the folders
echo preparing the folders
rd /s /q .\build
mkdir .\build
mkdir .\build\tempsrc
set LUA_SCRIPTS_DEBUG_PARAMETER=-debug
echo.
echo ----------------------------------------
echo building %MISSION_NAME%
echo ----------------------------------------
echo.

rem -- default options values
echo options values :
echo This script can use these environment variables to customize its behavior :
echo ----------------------------------------
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)
echo defaults to "false"
IF [%VERBOSE_LOG_FLAG%] == [] GOTO DefineDefaultVERBOSE_LOG_FLAG
goto DontDefineDefaultVERBOSE_LOG_FLAG
:DefineDefaultVERBOSE_LOG_FLAG
set VERBOSE_LOG_FLAG=false
:DontDefineDefaultVERBOSE_LOG_FLAG
echo VERBOSE_LOG_FLAG = %VERBOSE_LOG_FLAG%
echo current value is "%VERBOSE_LOG_FLAG%"

echo ----------------------------------------
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)
echo defaults to not set
IF [%LUA_SCRIPTS_DEBUG_PARAMETER%] == [] GOTO DefineDefaultLUA_SCRIPTS_DEBUG_PARAMETER
goto DontDefineDefaultLUA_SCRIPTS_DEBUG_PARAMETER
:DefineDefaultLUA_SCRIPTS_DEBUG_PARAMETER
set LUA_SCRIPTS_DEBUG_PARAMETER=
:DontDefineDefaultLUA_SCRIPTS_DEBUG_PARAMETER
echo current value is "%LUA_SCRIPTS_DEBUG_PARAMETER%"

echo ----------------------------------------
echo SECURITY_DISABLED_FLAG if set to "true", will create a mission with security disabled (meaning that no password is ever required)
echo defaults to "false"
IF [%SECURITY_DISABLED_FLAG%] == [] GOTO DefineDefaultSECURITY_DISABLED_FLAG
goto DontDefineDefaultSECURITY_DISABLED_FLAG
:DefineDefaultSECURITY_DISABLED_FLAG
set SECURITY_DISABLED_FLAG=false
:DontDefineDefaultSECURITY_DISABLED_FLAG
echo SECURITY_DISABLED_FLAG = %SECURITY_DISABLED_FLAG%
echo current value is "%SECURITY_DISABLED_FLAG%"

echo ----------------------------------------
echo MISSION_FILE_SUFFIX (a string) will be appended to the mission file name to make it more unique
echo defaults to the current iso date
IF [%MISSION_FILE_SUFFIX%] == [] GOTO DefineDefaultMISSION_FILE_SUFFIX
goto DontDefineDefaultMISSION_FILE_SUFFIX
:DefineDefaultMISSION_FILE_SUFFIX
set TIMEBUILD=%TIME: =0%
set MISSION_FILE_SUFFIX=%date:~-4,4%%date:~-7,2%%date:~-10,2%
:DontDefineDefaultMISSION_FILE_SUFFIX
set MISSION_FILE=.\build\%MISSION_NAME%_%MISSION_FILE_SUFFIX%
echo MISSION_FILE = %MISSION_FILE%.miz
echo current value is "%MISSION_FILE_SUFFIX%"

echo ----------------------------------------
echo SEVENZIP (a string) points to the 7za executable
echo defaults "7za", so it needs to be in the path
IF [%SEVENZIP%] == [] GOTO DefineDefaultSEVENZIP
goto DontDefineDefaultSEVENZIP
:DefineDefaultSEVENZIP
set SEVENZIP=7za
:DontDefineDefaultSEVENZIP
echo SEVENZIP = %SEVENZIP%
echo current value is "%SEVENZIP%"

echo ----------------------------------------
echo LUA (a string) points to the lua executable
echo defaults "lua", so it needs to be in the path
IF [%LUA%] == [] GOTO DefineDefaultLUA
goto DontDefineDefaultLUA
:DefineDefaultLUA
set LUA=lua
:DontDefineDefaultLUA
echo current value is "%LUA%"
echo ----------------------------------------
rem -- prepare the folders
echo preparing the folders
rd /s /q .\build
mkdir .\build
mkdir .\build\tempsrc
echo building the mission
rem -- copy all the source mission files and mission-specific scripts
xcopy /y /e %MISSION_PATH%\src\caucasus\mission .\build\tempsrc\ >nul 2>&1
copy %MISSION_PATH%\src\caucasus\scripts\*.lua .\build\tempsrc\l10n\Default >nul 2>&1
xcopy /y /e %MISSION_PATH%\src\caucasus\scripts\*.lua .\build\tempsrc\l10n\Default\ >nul 2>&1

rem -- set the radio presets according to the settings file
echo set the radio presets according to the settings file
pushd scripts\veaf
%LUA% veafMissionRadioPresetsEditor.lua ..\..\build\tempsrc ..\..\%MISSION_PATH%\src\caucasus\radioSettings.lua %LUA_SCRIPTS_DEBUG_PARAMETER%
popd

rem -- copy the documentation images to the kneeboard
xcopy /y /e %MISSION_PATH%\doc\*.png .\build\tempsrc\KNEEBOARD\IMAGES >nul 2>&1

rem -- copy all the community scripts
copy %MISSION_PATH%\src\scripts\community\*.lua .\build\tempsrc\l10n\Default >nul 2>&1
copy .\scripts\community\*.lua .\build\tempsrc\l10n\Default >nul 2>&1

rem -- copy all the common scripts
Expand All @@ -68,7 +107,12 @@ rem -- compile the mission
"%SEVENZIP%" a -r -tzip %MISSION_FILE%.miz .\build\tempsrc\* -mem=AES256 >nul 2>&1

rem -- cleanup
rd /s /q .\build\tempsrc
rd /s /q .\build\tempsrc

echo.
echo ----------------------------------------
rem -- done !
echo Built %MISSION_FILE%.miz
echo ----------------------------------------

pause
15 changes: 13 additions & 2 deletions scripts/veaf/veafAssets.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ veafAssets = {}
veafAssets.Id = "ASSETS - "

--- Version.
veafAssets.Version = "1.2.3"
veafAssets.Version = "1.3.0"

-- trace level, specific to this module
veafAssets.Trace = false
veafAssets.Trace = true

veafAssets.Assets = {
-- list the assets common to all missions below
Expand Down Expand Up @@ -212,6 +212,17 @@ function veafAssets.respawn(name)
end
if theAsset then
mist.respawnGroup(name, true)
if theAsset.linked then
veafAssets.logTrace(string.format("veafAssets[%s].linked=%s",name, veaf.p(theAsset.linked)))
-- there are linked groups to respawn
if type(theAsset.linked) == "string" then
theAsset.linked = {theAsset.linked}
end
for _, linkedGroup in pairs(theAsset.linked) do
veafAssets.logTrace(string.format("respawning linked group [%s]",linkedGroup))
mist.respawnGroup(linkedGroup, true)
end
end
local text = "I've respawned " .. theAsset.description
if theAsset.jtac then
ctld.JTACAutoLase(name, theAsset.jtac, false, "vehicle")
Expand Down

0 comments on commit 28838ce

Please sign in to comment.