Last active
March 18, 2020 14:50
-
-
Save KristerV/9fe91fc04d6c43476277d6ddcd60e4b7 to your computer and use it in GitHub Desktop.
Script fix Duke Nuken Alien Armageddon on Linux. Works partially. Makes a list of all filenames and fixes casing in all of the (same) files.
This file contains 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
#!/bin/bash | |
# Change delimiter for the for each loop from space to newline | |
IFS=$(echo -en "\n\b") | |
countMain=0 | |
countSub=0 | |
# Make a list of all filenames in the game | |
findAllFiles=`find . -type f` | |
# Make a list of all non-media files to do the case fixing in | |
findNonMedia=`find . -type f ! -name 'fix-linux.sh' ! -name '*.ogg' ! -name '*.md3' ! -name '*.raw' ! -name '*.png' ! -name '*.art' ! -name '*.wav' ! -name '*.WAV' ! -name '*.ART' ! -name '*.kvx' ! -name '*.VOC' ! -name '*.OGG' ! -name '*.mid' ! -name '*.voc' ! -name '*.ogg' ! -name '*.MID' ! -name '*.bmp' ! -name '*.BMP' ! -name '*.m4a' ! -name '*.gif' ! -name '*.map' ! -name '*.MAP'` | |
# Calculate totals, for logging | |
total_allFiles=$(wc -l <<< "${findAllFiles}") | |
total_nonMedia=$(wc -l <<< "${findNonMedia}") | |
for realfile in $findAllFiles; do | |
realfile=${realfile#"./"} # Remove prefix "./" | |
((countMain++)) | |
for changeInFile in $findNonMedia; do | |
echo "-----------------------------" | |
echo "Real filepath: " $realfile | |
echo "Change in file:" $changeInFile | |
echo "Progress: $countMain / $total_allFiles // $((countSub++)) / $total_nonMedia" | |
sed -i "s|${realfile}|${realfile}|ig" $changeInFile # Actual replacing | |
done | |
countSub=0 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Today updated to Updated to AA3.12. The error
loadpics: Invalid art file version in tiles052.art
has disappeared. but problem persists.