I've had success with adding custom sounds before, but I've just spent the last 2 hours trying to add a custom sound for a weapon and have had no success, even though I've done it before. Maybe someone can have a look at my files and see what I've screwed up? My cpc.lvl is consistently 47kb in size.
cpc.req
Hidden/Spoiler:
[code]ucft
{
REQN
{
"str"
"align=2048"
"gcw_vo"
"gcw_tac_vo"
}
REQN
{
"lvl"
"cpcgcw"
}
}[/code]
{
REQN
{
"str"
"align=2048"
"gcw_vo"
"gcw_tac_vo"
}
REQN
{
"lvl"
"cpcgcw"
}
}[/code]
Hidden/Spoiler:
[code]ucft
{
REQN
{
"bnk"
"align=2048"
"cpcgcw"
}
REQN
{
"config"
"global_world"
"exp_obj"
"cpcgcw"
"gcw_vo"
"gcw"
}
}[/code]
{
REQN
{
"bnk"
"align=2048"
"cpcgcw"
}
REQN
{
"config"
"global_world"
"exp_obj"
"cpcgcw"
"gcw_vo"
"gcw"
}
}[/code]
Hidden/Spoiler:
[code]effects\cpc_weap_pistol_fire.wav -resample ps2 16000 xbox 22050 pc 22050[/code]
Hidden/Spoiler:
[code]SoundProperties()
{
Name("cpc_weap_pistol_fire")
Pitch(1.0);
PitchDev(0.2);
Gain(1.0);
GainDev(0.0);
ReverbGain(1.0);
Bus("soundfx");
Looping(0);
Pan(0.0);
MinDistance(5.0);
MuteDistance(50.0);
MaxDistance(50.0);
RollOff(0.0);
Mode3D(1);
Bias(0.0001);
Priority(1.0);
SampleList()
{
Sample("cpc_weap_pistol_fire", 1.0);
}
}[/code]
{
Name("cpc_weap_pistol_fire")
Pitch(1.0);
PitchDev(0.2);
Gain(1.0);
GainDev(0.0);
ReverbGain(1.0);
Bus("soundfx");
Looping(0);
Pan(0.0);
MinDistance(5.0);
MuteDistance(50.0);
MaxDistance(50.0);
RollOff(0.0);
Mode3D(1);
Bias(0.0001);
Priority(1.0);
SampleList()
{
Sample("cpc_weap_pistol_fire", 1.0);
}
}[/code]
soundmunge.bat:
Hidden/Spoiler:
[code]@if %1x==x goto noplatform
@set MUNGE_PLATFORM=%1
@set MUNGE_DIR=MUNGED\%MUNGE_PLATFORM%
@rem Munge global, shell and side specific sound data
@call soundmungedir _BUILD\sound\cw\%MUNGE_DIR% sound\cw sound\cw\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound cw
@call soundmungedir _BUILD\sound\gcw\%MUNGE_DIR% sound\gcw sound\gcw\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound gcw
@call soundmungedir _BUILD\sound\global\%MUNGE_DIR% sound\global sound\global\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound global nolevelfile
@call soundmungedir _BUILD\sound\shell\%MUNGE_DIR% sound\shell sound\shell\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound shell
@rem Munge world specific sound data
@call soundmungedir _BUILD\sound\worlds\cor\%MUNGE_DIR% sound\worlds\cor sound\worlds\cor\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound cor
@call soundmungedir _BUILD\sound\worlds\cpc\%MUNGE_DIR% sound\worlds\cpc sound\worlds\cpc\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound cpc
@call soundmungedir _BUILD\sound\worlds\dag\%MUNGE_DIR% sound\worlds\dag sound\worlds\dag\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound dag
@call soundmungedir _BUILD\sound\worlds\dea\%MUNGE_DIR% sound\worlds\dea sound\worlds\dea\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound dea
@call soundmungedir _BUILD\sound\worlds\end\%MUNGE_DIR% sound\worlds\end sound\worlds\end\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound end
@call soundmungedir _BUILD\sound\worlds\fel\%MUNGE_DIR% sound\worlds\fel sound\worlds\fel\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound fel
@call soundmungedir _BUILD\sound\worlds\gal\%MUNGE_DIR% sound\worlds\gal sound\worlds\gal\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound gal
@call soundmungedir _BUILD\sound\worlds\geo\%MUNGE_DIR% sound\worlds\geo sound\worlds\geo\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound geo
@call soundmungedir _BUILD\sound\worlds\hot\%MUNGE_DIR% sound\worlds\hot sound\worlds\hot\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound hot
@call soundmungedir _BUILD\sound\worlds\kam\%MUNGE_DIR% sound\worlds\kam sound\worlds\kam\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound kam
@call soundmungedir _BUILD\sound\worlds\kas\%MUNGE_DIR% sound\worlds\kas sound\worlds\kas\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound kas
@call soundmungedir _BUILD\sound\worlds\mus\%MUNGE_DIR% sound\worlds\mus sound\worlds\mus\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound mus
@call soundmungedir _BUILD\sound\worlds\myg\%MUNGE_DIR% sound\worlds\myg sound\worlds\myg\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound myg
@call soundmungedir _BUILD\sound\worlds\nab\%MUNGE_DIR% sound\worlds\nab sound\worlds\nab\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound nab
@call soundmungedir _BUILD\sound\worlds\pol\%MUNGE_DIR% sound\worlds\pol sound\worlds\pol\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound pol
@call soundmungedir _BUILD\sound\worlds\spa\%MUNGE_DIR% sound\worlds\spa sound\worlds\spa\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound spa
@call soundmungedir _BUILD\sound\worlds\tan\%MUNGE_DIR% sound\worlds\tan sound\worlds\tan\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound tan
@call soundmungedir _BUILD\sound\worlds\tat\%MUNGE_DIR% sound\worlds\tat sound\worlds\tat\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound tat
@call soundmungedir _BUILD\sound\worlds\uta\%MUNGE_DIR% sound\worlds\uta sound\worlds\uta\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound uta
@call soundmungedir _BUILD\sound\worlds\yav\%MUNGE_DIR% sound\worlds\yav sound\worlds\yav\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound yav
@call soundmungedir _BUILD\sound\worlds\hero\%MUNGE_DIR% sound\worlds\hero sound\worlds\hero\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound hero
@goto exit
:noplatform
@echo Platform must be specified as the first argument
:exit[/code]
@set MUNGE_PLATFORM=%1
@set MUNGE_DIR=MUNGED\%MUNGE_PLATFORM%
@rem Munge global, shell and side specific sound data
@call soundmungedir _BUILD\sound\cw\%MUNGE_DIR% sound\cw sound\cw\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound cw
@call soundmungedir _BUILD\sound\gcw\%MUNGE_DIR% sound\gcw sound\gcw\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound gcw
@call soundmungedir _BUILD\sound\global\%MUNGE_DIR% sound\global sound\global\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound global nolevelfile
@call soundmungedir _BUILD\sound\shell\%MUNGE_DIR% sound\shell sound\shell\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound shell
@rem Munge world specific sound data
@call soundmungedir _BUILD\sound\worlds\cor\%MUNGE_DIR% sound\worlds\cor sound\worlds\cor\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound cor
@call soundmungedir _BUILD\sound\worlds\cpc\%MUNGE_DIR% sound\worlds\cpc sound\worlds\cpc\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound cpc
@call soundmungedir _BUILD\sound\worlds\dag\%MUNGE_DIR% sound\worlds\dag sound\worlds\dag\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound dag
@call soundmungedir _BUILD\sound\worlds\dea\%MUNGE_DIR% sound\worlds\dea sound\worlds\dea\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound dea
@call soundmungedir _BUILD\sound\worlds\end\%MUNGE_DIR% sound\worlds\end sound\worlds\end\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound end
@call soundmungedir _BUILD\sound\worlds\fel\%MUNGE_DIR% sound\worlds\fel sound\worlds\fel\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound fel
@call soundmungedir _BUILD\sound\worlds\gal\%MUNGE_DIR% sound\worlds\gal sound\worlds\gal\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound gal
@call soundmungedir _BUILD\sound\worlds\geo\%MUNGE_DIR% sound\worlds\geo sound\worlds\geo\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound geo
@call soundmungedir _BUILD\sound\worlds\hot\%MUNGE_DIR% sound\worlds\hot sound\worlds\hot\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound hot
@call soundmungedir _BUILD\sound\worlds\kam\%MUNGE_DIR% sound\worlds\kam sound\worlds\kam\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound kam
@call soundmungedir _BUILD\sound\worlds\kas\%MUNGE_DIR% sound\worlds\kas sound\worlds\kas\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound kas
@call soundmungedir _BUILD\sound\worlds\mus\%MUNGE_DIR% sound\worlds\mus sound\worlds\mus\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound mus
@call soundmungedir _BUILD\sound\worlds\myg\%MUNGE_DIR% sound\worlds\myg sound\worlds\myg\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound myg
@call soundmungedir _BUILD\sound\worlds\nab\%MUNGE_DIR% sound\worlds\nab sound\worlds\nab\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound nab
@call soundmungedir _BUILD\sound\worlds\pol\%MUNGE_DIR% sound\worlds\pol sound\worlds\pol\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound pol
@call soundmungedir _BUILD\sound\worlds\spa\%MUNGE_DIR% sound\worlds\spa sound\worlds\spa\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound spa
@call soundmungedir _BUILD\sound\worlds\tan\%MUNGE_DIR% sound\worlds\tan sound\worlds\tan\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound tan
@call soundmungedir _BUILD\sound\worlds\tat\%MUNGE_DIR% sound\worlds\tat sound\worlds\tat\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound tat
@call soundmungedir _BUILD\sound\worlds\uta\%MUNGE_DIR% sound\worlds\uta sound\worlds\uta\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound uta
@call soundmungedir _BUILD\sound\worlds\yav\%MUNGE_DIR% sound\worlds\yav sound\worlds\yav\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound yav
@call soundmungedir _BUILD\sound\worlds\hero\%MUNGE_DIR% sound\worlds\hero sound\worlds\hero\%MUNGE_PLATFORM% %MUNGE_PLATFORM% _BUILD _LVL_%MUNGE_PLATFORM%\sound _BUILD\sound hero
@goto exit
:noplatform
@echo Platform must be specified as the first argument
:exit[/code]
Hidden/Spoiler:
[code]@rem Save the starting directory
@for /F %%A in ('cd') do @set STARTDIR=%%A
@if %1x==x goto nomungedir
@if %2x==x goto nosourcedir
@if %3x==x goto nooverridedir
@if %4x==x goto noplatform
@if %5x==x goto nomungelogdir
@if %6x==x goto noleveldir
@if %7x==x goto nolevelsrcdir
@if %8x==x goto nolevelfile
@rem Setup directories
@set MUNGEDIR=%STARTDIR%\%1
@set SOURCEDIR=%STARTDIR%\%2
@set PLATFORMDIR=%STARTDIR%\%3
@set LOGDIR=%STARTDIR%\%5
@set LEVELDIR=%STARTDIR%\%6
@set LEVELFILEREQ=%8%.req
@set LEVELFILELVL=%MUNGEDIR%\%8%.lvl
@set CHECKDATE=-checkdate
@set CHECKID=-checkid
@if %SOUNDNODATECHECK%x==1x @set CHECKDATE=
@rem Build up a list of directories for level pack to search for source files
@Setlocal enabledelayedexpansion
@set LEVELSRCDIR=
@set PATH="%CD%"\..\ToolsFL\Bin;%PATH%
@rem Should we munge this level ?
@if /i not "%SOUNDLVL%"=="" (
@for %%A in (%SOUNDLVL%) do @if /i "%%A"=="%8" @goto mungeit
@goto exit
)
:mungeit
@if "%MUNGE_LOG%"=="" set MUNGE_LOG=%LOGDIR%\%4%_MungeLog.txt
@if not EXIST %SOURCEDIR% (
@echo Unable to munge %SOURCEDIR% as it doesn't exist! 1>> %MUNGE_LOG%
@goto exit
)
@goto nodebug
@echo Current Directory = %CD%
@echo Sound level filter = %SOUNDLVL%
@echo Munge output directory = %MUNGEDIR%
@echo Source directory = %SOURCEDIR%
@echo Platform override directory = %PLATFORMDIR%
@echo Selected platform = %4
@echo Munge logs directory = %LOGDIR%
@echo Level file output directory = %LEVELDIR%
@echo Final req file = %LEVELFILEREQ%
@echo Output level file = %LEVELFILELVL%
@echo Additional stream options = %STREAMOPT%
@pause
:nodebug
@if EXIST %MUNGEDIR% goto skipcreatemungedir
@mkdir %MUNGEDIR%
:skipcreatemungedir
@cd %SOURCEDIR%
@rem Munge configuration files
@rem *.snd - sound library
@rem *.mus - dynamic music configuration
@rem *.ffx - foley effects
@rem *.tsr - sound regions
@configmunge -inputfile *.snd *.mus *.ffx *.tsr -platform %4 -sourcedir %PLATFORMDIR% %SOURCEDIR% -outputdir %MUNGEDIR% -hashstrings %CHECKDATE% -continue 2>>%MUNGE_LOG%
@if %SOUNDLOG%x==1x ( @set SOUNDOPT=-verbose & @set SOUNDLOGOUT=%LOGDIR%\SoundBankLog.txt ) else ( @set SOUNDOPT= & @set SOUNDLOGOUT=NUL )
@rem Munge sound banks
@for /R %%A in (*.sfx) do @echo Munging %%~nA%%~xA & @soundflmunge -platform %4 -banklistinput %%A -bankoutput %MUNGEDIR%\ %CHECKDATE% -resample %CHECKID% noabort %SOUNDOPT% %BANKOPT% 2>>%MUNGE_LOG% 1>>%SOUNDLOGOUT%
@rem Munge streams
@rem Localization
@rem Setup the extension of localized stream files (if it's english we'll just use the default extension)
@set LANGVERSION=
@rem @for /F %%A in (%MUNGE_LANGVERSION%) do @set LANGVERSION=%%~A
@set LANGVERSION=%MUNGE_LANGVERSION%
@if /i %LANGVERSION%x==Englishx ( @set LOCALIZEEXT= ) else ( @set LOCALIZEEXT=stm_%LANGVERSION% )
@rem make the directory for language-specific stuff if it doesn't exist - H8 h8 h8!
@if EXIST %MUNGEDIR%\%LANGVERSION% goto skipcreatelangdir
@echo Creating dir %MUNGEDIR%\%LANGVERSION%\
@mkdir %MUNGEDIR%\%LANGVERSION%
:skipcreatelangdir
@rem Munge localized stream files
@if /i not %MUNGESTREAMS%x==0x @if /i not %LANGVERSION%x==Englishx @for /R %%A in (*.%LOCALIZEEXT%) do @echo Munging %%~nA%%~xA to %MUNGEDIR%\%LANGVERSION%\ & soundflmunge -platform %4 -banklistinput %%A -bankoutput %MUNGEDIR%\%LANGVERSION%\%%~nA.str -stream %CHECKDATE% -resample %CHECKID% noabort %SOUNDOPT% %STREAMOPT% 2>>%MUNGE_LOG% 1>>%SOUNDLOGOUT%
@set MUNGE2SUBSTREAMS=0
@if /i %4==XBOX @set MUNGE2SUBSTREAMS=1
@if /i %4==PC @set MUNGE2SUBSTREAMS=1
@rem Build up a list of 1 substream streams to munge,
@rem Filtering the localize streams and if on xbox 4 channel streams
@set MUNGESUBSTREAM1=
@if /i not %MUNGESTREAMS%x==0x @for /R %%A in (*.stm) do @if /i %%~xA==.stm ( @if not EXIST %%~dA%%~pA%%~nA.%LOCALIZEEXT% ( @if /i %MUNGE2SUBSTREAMS%==1 ( @if not EXIST %%~dA%%~pA%%~nA.st4 @set MUNGESUBSTREAM1=!MUNGESUBSTREAM1! %%A ) else ( @set MUNGESUBSTREAM1=!MUNGESUBSTREAM1! %%A ) ) )
@rem Munge 1 substream streams
@if /i not %MUNGESTREAMS%x==0x @for %%A in (%MUNGESUBSTREAM1%) do @echo Munging %%~nA%%~xA & soundflmunge -platform %4 -banklistinput %%A -bankoutput %MUNGEDIR%\ -stream %CHECKDATE% -resample %CHECKID% noabort %SOUNDOPT% %STREAMOPT% 2>>%MUNGE_LOG% 1>>%SOUNDLOGOUT%
@rem Munge 2 substream streams
@if /i not %MUNGESTREAMS%x==0x @if %MUNGE2SUBSTREAMS%==1 @for /R %%A in (*.st4) do @echo Munging %%~nA%%~xA & soundflmunge -platform %4 -banklistinput %%A -bankoutput %MUNGEDIR%\ -stream %CHECKDATE% -resample %CHECKID% noabort %SOUNDOPT% %STREAMOPT% -substream 2 2>>%MUNGE_LOG% 1>>%SOUNDLOGOUT%
@rem Build level files
@if EXIST %LEVELDIR% goto skipcreateleveldir
@mkdir %LEVELDIR%
:skipcreateleveldir
@if %SOUNDNOLVL%x==1x @goto exit
@rem build up a list of include directories for levelpack
@rem language overrides first!
@if %LANGVERSION%x==x goto skiplang
@for /F %%A in ('dir /AD /B %STARTDIR%\%7') do @set LANGSRCDIR=!LANGSRCDIR! %STARTDIR%\%7\%%A\MUNGED\%4\%LANGVERSION%
@for /F %%A in ('dir /AD /B %STARTDIR%\%7\Worlds') do @set LANGSRCDIR=!LANGSRCDIR! %STARTDIR%\%7\Worlds\%%A\MUNGED\%4\%LANGVERSION%
:skiplang
@for /F %%A in ('dir /AD /B %STARTDIR%\%7') do @set LEVELSRCDIR=!LEVELSRCDIR! %STARTDIR%\%7\%%A\MUNGED\%4
@for /F %%A in ('dir /AD /B %STARTDIR%\%7\Worlds') do @set LEVELSRCDIR=!LEVELSRCDIR! %STARTDIR%\%7\Worlds\%%A\MUNGED\%4
@for /R %%A in (*.req) do @if /i not %%A==%SOURCEDIR%\%LEVELFILEREQ% levelpack -inputfile %%~nA%%~xA -platform %4 -sourcedir %SOURCEDIR% %LANGSRCDIR% %PLATFORMDIR% -inputdir %LEVELSRCDIR% -outputdir %MUNGEDIR% -continue %CHECKDATE%
@if EXIST %LEVELFILEREQ% levelpack -inputfile %LEVELFILEREQ% -platform %4 -sourcedir %SOURCEDIR% %LANGSRCDIR% %PLATFORMDIR% -inputdir %LEVELSRCDIR% -outputdir %LEVELDIR% -continue %CHECKDATE%
@goto exit
:nomungedir
@echo Munge directory must be specified as the first argument
@goto exit
:nosourcedir
@echo Source data directory must be specified as the second argument
@goto exit
:nooverridedir
@echo Platform specific source data directory must be specified as the third argument
@goto exit
:noplatform
@echo Platform must be specified as the fourth argument
@goto exit
:nomungelogdir
@echo Munge log directory must be specified as the fifth argument
@goto exit
:noleveldir
@echo Level output directory must be specified as the sixth argument
@goto exit
:nolevelsrcdir
@echo Level source direct must be specified as the seventh argument
@goto exit
:nolevelfile
@echo Final output level file must be specified as the eighth argument
@goto exit
:exit
@endlocal
@cd %STARTDIR%[/code]
@for /F %%A in ('cd') do @set STARTDIR=%%A
@if %1x==x goto nomungedir
@if %2x==x goto nosourcedir
@if %3x==x goto nooverridedir
@if %4x==x goto noplatform
@if %5x==x goto nomungelogdir
@if %6x==x goto noleveldir
@if %7x==x goto nolevelsrcdir
@if %8x==x goto nolevelfile
@rem Setup directories
@set MUNGEDIR=%STARTDIR%\%1
@set SOURCEDIR=%STARTDIR%\%2
@set PLATFORMDIR=%STARTDIR%\%3
@set LOGDIR=%STARTDIR%\%5
@set LEVELDIR=%STARTDIR%\%6
@set LEVELFILEREQ=%8%.req
@set LEVELFILELVL=%MUNGEDIR%\%8%.lvl
@set CHECKDATE=-checkdate
@set CHECKID=-checkid
@if %SOUNDNODATECHECK%x==1x @set CHECKDATE=
@rem Build up a list of directories for level pack to search for source files
@Setlocal enabledelayedexpansion
@set LEVELSRCDIR=
@set PATH="%CD%"\..\ToolsFL\Bin;%PATH%
@rem Should we munge this level ?
@if /i not "%SOUNDLVL%"=="" (
@for %%A in (%SOUNDLVL%) do @if /i "%%A"=="%8" @goto mungeit
@goto exit
)
:mungeit
@if "%MUNGE_LOG%"=="" set MUNGE_LOG=%LOGDIR%\%4%_MungeLog.txt
@if not EXIST %SOURCEDIR% (
@echo Unable to munge %SOURCEDIR% as it doesn't exist! 1>> %MUNGE_LOG%
@goto exit
)
@goto nodebug
@echo Current Directory = %CD%
@echo Sound level filter = %SOUNDLVL%
@echo Munge output directory = %MUNGEDIR%
@echo Source directory = %SOURCEDIR%
@echo Platform override directory = %PLATFORMDIR%
@echo Selected platform = %4
@echo Munge logs directory = %LOGDIR%
@echo Level file output directory = %LEVELDIR%
@echo Final req file = %LEVELFILEREQ%
@echo Output level file = %LEVELFILELVL%
@echo Additional stream options = %STREAMOPT%
@pause
:nodebug
@if EXIST %MUNGEDIR% goto skipcreatemungedir
@mkdir %MUNGEDIR%
:skipcreatemungedir
@cd %SOURCEDIR%
@rem Munge configuration files
@rem *.snd - sound library
@rem *.mus - dynamic music configuration
@rem *.ffx - foley effects
@rem *.tsr - sound regions
@configmunge -inputfile *.snd *.mus *.ffx *.tsr -platform %4 -sourcedir %PLATFORMDIR% %SOURCEDIR% -outputdir %MUNGEDIR% -hashstrings %CHECKDATE% -continue 2>>%MUNGE_LOG%
@if %SOUNDLOG%x==1x ( @set SOUNDOPT=-verbose & @set SOUNDLOGOUT=%LOGDIR%\SoundBankLog.txt ) else ( @set SOUNDOPT= & @set SOUNDLOGOUT=NUL )
@rem Munge sound banks
@for /R %%A in (*.sfx) do @echo Munging %%~nA%%~xA & @soundflmunge -platform %4 -banklistinput %%A -bankoutput %MUNGEDIR%\ %CHECKDATE% -resample %CHECKID% noabort %SOUNDOPT% %BANKOPT% 2>>%MUNGE_LOG% 1>>%SOUNDLOGOUT%
@rem Munge streams
@rem Localization
@rem Setup the extension of localized stream files (if it's english we'll just use the default extension)
@set LANGVERSION=
@rem @for /F %%A in (%MUNGE_LANGVERSION%) do @set LANGVERSION=%%~A
@set LANGVERSION=%MUNGE_LANGVERSION%
@if /i %LANGVERSION%x==Englishx ( @set LOCALIZEEXT= ) else ( @set LOCALIZEEXT=stm_%LANGVERSION% )
@rem make the directory for language-specific stuff if it doesn't exist - H8 h8 h8!
@if EXIST %MUNGEDIR%\%LANGVERSION% goto skipcreatelangdir
@echo Creating dir %MUNGEDIR%\%LANGVERSION%\
@mkdir %MUNGEDIR%\%LANGVERSION%
:skipcreatelangdir
@rem Munge localized stream files
@if /i not %MUNGESTREAMS%x==0x @if /i not %LANGVERSION%x==Englishx @for /R %%A in (*.%LOCALIZEEXT%) do @echo Munging %%~nA%%~xA to %MUNGEDIR%\%LANGVERSION%\ & soundflmunge -platform %4 -banklistinput %%A -bankoutput %MUNGEDIR%\%LANGVERSION%\%%~nA.str -stream %CHECKDATE% -resample %CHECKID% noabort %SOUNDOPT% %STREAMOPT% 2>>%MUNGE_LOG% 1>>%SOUNDLOGOUT%
@set MUNGE2SUBSTREAMS=0
@if /i %4==XBOX @set MUNGE2SUBSTREAMS=1
@if /i %4==PC @set MUNGE2SUBSTREAMS=1
@rem Build up a list of 1 substream streams to munge,
@rem Filtering the localize streams and if on xbox 4 channel streams
@set MUNGESUBSTREAM1=
@if /i not %MUNGESTREAMS%x==0x @for /R %%A in (*.stm) do @if /i %%~xA==.stm ( @if not EXIST %%~dA%%~pA%%~nA.%LOCALIZEEXT% ( @if /i %MUNGE2SUBSTREAMS%==1 ( @if not EXIST %%~dA%%~pA%%~nA.st4 @set MUNGESUBSTREAM1=!MUNGESUBSTREAM1! %%A ) else ( @set MUNGESUBSTREAM1=!MUNGESUBSTREAM1! %%A ) ) )
@rem Munge 1 substream streams
@if /i not %MUNGESTREAMS%x==0x @for %%A in (%MUNGESUBSTREAM1%) do @echo Munging %%~nA%%~xA & soundflmunge -platform %4 -banklistinput %%A -bankoutput %MUNGEDIR%\ -stream %CHECKDATE% -resample %CHECKID% noabort %SOUNDOPT% %STREAMOPT% 2>>%MUNGE_LOG% 1>>%SOUNDLOGOUT%
@rem Munge 2 substream streams
@if /i not %MUNGESTREAMS%x==0x @if %MUNGE2SUBSTREAMS%==1 @for /R %%A in (*.st4) do @echo Munging %%~nA%%~xA & soundflmunge -platform %4 -banklistinput %%A -bankoutput %MUNGEDIR%\ -stream %CHECKDATE% -resample %CHECKID% noabort %SOUNDOPT% %STREAMOPT% -substream 2 2>>%MUNGE_LOG% 1>>%SOUNDLOGOUT%
@rem Build level files
@if EXIST %LEVELDIR% goto skipcreateleveldir
@mkdir %LEVELDIR%
:skipcreateleveldir
@if %SOUNDNOLVL%x==1x @goto exit
@rem build up a list of include directories for levelpack
@rem language overrides first!
@if %LANGVERSION%x==x goto skiplang
@for /F %%A in ('dir /AD /B %STARTDIR%\%7') do @set LANGSRCDIR=!LANGSRCDIR! %STARTDIR%\%7\%%A\MUNGED\%4\%LANGVERSION%
@for /F %%A in ('dir /AD /B %STARTDIR%\%7\Worlds') do @set LANGSRCDIR=!LANGSRCDIR! %STARTDIR%\%7\Worlds\%%A\MUNGED\%4\%LANGVERSION%
:skiplang
@for /F %%A in ('dir /AD /B %STARTDIR%\%7') do @set LEVELSRCDIR=!LEVELSRCDIR! %STARTDIR%\%7\%%A\MUNGED\%4
@for /F %%A in ('dir /AD /B %STARTDIR%\%7\Worlds') do @set LEVELSRCDIR=!LEVELSRCDIR! %STARTDIR%\%7\Worlds\%%A\MUNGED\%4
@for /R %%A in (*.req) do @if /i not %%A==%SOURCEDIR%\%LEVELFILEREQ% levelpack -inputfile %%~nA%%~xA -platform %4 -sourcedir %SOURCEDIR% %LANGSRCDIR% %PLATFORMDIR% -inputdir %LEVELSRCDIR% -outputdir %MUNGEDIR% -continue %CHECKDATE%
@if EXIST %LEVELFILEREQ% levelpack -inputfile %LEVELFILEREQ% -platform %4 -sourcedir %SOURCEDIR% %LANGSRCDIR% %PLATFORMDIR% -inputdir %LEVELSRCDIR% -outputdir %LEVELDIR% -continue %CHECKDATE%
@goto exit
:nomungedir
@echo Munge directory must be specified as the first argument
@goto exit
:nosourcedir
@echo Source data directory must be specified as the second argument
@goto exit
:nooverridedir
@echo Platform specific source data directory must be specified as the third argument
@goto exit
:noplatform
@echo Platform must be specified as the fourth argument
@goto exit
:nomungelogdir
@echo Munge log directory must be specified as the fifth argument
@goto exit
:noleveldir
@echo Level output directory must be specified as the sixth argument
@goto exit
:nolevelsrcdir
@echo Level source direct must be specified as the seventh argument
@goto exit
:nolevelfile
@echo Final output level file must be specified as the eighth argument
@goto exit
:exit
@endlocal
@cd %STARTDIR%[/code]
Hidden/Spoiler:
[code]@REM WARNING: enabledelayedexpansion means ! is a special character,
@REM which means it isn't available for use as the mungeapp recursive
@REM wildcard character. Use the alternate $ instead.
@setlocal enabledelayedexpansion
@set MUNGE_ROOT_DIR=..\..
@if not "%1"=="" set MUNGE_PLATFORM=%1
@if %MUNGE_PLATFORM%x==x set MUNGE_PLATFORM=PC
REM @if "%MUNGE_BIN_DIR%"=="" (
@set MUNGE_BIN_DIR=%CD%\%MUNGE_ROOT_DIR%\..\ToolsFL\Bin
@set PATH=%CD%\..\..\..\ToolsFL\Bin;%PATH%
REM @echo MUNGE_BIN_DIR=!MUNGE_BIN_DIR!
REM )
@rem convert to lower case
@if %MUNGE_PLATFORM%==PC set MUNGE_PLATFORM=pc
@if %MUNGE_PLATFORM%==XBOX set MUNGE_PLATFORM=xbox
@if %MUNGE_PLATFORM%==PS2 set MUNGE_PLATFORM=ps2
@if /i %MUNGE_PLATFORM%==pc @set BANKOPT=-template -stub c:\windows\media\chord.wav
@set MUNGE_DIR=MUNGED\%MUNGE_PLATFORM%
@set LOCAL_MUNGE_LOG="%CD%\%MUNGE_PLATFORM%_MungeLog.txt"
@if "%MUNGE_LOG%"=="" (
@set MUNGE_LOG=%LOCAL_MUNGE_LOG%
@if exist %LOCAL_MUNGE_LOG% ( del %LOCAL_MUNGE_LOG% )
)
@rem echo ********************************************************************* >> %MUNGE_LOG%
@rem echo Sound\munge.bat %MUNGE_PLATFORM% >> %MUNGE_LOG%
@rem echo MUNGE_BIN_DIR=%MUNGE_BIN_DIR% >> %MUNGE_LOG%
@rem echo ********************************************************************* >> %MUNGE_LOG%
@cd ..\..
@if not exist _LVL_%MUNGE_PLATFORM% mkdir _LVL_%MUNGE_PLATFORM%
@if not exist _LVL_%MUNGE_PLATFORM%\Sound mkdir _LVL_%MUNGE_PLATFORM%\Sound
@call soundmunge.bat %MUNGE_PLATFORM%
@if %SOUNDCLEANLVL%x==1x @del /S /Q _BUILD\sound\*.lvl & @call soundmunge.bat %MUNGE_PLATFORM%
@if /i not "%SOUNDLVL%"=="" (
@for %%A in (%SOUNDLVL%) do @if /i "%%A"=="global" @goto buildglobalbank
@goto skipglobalbank
)
:buildglobalbank
@rem Build a global sound bank...
@set BANKLIST=
@for /R %%A in (*.sfx) do @set BANKLIST=!BANKLIST! %%A
@if %SOUNDLOG%x==1x ( @set SOUNDOPT=-verbose & @set SOUNDLOGOUT=%LOGDIR%\SoundBankLog.txt ) else ( @set SOUNDOPT= & @set SOUNDLOGOUT=NUL )
@if not %MUNGE_PLATFORM%==pc goto skipglobalbank
@echo Munging common.bnk, this could take a while...
@soundflmunge -platform %MUNGE_PLATFORM% -banklistinput %BANKLIST% -bankoutput _LVL_%MUNGE_PLATFORM%\Sound\common.bnk -checkdate -resample -compact nowarning -checkid noabort -relativepath %SOUNDOPT% 2>>%MUNGE_LOG% 1>>%SOUNDLOGOUT%
:skipglobalbank
@cd _BUILD\Sound
@REM If the munge log was created locally and has anything in it, view it
@if not %MUNGE_LOG%x==%LOCAL_MUNGE_LOG%x goto skip_mungelog
@set FILE_CONTENTS_TEST=
@if exist %MUNGE_LOG% for /f %%i in (%MUNGE_LOG:"=%) do @set FILE_CONTENTS_TEST=%%i
@if not "%FILE_CONTENTS_TEST%"=="" ( Notepad.exe %MUNGE_LOG% ) else ( if exist %MUNGE_LOG% (del %MUNGE_LOG%) )
:skip_mungelog
@rem convert to upper case
@if %MUNGE_PLATFORM%==pc set MUNGE_PLATFORM=PC
@if %MUNGE_PLATFORM%==xbox set MUNGE_PLATFORM=XBOX
@if %MUNGE_PLATFORM%==ps2 set MUNGE_PLATFORM=PS2
@endlocal[/code]
@REM which means it isn't available for use as the mungeapp recursive
@REM wildcard character. Use the alternate $ instead.
@setlocal enabledelayedexpansion
@set MUNGE_ROOT_DIR=..\..
@if not "%1"=="" set MUNGE_PLATFORM=%1
@if %MUNGE_PLATFORM%x==x set MUNGE_PLATFORM=PC
REM @if "%MUNGE_BIN_DIR%"=="" (
@set MUNGE_BIN_DIR=%CD%\%MUNGE_ROOT_DIR%\..\ToolsFL\Bin
@set PATH=%CD%\..\..\..\ToolsFL\Bin;%PATH%
REM @echo MUNGE_BIN_DIR=!MUNGE_BIN_DIR!
REM )
@rem convert to lower case
@if %MUNGE_PLATFORM%==PC set MUNGE_PLATFORM=pc
@if %MUNGE_PLATFORM%==XBOX set MUNGE_PLATFORM=xbox
@if %MUNGE_PLATFORM%==PS2 set MUNGE_PLATFORM=ps2
@if /i %MUNGE_PLATFORM%==pc @set BANKOPT=-template -stub c:\windows\media\chord.wav
@set MUNGE_DIR=MUNGED\%MUNGE_PLATFORM%
@set LOCAL_MUNGE_LOG="%CD%\%MUNGE_PLATFORM%_MungeLog.txt"
@if "%MUNGE_LOG%"=="" (
@set MUNGE_LOG=%LOCAL_MUNGE_LOG%
@if exist %LOCAL_MUNGE_LOG% ( del %LOCAL_MUNGE_LOG% )
)
@rem echo ********************************************************************* >> %MUNGE_LOG%
@rem echo Sound\munge.bat %MUNGE_PLATFORM% >> %MUNGE_LOG%
@rem echo MUNGE_BIN_DIR=%MUNGE_BIN_DIR% >> %MUNGE_LOG%
@rem echo ********************************************************************* >> %MUNGE_LOG%
@cd ..\..
@if not exist _LVL_%MUNGE_PLATFORM% mkdir _LVL_%MUNGE_PLATFORM%
@if not exist _LVL_%MUNGE_PLATFORM%\Sound mkdir _LVL_%MUNGE_PLATFORM%\Sound
@call soundmunge.bat %MUNGE_PLATFORM%
@if %SOUNDCLEANLVL%x==1x @del /S /Q _BUILD\sound\*.lvl & @call soundmunge.bat %MUNGE_PLATFORM%
@if /i not "%SOUNDLVL%"=="" (
@for %%A in (%SOUNDLVL%) do @if /i "%%A"=="global" @goto buildglobalbank
@goto skipglobalbank
)
:buildglobalbank
@rem Build a global sound bank...
@set BANKLIST=
@for /R %%A in (*.sfx) do @set BANKLIST=!BANKLIST! %%A
@if %SOUNDLOG%x==1x ( @set SOUNDOPT=-verbose & @set SOUNDLOGOUT=%LOGDIR%\SoundBankLog.txt ) else ( @set SOUNDOPT= & @set SOUNDLOGOUT=NUL )
@if not %MUNGE_PLATFORM%==pc goto skipglobalbank
@echo Munging common.bnk, this could take a while...
@soundflmunge -platform %MUNGE_PLATFORM% -banklistinput %BANKLIST% -bankoutput _LVL_%MUNGE_PLATFORM%\Sound\common.bnk -checkdate -resample -compact nowarning -checkid noabort -relativepath %SOUNDOPT% 2>>%MUNGE_LOG% 1>>%SOUNDLOGOUT%
:skipglobalbank
@cd _BUILD\Sound
@REM If the munge log was created locally and has anything in it, view it
@if not %MUNGE_LOG%x==%LOCAL_MUNGE_LOG%x goto skip_mungelog
@set FILE_CONTENTS_TEST=
@if exist %MUNGE_LOG% for /f %%i in (%MUNGE_LOG:"=%) do @set FILE_CONTENTS_TEST=%%i
@if not "%FILE_CONTENTS_TEST%"=="" ( Notepad.exe %MUNGE_LOG% ) else ( if exist %MUNGE_LOG% (del %MUNGE_LOG%) )
:skip_mungelog
@rem convert to upper case
@if %MUNGE_PLATFORM%==pc set MUNGE_PLATFORM=PC
@if %MUNGE_PLATFORM%==xbox set MUNGE_PLATFORM=XBOX
@if %MUNGE_PLATFORM%==ps2 set MUNGE_PLATFORM=PS2
@endlocal[/code]
Hidden/Spoiler:
[code]function ScriptInit()
ReadDataFile("ingame.lvl")
SetMaxFlyHeight(40)
SetMaxPlayerFlyHeight(40)
SetMemoryPoolSize ("ClothData",20)
SetMemoryPoolSize ("Combo",50) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",650) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",650) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",650) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",550) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",6000) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",100) -- should be ~1x #combo
ReadDataFile("dc:sound\\cpc.lvl;cpcgcw")
ReadDataFile("sound\\tat.lvl;tat2gcw")
ReadDataFile("SIDE\\all.lvl", etc.... etc.....
[/code]
ReadDataFile("ingame.lvl")
SetMaxFlyHeight(40)
SetMaxPlayerFlyHeight(40)
SetMemoryPoolSize ("ClothData",20)
SetMemoryPoolSize ("Combo",50) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",650) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",650) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",650) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",550) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",6000) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",100) -- should be ~1x #combo
ReadDataFile("dc:sound\\cpc.lvl;cpcgcw")
ReadDataFile("sound\\tat.lvl;tat2gcw")
ReadDataFile("SIDE\\all.lvl", etc.... etc.....
[/code]