Created
November 17, 2016 17:22
-
-
Save Caesim404/c6c516e99de185b23e6ea10d2e209ef5 to your computer and use it in GitHub Desktop.
Sven Co-op's Install_OpFor_Support.bat port to bash.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
HLDIR="/home/caesim/.local/share/Steam/steamapps/common/Half-Life" | |
SCDIR="/home/caesim/.local/share/Steam/steamapps/common/Sven Co-op Dedicated Server/svencoop" | |
szGame="Opposing Force" | |
szModDir="gearbox" | |
scVersion="5.0" | |
if [ "$(uname -m)" == "x86_64" ]; then | |
ripent=ripent | |
else | |
ripent=ripent_32 | |
fi | |
mapList=( | |
of0a0 of1a1 of1a2 of1a3 of1a4 of1a4b of1a5 of1a5b of1a6 of2a1 of2a1b of2a4 | |
of2a5 of2a6 of3a1 of3a2 of3a4 of3a5 of3a6 of4a1 of4a2 of4a3 of4a4 | |
of4a5 of5a1 of5a2 of5a3 of5a4 of6a1 of6a2 of6a3 of6a4 of6a4b of6a5 | |
) | |
szBaseContentDir=$HLDIR/$szModDir | |
if [ ! -d "$szBaseContentDir" ]; then | |
echo Could not find $szBaseContentDir directory | |
echo Check that $szGame is installed | |
exit | |
fi | |
echo | |
echo -= Half-Life: $szGame map support for Sven Co-op $scVersion =- | |
echo | |
echo Warning: Around 80MB of free disk space required. | |
echo Installation may take a few minutes\; please be patient. | |
echo | |
echo | |
echo ---------------------------------------------------------------------------- | |
echo IMPORTANT: To install $szGame support, you must own \'Half-Life: | |
echo $szGame\' and have it fully downloaded and installed! | |
echo ---------------------------------------------------------------------------- | |
echo | |
cd "$SCDIR" | |
if [ ! -f "maps/$ripent" ]; then | |
echo Missing $ripent | |
exit | |
fi | |
if [ ! -f "$szBaseContentDir/maps/${mapList[0]}.bsp" ]; then | |
echo Missing maps | |
exit | |
fi | |
echo | |
echo Copying official maps from installed game... | |
echo | |
for m in "${mapList[@]}"; do | |
cp "$szBaseContentDir/maps/$m.bsp" maps/ | |
done | |
cp "$szBaseContentDir/gfx/env/*" gfx/env/ | |
echo | |
echo -= Valve\'s original Half-Life $szGame maps have been copied. =- | |
echo | |
echo | |
echo Preparing... | |
echo | |
unzip -o opfor_support.sven -d maps | |
cd maps | |
echo | |
echo Importing entity data... | |
echo | |
for m in "${mapList[@]}"; do | |
./$ripent -import -noinfo $m.bsp | |
done | |
echo | |
echo Flushing temporary data... | |
echo | |
rm of?a?.ent | |
rm of?a?b.ent |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thanks