-
-
Save IBurntMyBread/4f6204c51b4d10c2e1b6eef0e766a25e to your computer and use it in GitHub Desktop.
.sh translated from .bat
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
echo "Script started" | |
#!/bin/bash | |
CURDIR=$(pwd) | |
# Define base directory for the script | |
BASE_DIR="/home/deck/Documents/Elden Ring Unalloyed" | |
cd "$BASE_DIR" || { echo "Could not enter the base directory."; exit 1; } | |
# Define base variables | |
INSTALL_MANIFEST="$BASE_DIR/install_manifest.txt" | |
PROTON_DRIVE_C="/home/deck/.steam/steam/steamapps/compatdata/1245620/pfx/drive_c" | |
# Define other variables | |
ALT_GAMEPATH="" | |
CLEAN_ERR=0 | |
SCRIPT_REMOVAL="" | |
SKIP_SEAMLESS="" | |
SKIP_RANDOMIZER="" | |
SKIP_REFORGED="" | |
SKIP_LOADER="" | |
WIZARD="" | |
# Function to verify the game installation | |
verify_install() { | |
FULL_GAME_PATH="/home/deck/.steam/steam/steamapps/common/ELDEN RING/Game/eldenring.exe" | |
echo "Checking for Elden Ring at: $FULL_GAME_PATH" | |
if [ -f "$FULL_GAME_PATH" ]; then | |
echo "Elden Ring found at $FULL_GAME_PATH" | |
else | |
echo "Error: Elden Ring not found at $FULL_GAME_PATH" | |
echo "Please ensure the path in tools/gamepath.txt is correct." | |
exit 1 | |
fi | |
} | |
# Call to verify the installation | |
verify_install | |
echo "####################################" | |
echo "# ELDEN RING UNALLOYED MODPACKER #" | |
echo "# Randomizer #" | |
echo "# Seamless Co-op #" | |
echo "# Reforged #" | |
echo "####################################" | |
UNALLOYED_VERSION="1.6.5.2" | |
echo " v$UNALLOYED_VERSION" | |
echo | |
echo "Press any key to begin installation..." | |
read -r -n 1 -s -p "" | |
# Read the game path from gamepath.txt | |
GAMEPATH=$(<tools/gamepath.txt) | |
GAMEPATH=${GAMEPATH//\"/} # Remove quotes | |
# Normalize path (remove trailing slash if present) | |
GAMEPATH=${GAMEPATH%/} | |
# Verifying the game installation | |
if [ -f "$GAMEPATH/eldenring" ]; then | |
GAMEPATH="$GAMEPATH" | |
elif [ -f "$GAMEPATH/Game/eldenring" ]; then | |
echo "$GAMEPATH/Game" > tools/gamepath.txt | |
GAMEPATH="$GAMEPATH/Game" | |
else | |
echo "Warning: Could not find Elden Ring install directory. Please open" | |
echo "$CURDIR/tools/gamepath.txt" | |
echo "and input the full path to your Elden Ring 'Game' folder, then save it before continuing." | |
sleep 3 | |
xdg-open "$CURDIR/tools/gamepath.txt" | |
read -r -p "Press any key to continue..." -n 1 -s | |
GAMEPATH=$(<tools/gamepath.txt) | |
fi | |
# Write GAMEPATH to gamepath.txt | |
echo "$GAMEPATH" > tools/gamepath.txt | |
# Checking for mods directory if an argument is provided | |
if [ ! -z "$1" ]; then | |
ls "$GAMEPATH/mods" | |
fi | |
echo "Checking dependencies..." | |
VERBOSE="" | |
INSTALL_ERROR="" | |
# Store the original working directory | |
original_dir=$(pwd) | |
# Set VERBOSE if an argument is provided | |
if [ ! -z "$1" ]; then | |
VERBOSE="-V" | |
fi | |
# Change to the tools directory | |
cd tools || exit | |
# Verifying DSMS Portable | |
while [ ! -f "./DSMSPortable.exe" ]; do | |
echo "DSMSPortable.exe not found. Please download the latest version and place it in the tools/ directory." | |
sleep 3 | |
xdg-open "https://github.com/mountlover/DSMSPortable/releases/latest" | |
read -r -p "Press any key to retry..." -n 1 -s | |
done | |
# Change back to the original directory | |
cd "$original_dir" || exit | |
# Now you can safely check for the downloads directory | |
if [ ! -d "$original_dir/downloads" ]; then | |
echo "The 'downloads' directory does not exist in $original_dir." | |
# Handle this situation, perhaps exit or create the directory | |
else | |
# Continue with operations that require the downloads directory | |
# Placeholder for your commands if the downloads directory exists | |
: | |
fi | |
# Check .NET version | |
# This is a complex scenario since running a Windows executable and checking .NET requires Wine/Proton | |
# Placeholder for the actual command to run DSMSPortable.exe with Wine/Proton and check .NET | |
# ... | |
echo "Detected .NET 6.0 Desktop Runtime" | |
if [ -z "$1" ]; then | |
sleep 1 | |
fi | |
# Check for unzip utility | |
if ! which unzip > /dev/null 2>&1; then | |
echo "Unzip utility not found. Please install unzip using your package manager." | |
echo "For example, on Ubuntu or Debian, run: sudo apt-get install unzip" | |
exit 1 | |
fi | |
# Check for PowerShell (optional) | |
# PowerShell on Linux is less common and might not be necessary for your script. | |
# If needed, guide the user to install it from the package manager or PowerShell GitHub releases page. | |
if ! which pwsh > /dev/null 2>&1; then | |
echo "PowerShell not found. If required, install it from your package manager or visit the PowerShell GitHub page." | |
# Provide the correct installation command for PowerShell based on the user's system, if applicable. | |
echo "PowerShell may already be installed as 'pwsh'." | |
exit 1 | |
fi | |
# Ensure the 'downloads' directory exists | |
echo "Current working directory: $(pwd)" | |
if [ ! -d "downloads" ]; then | |
echo "The 'downloads' directory does not exist." | |
exit 1 | |
fi | |
echo "Checking .zip files in downloads folder..." | |
cd downloads || exit | |
# Check for any .zip file | |
TEST_ARCHIVE=$(find . -maxdepth 1 -name '*.zip' | head -n 1) | |
if [ -z "$TEST_ARCHIVE" ]; then | |
WIZARD=1 | |
fi | |
# Check for Mod Engine 2 | |
while true; do | |
MODENGINE_ARCHIVE=$(find . -maxdepth 1 -name 'ModEngine-2*.zip' | head -n 1) | |
if [ ! -z "$MODENGINE_ARCHIVE" ]; then | |
break | |
fi | |
echo | |
echo "Please download the latest version of Mod Engine 2 and make sure it is saved to" | |
echo "$CURDIR/downloads/ before continuing." | |
echo "Note: Unalloyed requires the unaltered zip files to install correctly, do not extract the downloaded mod archives." | |
sleep 3 | |
echo "Visit https://github.com/soulsmods/ModEngine2/releases/latest to download Mod Engine 2." | |
read -p "Press any key to continue once the file is downloaded..." -r -n 1 -s | |
done | |
# Check for Elden Ring Reforged | |
while true; do | |
REFORGED_ARCHIVE=$(find . -maxdepth 1 -name 'ERRv*.zip' | head -n 1) | |
REFORGED_COMPAT=$(find . -maxdepth 1 -name '*compatibility*.zip' | head -n 1) | |
if [ -z "$SKIP_REFORGED" ] && [ -z "$REFORGED_ARCHIVE" ]; then | |
if [ ! -z "$1" ]; then | |
SKIP_REFORGED=1 | |
continue | |
fi | |
if [ ! -z "$WIZARD" ]; then | |
echo "Install Elden Ring Reforged? [y/n]" | |
read -r -n 1 -p "" choice | |
echo | |
if [ "$choice" != "y" ]; then | |
SKIP_REFORGED=1 | |
continue | |
fi | |
fi | |
echo "Please download the desired version of Reforged and save it to $CURDIR/downloads/ before continuing." | |
sleep 3 | |
echo "Visit https://www.nexusmods.com/eldenring/mods/541?tab=files&file_id=20111 to download Reforged." | |
read -p "Press any key to continue once the file is downloaded..." -r -n 1 -s | |
if [ ! -f "./ERRv*.zip" ]; then | |
echo "Archive still not found. Skip installing Elden Ring Reforged? [y/n]" | |
read -r -n 1 -p "" choice | |
echo | |
if [ "$choice" = "y" ]; then | |
SKIP_REFORGED=1 | |
fi | |
fi | |
fi | |
break | |
done | |
# Get Reforged version | |
if [ ! -z "$SKIP_REFORGED" ]; then | |
goto verifyyabber | |
fi | |
# Assuming REFORGED_ARCHIVE is something like "ERRv1.2.3.zip" | |
ERR_VERSION=${REFORGED_ARCHIVE:4:7} | |
ERR_VERSION=${ERR_VERSION//-/} | |
echo "Detected Elden Ring Reforged version $ERR_VERSION" | |
# Version comparison in bash is non-trivial for non-integer versions | |
# Skipping the detailed version comparison logic for simplicity | |
# Add version comparison logic as per your requirements | |
if [ -z "$1" ]; then | |
sleep 1 | |
fi | |
# Verify Yabber | |
while true; do | |
if [ -f "../tools/Yabber.exe" ]; then | |
break | |
fi | |
YABBER_ARCHIVE=$(find . -maxdepth 1 -name 'Yabber*.zip' | head -n 1) | |
if [ -z "$YABBER_ARCHIVE" ]; then | |
echo "Please download the latest version of Yabber and make sure it is saved to $CURDIR/downloads/ before continuing." | |
sleep 3 | |
echo "Visit https://github.com/mountlover/YabberLite/releases/latest to download Yabber." | |
read -p "Press any key to continue once the file is downloaded..." -r -n 1 -s | |
else | |
break | |
fi | |
done | |
# Copy DLL if necessary | |
if [ ! -f "../tools/TorrentEnabler/oo2core_6_win64.dll" ]; then | |
cp -f "$GAMEPATH/oo2core_6_win64.dll" "../tools/TorrentEnabler/" | |
fi | |
if [ ! -f "../tools/oo2core_6_win64.dll" ]; then | |
cp -f "$GAMEPATH/oo2core_6_win64.dll" "../tools/" | |
fi | |
# Check for Rings of Talent | |
while true; do | |
TALENT_ARCHIVE=$(find . -maxdepth 1 -name 'Talent*.zip' | grep -v 'BASE' | head -n 1) | |
if [ ! -z "$TALENT_ARCHIVE" ]; then | |
if [ ! -z "$SKIP_REFORGED" ]; then | |
if [ ! -z "$1" ]; then | |
break # Go to verifymodengine | |
fi | |
echo "Rings of Talent has Reforged as a dependency. Skip Rings of Talent? [y/n]" | |
read -r -n 1 -p "" choice | |
echo | |
if [ "$choice" = "y" ]; then | |
TALENT_ARCHIVE="" | |
break # Go to verifymodengine | |
fi | |
WIZARD=1 | |
SKIP_REFORGED="" | |
# Call verifyreforged function here if you have defined it | |
continue | |
fi | |
echo "Found Rings of Talent mod!" | |
if [ -z "$1" ]; then | |
sleep 1 | |
fi | |
break | |
elif [ ! -z "$WIZARD" ] && [ -z "$1" ] && [ -z "$SKIP_REFORGED" ]; then | |
echo "Install Rings of Talent? [y/n]" | |
read -r -n 1 -p "" choice | |
echo | |
if [ "$choice" = "y" ]; then | |
echo "Please download the latest version of Rings of Talent and save it to $CURDIR/downloads/ before continuing." | |
echo "Visit https://www.nexusmods.com/eldenring/mods/1772?tab=files to download." | |
read -p "Press any key to continue once the file is downloaded..." -r -n 1 -s | |
continue | |
fi | |
fi | |
break | |
done | |
# Check for Item and Enemy Randomizer | |
while true; do | |
RANDOMIZER_ARCHIVE=$(find . -maxdepth 1 -name '*Randomizer*.zip' | grep -v 'Fog' | head -n 1) | |
if [ -z "$SKIP_RANDOMIZER" ] && [ -z "$RANDOMIZER_ARCHIVE" ]; then | |
if [ ! -z "$1" ]; then | |
SKIP_RANDOMIZER=1 | |
[ "$CLEAN_ERR" = "0" ] && CLEAN_ERR=-1 | |
continue | |
fi | |
if [ ! -z "$WIZARD" ]; then | |
echo "Install Item and Enemy Randomizer? [y/n]" | |
read -r -n 1 -p "" choice | |
echo | |
if [ "$choice" != "y" ]; then | |
SKIP_RANDOMIZER=1 | |
[ "$CLEAN_ERR" = "0" ] && CLEAN_ERR=-1 | |
continue | |
fi | |
else | |
SKIP_RANDOMIZER=1 | |
[ "$CLEAN_ERR" = "0" ] && CLEAN_ERR=-1 | |
continue | |
fi | |
echo "Please download the latest version of Item and Enemy Randomizer and save it to $CURDIR/downloads/ before continuing." | |
echo "Visit https://www.nexusmods.com/eldenring/mods/428?tab=files to download." | |
read -p "Press any key to continue once the file is downloaded..." -r -n 1 -s | |
if [ ! -f "./Elden Ring Randomizer*.zip" ]; then | |
echo "Archive still not found. Skip installing Item and Enemy Randomizer? [y/n]" | |
read -r -n 1 -p "" choice | |
echo | |
if [ "$choice" = "y" ]; then | |
SKIP_RANDOMIZER=1 | |
[ "$CLEAN_ERR" = "0" ] && CLEAN_ERR=-1 | |
fi | |
fi | |
fi | |
break | |
done | |
# Check for Seamless Co-op | |
while true; do | |
SEAMLESS_ARCHIVE=$(find . -maxdepth 1 -name '*Seamless*.zip' | grep -v 'EXPERIMENTAL' | head -n 1) | |
SEAMLESS2_ARCHIVE=$(find . -maxdepth 1 -name '*Seamless*2.0*.zip' | grep -v 'EXPERIMENTAL' | head -n 1) | |
[ ! -z "$SEAMLESS2_ARCHIVE" ] && SEAMLESS_ARCHIVE=$SEAMLESS2_ARCHIVE | |
if [ -z "$SKIP_SEAMLESS" ] && [ -z "$SEAMLESS_ARCHIVE" ]; then | |
if [ ! -z "$1" ]; then | |
SKIP_SEAMLESS=1 | |
continue | |
fi | |
if [ ! -z "$WIZARD" ]; then | |
echo "Install Seamless Co-op? [y/n]" | |
read -r -n 1 -p "" choice | |
echo | |
if [ "$choice" != "y" ]; then | |
SKIP_SEAMLESS=1 | |
continue | |
fi | |
else | |
SKIP_SEAMLESS=1 | |
continue | |
fi | |
echo "Please download the latest version of Seamless Co-op and save it to $CURDIR/downloads/ before continuing." | |
echo "Visit https://www.nexusmods.com/eldenring/mods/510?tab=files to download." | |
read -p "Press any key to continue once the file is downloaded..." -r -n 1 -s | |
if [ ! -f "./Seamless Co-op*.zip" ]; then | |
echo "Archive still not found. Skip installing Seamless Co-op? [y/n]" | |
read -r -n 1 -p "" choice | |
echo | |
if [ "$choice" = "y" ]; then | |
SKIP_SEAMLESS=1 | |
fi | |
fi | |
fi | |
break | |
done | |
# Check for Elden Mod Loader | |
while true; do | |
LOADER_ARCHIVE=$(find . -maxdepth 1 -name 'EldenModLoader*.zip' | head -n 1) | |
if [ -z "$SKIP_LOADER" ] && [ -z "$LOADER_ARCHIVE" ]; then | |
if [ ! -z "$SEAMLESS2_ARCHIVE" ] || [ ! -z "$1" ]; then | |
SKIP_LOADER=1 | |
continue | |
fi | |
if [ ! -z "$WIZARD" ]; then | |
echo "Install Elden Mod Loader? [y/n]" | |
read -r -n 1 -p "" choice | |
echo | |
if [ "$choice" != "y" ]; then | |
SKIP_LOADER=1 | |
continue | |
fi | |
else | |
SKIP_LOADER=1 | |
continue | |
fi | |
echo "Please download the latest version of Elden Mod Loader and save it to $CURDIR/downloads/ before continuing." | |
echo "Visit https://www.nexusmods.com/eldenring/mods/117?tab=files to download." | |
read -p "Press any key to continue once the file is downloaded..." -r -n 1 -s | |
if [ ! -f "./EldenModLoader*.zip" ]; then | |
echo "Archive still not found. Skip installing Elden Mod Loader? [y/n]" | |
read -r -n 1 -p "" choice | |
echo | |
if [ "$choice" = "y" ]; then | |
SKIP_LOADER=1 | |
fi | |
fi | |
fi | |
break | |
done | |
# Check for Clever's Moveset Modpack | |
CLEVERS_ARCHIVE=$(find . -maxdepth 1 -name 'moveset*modpack*.zip' | head -n 1) | |
CLEVERS_VERSION=0 | |
if [ ! -z "$CLEVERS_ARCHIVE" ]; then | |
# Extract version from filename | |
# Assuming filename format like "moveset-modpack-13.1.zip" | |
CLEVERS_VERSION=${CLEVERS_ARCHIVE:16:4} | |
echo "Found Clever's Moveset Modpack v$CLEVERS_VERSION" | |
# Simplified version comparison; adjust as needed | |
if [[ "$CLEVERS_VERSION" > "$COMPAT_VERSION_CLEVERS" ]]; then | |
echo "Warning: Latest known compatible version is $COMPAT_VERSION_CLEVERS" | |
sleep 4 | |
fi | |
if [ -z "$1" ]; then | |
sleep 1 | |
fi | |
elif [ ! -z "$WIZARD" ] && [ -z "$1" ]; then | |
echo "Install Clever's Moveset Modpack? [y/n]" | |
read -r -n 1 -p "" choice | |
echo | |
if [ "$choice" != "y" ]; then | |
echo "Please download the desired version of Clever's Moveset Modpack and save it to $CURDIR/downloads/ before continuing." | |
echo "Visit https://www.nexusmods.com/eldenring/mods/1928?tab=files to download." | |
read -p "Press any key to continue once the file is downloaded..." -r -n 1 -s | |
fi | |
fi | |
# Check for Fog Gate Randomizer only if WIZARD is set | |
if [ ! -z "$WIZARD" ]; then | |
while true; do | |
FOG_ARCHIVE=$(find "$CURDIR/downloads" -maxdepth 1 -name '*Fog*Randomizer*.zip' | head -n 1) | |
if [ ! -z "$FOG_ARCHIVE" ]; then | |
echo "Found Fog Gate Randomizer!" | |
CLEAN_ERR=1 | |
[ -z "$1" ] && sleep 1 | |
break | |
elif [ -z "$1" ]; then | |
echo "Install Fog Gate Randomizer? [y/n]" | |
read -r -n 1 -p "" choice | |
echo | |
if [ "$choice" = "y" ]; then | |
echo "Please download the latest version of Fog Gate Randomizer and save it to $CURDIR/downloads/ before continuing." | |
echo "Visit https://www.nexusmods.com/eldenring/mods/3295?tab=files to download." | |
read -p "Press any key to continue once the file is downloaded..." -r -n 1 -s | |
else | |
break | |
fi | |
fi | |
done | |
fi | |
# Assuming CURDIR is correctly set to the directory containing the 'downloads' folder | |
# and WIZARD variable controls the optional interactive mode. | |
# Check for First Person Souls only if WIZARD is set | |
if [ ! -z "$WIZARD" ]; then | |
# Loop until the file is found or the user opts out | |
while true; do | |
# Try to find the FPS archive in the 'downloads' directory | |
FPS_ARCHIVE=$(find "$CURDIR/downloads" -maxdepth 1 -name '*ERFPS*.zip' | head -n 1) | |
# If the file is found, break out of the loop | |
if [ ! -z "$FPS_ARCHIVE" ]; then | |
echo "Found First Person Souls!" | |
[ -z "$1" ] && sleep 1 | |
break | |
# If running in wizard mode and no command line arguments, prompt the user | |
elif [ -z "$1" ]; then | |
echo "Install First Person Souls? [y/n]" | |
read -r -n 1 -p "" choice | |
echo | |
if [ "$choice" = "y" ]; then | |
echo "Please download the desired version of First Person Souls and save it to $CURDIR/downloads/ before continuing." | |
echo "Visit https://www.nexusmods.com/eldenring/mods/3266?tab=files to download." | |
read -p "Press any key to continue once the file is downloaded..." -r -n 1 -s | |
else | |
break | |
fi | |
fi | |
done | |
fi | |
# Check for Erdtools | |
while true; do | |
ERD_ARCHIVE=$(find . -maxdepth 1 -name '*Erd*Tools*CPP*.zip' | head -n 1) | |
if [ ! -z "$ERD_ARCHIVE" ]; then | |
echo "Found ErdTools!" | |
[ -z "$1" ] && sleep 1 | |
break | |
elif [ ! -z "$WIZARD" ] && [ -z "$1" ]; then | |
echo "Install Erd Tools? [y/n]" | |
read -r -n 1 -p "" choice | |
echo | |
if [ "$choice" = "y" ]; then | |
echo "Please download the latest version of Erd Tools and save it to $CURDIR/downloads/ before continuing." | |
echo "Visit https://www.nexusmods.com/eldenring/mods/2233?tab=files to download." | |
read -p "Press any key to continue once the file is downloaded..." -r -n 1 -s | |
else | |
break | |
fi | |
fi | |
done | |
# Check for Posture Bar Mod only if WIZARD is set | |
if [ ! -z "$WIZARD" ]; then | |
while true; do | |
POSTURE_ARCHIVE=$(find "$CURDIR/downloads" -maxdepth 1 -name '*PostureBarMod*.zip' | head -n 1) | |
if [ ! -z "$POSTURE_ARCHIVE" ]; then | |
echo "Found Posture Bar Mod!" | |
[ -z "$1" ] && sleep 1 | |
break | |
elif [ -z "$1" ]; then | |
echo "Install Posture Bar Mod? [y/n]" | |
read -r -n 1 -p "" choice | |
echo | |
if [ "$choice" = "y" ]; then | |
echo "Please download the latest version of Posture Bar Mod and save it to $CURDIR/downloads/ before continuing." | |
echo "Visit https://www.nexusmods.com/eldenring/mods/3405?tab=files to download." | |
read -p "Press any key to continue once the file is downloaded..." -r -n 1 -s | |
else | |
break | |
fi | |
fi | |
done | |
fi | |
# Check for Diablo Style Loot Remastered | |
while true; do | |
DSLR_ARCHIVE=$(find . -maxdepth 1 -name '*DSLR*.zip' | head -n 1) | |
if [ ! -z "$DSLR_ARCHIVE" ]; then | |
echo "Found Diablo Style Loot Remastered!" | |
[ -z "$1" ] && sleep 1 | |
break | |
elif [ ! -z "$WIZARD" ] && [ -z "$1" ]; then | |
echo "Install Diablo Style Loot Remastered? [y/n]" | |
read -r -n 1 -p "" choice | |
echo | |
if [ "$choice" = "y" ]; then | |
echo "Please download the latest version of Diablo Style Loot Remastered and save it to $CURDIR/downloads/ before continuing." | |
echo "Visit https://www.nexusmods.com/eldenring/mods/3498?tab=files to download." | |
read -p "Press any key to continue once the file is downloaded..." -r -n 1 -s | |
else | |
break | |
fi | |
fi | |
done | |
# Arrow Expansion compatibility check | |
if [ ! -z "$SKIP_RANDOMIZER" ]; then | |
ARROW_ARCHIVE=$(find . -maxdepth 1 -name '*Arrow*Expansion*Installer*.zip' | head -n 1) | |
if [ ! -z "$ARROW_ARCHIVE" ]; then | |
echo "Found Arrow Expansion!" | |
[ -z "$1" ] && sleep 1 | |
fi | |
fi | |
cd .. || exit | |
# Load randomizer options | |
RANDOMIZEOPT="" | |
if [ -z "$FOG_ARCHIVE" ]; then | |
RANDOMIZEOPT=$(grep "Options:" unalloyed.randomizeopt | grep "Unalloyed" | cut -d' ' -f2-) | |
else | |
RANDOMIZEOPT=$(grep "Options:" unalloyed_fog.randomizeopt | grep "Unalloyed" | cut -d' ' -f2-) | |
fi | |
echo "All necessary files found! Beginning installation..." | |
echo "Elden Ring Unalloyed Version $UNALLOYED_VERSION" >> "$INSTALL_MANIFEST" | |
echo "" >> "$INSTALL_MANIFEST" | |
cd tools || exit | |
# Get Elden Ring Version | |
PARAM_VERSION=$(DSMSPortable.exe "$GAMEPATH/regulation.bin" -V | grep "Vanilla" | awk '{print $4}') | |
echo "Elden Ring Version $PARAM_VERSION" >> "$INSTALL_MANIFEST" | |
echo "" >> "$INSTALL_MANIFEST" | |
# Install Yabber if necessary | |
if [ ! -z "$YABBER_ARCHIVE" ]; then | |
unzip -o -j "../downloads/$YABBER_ARCHIVE" -d . | |
fi | |
# Install Mod Engine 2 | |
mkdir -p tmp | |
unzip -o "../downloads/$MODENGINE_ARCHIVE" -x '**/config_*' 'config_*' '**/launchmod_*' 'launchmod_*' -d tmp | |
if [ $? -eq 0 ]; then | |
echo "Extracted ModEngine2" >> "$INSTALL_MANIFEST" | |
else | |
echo "Failed to extract ModEngine2 with error code $?" >> "$INSTALL_MANIFEST" | |
INSTALL_ERROR=$? | |
fi | |
echo "" >> "$INSTALL_MANIFEST" | |
cd tmp | |
if [ -d ModEngine-2.* ]; then | |
cd ModEngine-2.* || exit | |
cp -r * "$CURDIR" | |
fi | |
cd "$CURDIR/tools" | |
rm -rf tmp | |
# Install and Configure Elden Mod Loader (or use ME2 if not present) | |
DLLMODS="" | |
if [ -z "$SKIP_LOADER" ]; then | |
unzip -o "../downloads/$LOADER_ARCHIVE" -d "$GAMEPATH" | |
if [ $? -ne 0 ]; then | |
echo "Failed to extract $LOADER_ARCHIVE with error code $?" >> "$INSTALL_MANIFEST" | |
INSTALL_ERROR=$? | |
echo "" >> "$INSTALL_MANIFEST" | |
fi | |
# Future proofing for upgrades | |
[ -f "$GAMEPATH/modloader.dll" ] && rm -f "$GAMEPATH/modloader.dll" | |
# Rename dinput8.dll to modloader.dll | |
mv "$GAMEPATH/dinput8.dll" "$GAMEPATH/modloader.dll" | |
# Create mod_loader_config.ini | |
{ | |
echo "[modloader]" | |
echo "" | |
if [ ! -z "$POSTURE_ARCHIVE" ]; then | |
echo "load_delay = 9000" | |
else | |
echo "load_delay = 4000" | |
fi | |
echo "" | |
echo "show_terminal = 0" | |
echo "" | |
echo "[loadorder]" | |
echo "" | |
[ -z "$SKIP_SEAMLESS" ] && echo "elden_ring_seamless_coop.dll = 0" | |
echo "" | |
[ ! -z "$FPS_ARCHIVE" ] && echo "erfps.dll = 1" | |
echo "" | |
[ ! -z "$ERD_ARCHIVE" ] && echo "ErdTools.dll = 2" | |
echo "" | |
[ ! -z "$POSTURE_ARCHIVE" ] && echo "PostureBarMod.dll = 3" | |
} > "$GAMEPATH/mod_loader_config.ini" | |
cp ../ref/launchmod_eldenring_EML.bat ../launchmod_eldenring.bat | |
DLLMODS="$GAMEPATH/mods" | |
else | |
mkdir -p "$CURDIR/DLL Mods" | |
cp ../ref/launchmod_eldenring_ME2.bat ../launchmod_eldenring.bat | |
DLLMODS="$CURDIR/DLL Mods" | |
fi | |
# Install Elden Ring Reforged | |
if [ -z "$SKIP_REFORGED" ]; then | |
if [ "$CLEAN_ERR" -ge 0 ]; then | |
# Randomizer friendly install | |
unzip -o "../downloads/$REFORGED_ARCHIVE" -x '**/map/MapStudio/m11_05_00_00.msb.dcx' '**/map/MapStudio/m12_01_00_00.msb.dcx' [other files to exclude] -d .. | |
echo "Installed Elden Ring Reforged version $ERR_VERSION-randomizer" >> "$INSTALL_MANIFEST" | |
else | |
# Full install | |
unzip -o "../downloads/$REFORGED_ARCHIVE" -d .. | |
echo "Installed Elden Ring Reforged version $ERR_VERSION" >> "$INSTALL_MANIFEST" | |
fi | |
fi | |
cd .. || exit | |
# Check and clean up junk files | |
while [ -f ERR*.zip ]; do | |
mkdir -p junk | |
mv ERR*.zip junk | |
rm -rf junk | |
done | |
# Additional file and directory handling | |
if [ -d ERR* ]; then | |
cd ERR* || exit | |
# This next 'if' seems redundant because you're already in an 'ERR*' directory. | |
# If it's supposed to be a nested directory with the same pattern, it's okay. | |
if [ -d ERR* ]; then | |
cd ERR* || exit | |
cp -r * .. | |
cd .. | |
for d in $(find . -maxdepth 1 -type d -name 'ERR*'); do | |
rm -rf "$d" | |
done | |
fi # This 'fi' closes the nested 'if [ -d ERR* ]' | |
cd "$CURDIR" || exit | |
fi # This 'fi' closes the outer 'if [ -d ERR* ]' | |
# Function to overwrite the 'mod' directory | |
overwrite_mod() { | |
rm -rf mod | |
if [ $? -ne 0 ]; then | |
echo -e "\nERROR: Could not overwrite $CURDIR/mod" | |
echo "Please close any open files or folders in this directory and then press any key to try again..." | |
read -r -s -n 1 | |
echo -e "\n" | |
overwrite_mod # Recursively call the function until successful | |
fi | |
} | |
# Calling the function to overwrite the 'mod' directory | |
overwrite_mod | |
# If SKIP_REFORGED is not set, proceed with the specific actions | |
if [ -z "${SKIP_REFORGED}" ]; then | |
cd ERR* || { echo "ERROR: ERR directory not found."; exit 1; } | |
# If CLEAN_ERR is greater than 0, clean the map and event directories | |
if [ ${CLEAN_ERR} -gt 0 ]; then | |
mkdir -p tmp tmp2 tmp2/MapStudio | |
mv event/common.emevd.dcx tmp/ | |
mv event/common_func.emevd.dcx tmp/ | |
mv event/m10_01_00_00.emevd.dcx tmp/ | |
mv map/MapStudio/m10_01_00_00.msb.dcx tmp2/MapStudio/ | |
rm -rf event map | |
mv tmp event | |
mv tmp2 map | |
echo "-clean" >> "$INSTALL_MANIFEST" | |
fi | |
cd .. || { echo "ERROR: Failed to return to the original directory."; exit 1; } | |
fi | |
# Clean the map and event directories if necessary | |
if [ "$CLEAN_ERR" -gt 0 ]; then | |
# Log the start of the cleanup | |
echo "Starting cleanup operation..." | |
# Create temporary directories to hold certain files | |
mkdir -p tmp tmp2 tmp2/MapStudio | |
echo "Temporary directories created." | |
# Check and move some event files to the temporary directory | |
for file in event/common.emevd.dcx event/common_func.emevd.dcx event/m10_01_00_00.emevd.dcx; do | |
if [ -f "$file" ]; then | |
mv "$file" tmp | |
echo "Moved $file to temporary storage." | |
else | |
echo "File $file not found, skipping." | |
fi | |
done | |
# Check and move a map file to another temporary directory | |
if [ -f "map/MapStudio/m10_01_00_00.msb.dcx" ]; then | |
mv map/MapStudio/m10_01_00_00.msb.dcx tmp2/MapStudio | |
echo "Moved map file to temporary storage." | |
else | |
echo "Map file not found, skipping." | |
fi | |
# Check before removing the directories | |
if [ -d event ] && [ -d map ]; then | |
rm -rf event map | |
echo "Removed event and map directories." | |
else | |
echo "event or map directories not found, skipping removal." | |
fi | |
# Move the temporary directories back to their original names | |
mv tmp event | |
mv tmp2 map | |
echo "Restored directories from temporary storage." | |
# Log the cleanup operation to an install manifest | |
echo "-clean" >> "$INSTALL_MANIFEST" | |
echo "Cleanup operation logged." | |
fi | |
cd .. || exit | |
# Log the current directory for debugging | |
echo "Current directory before finding ERR*: $(pwd)" | |
# Change to the base directory | |
cd "$BASE_DIR" || { echo "Could not change to the base directory: $BASE_DIR"; exit 1; } | |
# Log the change for debugging | |
echo "Changed to base directory: $(pwd)" | |
# Find the ERR* directory within the base directory | |
ERR_DIR=$(find "$BASE_DIR" -maxdepth 1 -type d -name 'ERR*' | sort -r | head -n 1) | |
# Log the found directory for debugging | |
echo "Found ERR directory: $ERR_DIR" | |
# Check if the ERR_DIR variable is set to a non-empty string | |
if [[ -n $ERR_DIR ]]; then | |
echo "Attempting to move $ERR_DIR to mod..." | |
mv "$ERR_DIR" mod && echo "Moved $ERR_DIR to mod." | |
else | |
echo "ERROR: No directory matching 'ERR*' was found in $BASE_DIR" | |
fi | |
# Assuming you are in the /home/deck/Documents/Elden Ring Unalloyed directory | |
# Make a backup of ERR param file if the mod directory and regulation.bin exist | |
if [ -d "mod" ] && [ -f "mod/regulation.bin" ]; then | |
cp -f mod/regulation.bin mod/regulation.bin.bak | |
else | |
echo "ERROR: 'mod/regulation.bin' does not exist. Cannot make a backup." | |
exit 1 | |
fi | |
# Change directory to 'tools' if it exists | |
if [ -d "tools" ]; then | |
cd tools || { echo "ERROR: Failed to enter 'tools' directory."; exit 1; } | |
else | |
echo "ERROR: 'tools' directory does not exist." | |
exit 1 | |
fi | |
# Check if Reforged should be skipped | |
if [ -z "$SKIP_REFORGED" ]; then | |
# Check if the "ERR*" directory exists after renaming it to 'mod' | |
if [ -d "../mod" ]; then | |
# Presuming the compatibility patch is in the 'mod' directory | |
if [ "$CLEAN_ERR" = "0" ] && [ -n "$REFORGED_COMPAT" ]; then | |
unzip -o "../downloads/$REFORGED_COMPAT" -d "../mod" | |
echo "-compat" >> "../$INSTALL_MANIFEST" | |
fi | |
echo "" >> "../$INSTALL_MANIFEST" | |
else | |
echo "ERROR: 'mod' directory does not exist after rename. Cannot continue with patch installation." | |
exit 1 | |
fi | |
fi | |
# Randomizer compatibility edits | |
if [ "$CLEAN_ERR" -ge 0 ]; then | |
# Uncomment the following if you need to perform specific DSMSPortable.exe operations | |
# DSMSPortable.exe ../mod/regulation.bin -R "ItemLotParam_map:prop lotItemId01 800010 && proprange getItemFlagId 1000000000 infinity" | |
DSMSPortable.exe --emevdmerge ../randomizer/dist/Vanilla/m18_00_00_00.emevd.dcx ../ref/quickstart.emevd.dcx -O ../mod/event/m18_00_00_00.emevd.dcx $VERBOSE | |
DSMSPortable.exe --emevdmerge ../mod/event/common_func.emevd.dcx ../ref/lattice.emevd.dcx $VERBOSE | |
if [ $? -eq 0 ]; then | |
echo "Performed ItemLot Edits" >> "$INSTALL_MANIFEST" | |
else | |
echo "Attempted ItemLot Edits with error code $?" >> "$INSTALL_MANIFEST" | |
INSTALL_ERROR=$? | |
fi | |
if [ -f "../mod/regulation.bin.temp" ]; then | |
mv -f ../mod/regulation.bin.temp ../mod/regulation.bin | |
echo " and performed recovery" >> "$INSTALL_MANIFEST" | |
fi | |
echo "" >> "$INSTALL_MANIFEST" | |
fi | |
# Additional DSMSPortable.exe operations | |
DSMSPortable.exe "../mod/regulation.bin" -C "../ref/EquipParamWeapon_somberaffinities.csv" | |
if [ $? -eq 0 ]; then | |
echo "Added Somber Affinities" >> "$INSTALL_MANIFEST" | |
else | |
echo "Attempted Somber Affinity edits with error code $?" >> "$INSTALL_MANIFEST" | |
INSTALL_ERROR=$? | |
fi | |
# Repeat similar structure for SCRIPT_REMOVAL and other DSMSPortable.exe operations | |
cd .. || exit | |
# Backup handling | |
if [ -f mod/regulation.bin.prev ] && [ ! -f mod/regulation.bin.bak ]; then | |
mv -f mod/regulation.bin.prev mod/regulation.bin.bak | |
fi | |
if [ -f mod/regulation.bin.temp ]; then | |
mv -f mod/regulation.bin.temp mod/regulation.bin | |
echo " and performed recovery" >> "$INSTALL_MANIFEST" | |
fi | |
echo "" >> "$INSTALL_MANIFEST" | |
[ -z "$1" ] && sleep 1 | |
if [ -z "$CLEVERS_ARCHIVE" ]; then | |
# If we are skipping Reforged and Clever's, still apply just the edits for Unalloyed to the vanilla param file | |
cd tools || exit | |
if [ ! -d ../mod ]; then | |
mkdir ../mod | |
fi | |
DSMSPortable.exe "$GAMEPATH/regulation.bin" -M+ "../massedit/unalloyed.massedit" -O "../mod/regulation.bin" | |
if [ $? -eq 0 ]; then | |
echo "Applied Unalloyed edits without Reforged" >> "$INSTALL_MANIFEST" | |
else | |
echo "Attempted Unalloyed edits with error code $?" >> "$INSTALL_MANIFEST" | |
INSTALL_ERROR=$? | |
fi | |
cd .. || exit | |
# Backup handling | |
if [ -f mod/regulation.bin.temp ]; then | |
mv -f mod/regulation.bin.temp mod/regulation.bin | |
echo " and performed recovery" >> "$INSTALL_MANIFEST" | |
fi | |
echo "" >> "$INSTALL_MANIFEST" | |
# Create directory if it doesn't exist and copy files | |
if [ ! -d mod/sfx ]; then | |
mkdir mod/sfx | |
fi | |
cp -f ref/sfxbnd_commoneffects_1091.ffxbnd.dcx mod/sfx/sfxbnd_commoneffects.ffxbnd.dcx | |
fi | |
cd "$CURDIR/tools" || exit | |
mkdir tmp | |
if [ ! -z "$RANDOMIZER_ARCHIVE" ]; then | |
unzip -o -j "../downloads/$RANDOMIZER_ARCHIVE" **m11_05_00_00.msb.dcx **m12_01_00_00.msb.dcx **m12_02_00_00.msb.dcx **m12_03_00_00.msb.dcx **m19_00_00_00.msb.dcx -d tmp | |
fi | |
# Move patched files if necessary | |
if [ -f "../mod/map/MapStudio/m11_05_00_00.msb.dcx" ]; then | |
mv -f "../mod/map/MapStudio/m11_05_00_00.msb.dcx" tmp | |
fi | |
# Add more similar checks for other files... | |
# Apply Torrent edits | |
./TorrentEnabler/ERTorrentEnabler.exe "$CURDIR/tools/tmp" | |
if [ $? -eq 0 ]; then | |
echo "Applied Torrent edits" >> "$INSTALL_MANIFEST" | |
else | |
echo "Attempted Torrent edits with error code $?" >> "$INSTALL_MANIFEST" | |
INSTALL_ERROR=$? | |
fi | |
echo "" >> "$INSTALL_MANIFEST" | |
# Create necessary directories | |
mkdir -p ../mod/map/MapStudio | |
# Move patched files to the correct location | |
mv -f "./tmp_torrentEnabled"/*.msb.dcx "../mod/map/MapStudio" | |
rm -rf tmp | |
rm -rf tmp_torrentEnabled | |
cd "$CURDIR/tools" || exit | |
# Install Seamless Co-op | |
SEAMLESS_CONF="" | |
if [ -f "$GAMEPATH/mods/seamlesscoopsettings.ini" ]; then | |
SEAMLESS_CONF="*/*seamlesscoopsettings.ini" | |
elif [ -f "$CURDIR/DLL Mods/seamlesscoopsettings.ini" ]; then | |
SEAMLESS_CONF="*/*seamlesscoopsettings.ini" | |
fi | |
if [ -z "$SKIP_SEAMLESS" ]; then | |
unzip -o "../downloads/$SEAMLESS_ARCHIVE" -x launch_elden_ring_seamlesscoop.exe $SEAMLESS_CONF -d "$GAMEPATH" | |
if [ $? -eq 0 ]; then | |
echo "Extracted $SEAMLESS_ARCHIVE" >> "$INSTALL_MANIFEST" | |
else | |
echo "Failed to extract $SEAMLESS_ARCHIVE with error code $?" >> "$INSTALL_MANIFEST" | |
INSTALL_ERROR=$? | |
fi | |
echo "" >> "$INSTALL_MANIFEST" | |
if [ -z "$SKIP_LOADER" ]; then | |
if [ -f "$GAMEPATH/SeamlessCoop/elden_ring_seamless_coop.dll" ]; then | |
mv -f "$GAMEPATH/SeamlessCoop/elden_ring_seamless_coop.dll" "$GAMEPATH/mods" | |
fi | |
if [ ! -f "$GAMEPATH/mods/seamlesscoopsettings.ini" ]; then | |
if [ -f "$CURDIR/DLL Mods/seamlesscoopsettings.ini" ]; then | |
cp "$CURDIR/DLL Mods/seamlesscoopsettings.ini" "$GAMEPATH/mods/seamlesscoopsettings.ini" | |
else | |
mv -f "$GAMEPATH/SeamlessCoop/seamlesscoopsettings.ini" "$GAMEPATH/mods" | |
fi | |
fi | |
else | |
if [ -f "$GAMEPATH/SeamlessCoop/elden_ring_seamless_coop.dll" ]; then | |
mv -f "$GAMEPATH/SeamlessCoop/elden_ring_seamless_coop.dll" "$CURDIR/DLL Mods" | |
fi | |
if [ ! -f "$CURDIR/DLL Mods/seamlesscoopsettings.ini" ]; then | |
if [ -f "$GAMEPATH/mods/seamlesscoopsettings.ini" ]; then | |
cp "$GAMEPATH/mods/seamlesscoopsettings.ini" "$CURDIR/DLL Mods/seamlesscoopsettings.ini" | |
else | |
mv -f "$GAMEPATH/SeamlessCoop/seamlesscoopsettings.ini" "$CURDIR/DLL Mods" | |
fi | |
fi | |
fi | |
fi | |
# Install First Person Souls | |
FPS_CONF="" | |
if [ -f "$GAMEPATH/mods/erfps_settings.ini" ]; then | |
FPS_CONF=erfps_settings.ini | |
elif [ -f "$CURDIR/DLL Mods/erfps_settings.ini" ]; then | |
FPS_CONF=erfps_settings.ini | |
fi | |
if [ ! -z "$FPS_ARCHIVE" ]; then | |
mkdir tmp | |
unzip -o "../downloads/$FPS_ARCHIVE" -x launch_elden_ring_erfps.exe "$FPS_CONF" -d tmp | |
if [ -z "$SKIP_LOADER" ]; then | |
mv -f tmp/erfps.dll "$GAMEPATH/mods" | |
if [ ! -f "$GAMEPATH/mods/erfps_settings.ini" ]; then | |
if [ -f "$CURDIR/DLL Mods/erfps_settings.ini" ]; then | |
cp "$CURDIR/DLL Mods/erfps_settings.ini" "$GAMEPATH/mods/erfps_settings.ini" | |
else | |
mv -f tmp/erfps_settings.ini "$GAMEPATH/mods" | |
fi | |
fi | |
else | |
mv -f tmp/erfps.dll "$CURDIR/DLL Mods" | |
if [ ! -f "$CURDIR/DLL Mods/erfps_settings.ini" ]; then | |
if [ -f "$GAMEPATH/mods/erfps_settings.ini" ]; then | |
cp "$GAMEPATH/mods/erfps_settings.ini" "$CURDIR/DLL Mods/erfps_settings.ini" | |
else | |
mv -f tmp/erfps_settings.ini "$CURDIR/DLL Mods" | |
fi | |
fi | |
fi | |
mv -f tmp/erfps_readme.txt ../ERFPS_README.txt | |
rm -rf tmp | |
fi | |
# Install Posture Bar Mod | |
POSTURE_CONF="" | |
if [ -f "$GAMEPATH/mods/PostureBarModConfig.ini" ]; then | |
POSTURE_CONF="**PostureBarModConfig.ini" | |
elif [ -f "$CURDIR/DLL Mods/PostureBarModConfig.ini" ]; then | |
POSTURE_CONF="**PostureBarModConfig.ini" | |
fi | |
if [ ! -z "$POSTURE_ARCHIVE" ]; then | |
mkdir tmp | |
unzip -o "../downloads/$POSTURE_ARCHIVE" -x "$POSTURE_CONF" -d tmp | |
cd tmp | |
if [ -d PostureBarMod* ]; then | |
cd PostureBarMod* | |
cp -r * .. | |
cd .. | |
rm -rf PostureBarMod* | |
fi | |
cd .. | |
if [ -z "$SKIP_LOADER" ]; then | |
cp -r tmp/* "$GAMEPATH/mods" | |
if [ ! -f "$GAMEPATH/mods/PostureBarModConfig.ini" ]; then | |
if [ -f "$CURDIR/DLL Mods/PostureBarModConfig.ini" ]; then | |
cp "$CURDIR/DLL Mods/PostureBarModConfig.ini" "$GAMEPATH/mods/PostureBarModConfig.ini" | |
else | |
mv -f tmp/PostureBarModConfig.ini "$GAMEPATH/mods" | |
fi | |
fi | |
else | |
cp -r tmp/* "$CURDIR/DLL Mods" | |
if [ ! -f "$CURDIR/DLL Mods/PostureBarModConfig.ini" ]; then | |
if [ -f "$GAMEPATH/mods/PostureBarModConfig.ini" ]; then | |
cp "$GAMEPATH/mods/PostureBarModConfig.ini" "$CURDIR/DLL Mods/PostureBarModConfig.ini" | |
else | |
mv -f tmp/PostureBarModConfig.ini "$CURDIR/DLL Mods" | |
fi | |
fi | |
fi | |
rm -rf tmp | |
# Fix Posture Bar positioning | |
if [ -z "$SKIP_REFORGED" ]; then | |
sed -i 's/FirstBossScreenY = 876.0/FirstBossScreenY = 958.0/' "$DLLMODS/PostureBarModConfig.ini" | |
fi | |
fi | |
# Install ErdTools | |
ERD_CONF="" | |
if [ -f "$GAMEPATH/mods/erd_tools.ini" ]; then | |
ERD_CONF=erd_tools.ini | |
elif [ -f "$CURDIR/DLL Mods/erd_tools.ini" ]; then | |
ERD_CONF=erd_tools.ini | |
fi | |
if [ ! -z "$ERD_ARCHIVE" ]; then | |
mkdir tmp | |
unzip -j -o "../downloads/$ERD_ARCHIVE" -x "$ERD_CONF" README.md -d tmp | |
if [ -z "$SKIP_LOADER" ]; then | |
cp -r tmp/* "$GAMEPATH/mods" | |
if [ ! -f "$GAMEPATH/mods/erd_tools.ini" ]; then | |
if [ -f "$CURDIR/DLL Mods/erd_tools.ini" ]; then | |
cp "$CURDIR/DLL Mods/erd_tools.ini" "$GAMEPATH/mods/erd_tools.ini" | |
else | |
mv -f tmp/erd_tools.ini "$GAMEPATH/mods" | |
fi | |
fi | |
else | |
cp -r tmp/* "$CURDIR/DLL Mods" | |
if [ ! -f "$CURDIR/DLL Mods/erd_tools.ini" ]; then | |
if [ -f "$GAMEPATH/mods/erd_tools.ini" ]; then | |
cp "$GAMEPATH/mods/erd_tools.ini" "$CURDIR/DLL Mods/erd_tools.ini" | |
else | |
mv -f tmp/erd_tools.ini "$CURDIR/DLL Mods" | |
fi | |
fi | |
fi | |
rm -rf tmp | |
if [ -z "$SKIP_SEAMLESS" ]; then | |
sed -i 's/save_extension = .*/save_extension = co2/' "$DLLMODS/erd_tools.ini" | |
else | |
sed -i 's/save_extension = .*/save_extension = sl2/' "$DLLMODS/erd_tools.ini" | |
fi | |
if [ ! -z "$POSTURE_ARCHIVE" ]; then | |
sed -i 's/boss_poise_meter = 1/boss_poise_meter = 0/' "$DLLMODS/erd_tools.ini" | |
sed -i 's/entity_poise_meter = 1/entity_poise_meter = 0/' "$DLLMODS/erd_tools.ini" | |
fi | |
fi | |
cd "$CURDIR" | |
# Check if Clevers Archive is set | |
if [ ! -z "$CLEVERS_ARCHIVE" ]; then | |
# Change directory to tools and create mod directory | |
cd tools | |
mkdir -p ../mod | |
# Unzip the Clevers Archive into the mod directory | |
unzip -o "../downloads/$CLEVERS_ARCHIVE" -d ../mod | |
# Check if the unzip operation was successful | |
if [ $? -eq 0 ]; then | |
echo "Installed Clever's Moveset Modpack v$CLEVERS_VERSION" >> "$INSTALL_MANIFEST" | |
else | |
echo "Attempted fresh install of Clever's with error code $?" >> "$INSTALL_MANIFEST" | |
INSTALL_ERROR=$? | |
fi | |
echo "" >> "$INSTALL_MANIFEST" | |
# Run DSMSPortable.exe with the required arguments | |
DSMSPortable.exe "../mod/regulation.bin" -M+ "../massedit/unalloyed.massedit" | |
# Check if the DSMSPortable operation was successful | |
if [ $? -eq 0 ]; then | |
echo "Applied Unalloyed edits without Reforged" >> "$INSTALL_MANIFEST" | |
else | |
echo "Attempted Unalloyed edits with error code $?" >> "$INSTALL_MANIFEST" | |
INSTALL_ERROR=$? | |
fi | |
# Handle recovery and additional logging | |
if [ -f "../mod/regulation.bin.temp" ]; then | |
mv -f "../mod/regulation.bin.temp" "../mod/regulation.bin" | |
echo " and performed recovery" >> "$INSTALL_MANIFEST" | |
fi | |
echo "" >> "$INSTALL_MANIFEST" | |
# Go back to the parent directory | |
cd .. | |
# Call customedits function or script | |
customedits # Assuming customedits is a function or another script | |
fi | |
# Set the temporary directory relative to the current script location | |
tmp_dir="$(dirname "$0")/unalloyed_temp" | |
# Create the temporary directory | |
mkdir -p "$tmp_dir" | |
# Move specific files to the temporary directory | |
mv ../mod/chr/c0000.anibnd.dcx "$tmp_dir/c0000.anibnd.dcx" | |
mv ../mod/chr/c0000_a9x.anibnd.dcx "$tmp_dir/c0000_a9x.anibnd.dcx" | |
mv ../mod/sfx/sfxbnd_commoneffects.ffxbnd.dcx "$tmp_dir/sfxbnd_commoneffects.ffxbnd.dcx" | |
# Unzip the Clevers Archive with exclusions | |
unzip -o "../downloads/$CLEVERS_ARCHIVE" -x regulation.bin '**/c0000.hks' '**/01_common.tpf.dcx' '**/item.msgbnd.dcx' '**/*.bak' -d ../mod | |
# Check for errors after unzipping and log to the install manifest | |
if [ $? -ne 0 ]; then | |
echo "Failed to extract $CLEVERS_ARCHIVE with error code $?" >> "$INSTALL_MANIFEST" | |
INSTALL_ERROR=$? | |
echo "" >> "$INSTALL_MANIFEST" | |
fi | |
# Initialize variables | |
CLEVERS="" | |
STARFARER_LOOT="" | |
# Conditionally set variables and run DSMSPortable.exe based on the Clevers version | |
if (( $(echo "$CLEVERS_VERSION <= 13.1" | bc -l) )); then | |
CLEVERS="../massedit/clevers_131.massedit" | |
# Run DSMSPortable.exe with arguments (assuming compatibility layer like Wine) | |
wine DSMSPortable.exe --layoutmerge ../mod/menu/hi/01_common.sblytbnd.dcx ../ref/SB_Icon_02_A.layout -S $VERBOSE | |
# Check for SKIP_RANDOMIZER variable | |
if [ -z "$SKIP_RANDOMIZER" ]; then | |
STARFARER_LOOT="../massedit/starfarer.massedit" | |
fi | |
fi | |
# Determine and set the CLEVERS variable based on the version | |
if (( $(echo "$CLEVERS_VERSION <= 13.1" | bc -l) )); then | |
CLEVERS="../massedit/clevers_131.massedit" | |
else | |
CLEVERS="../massedit/clevers.massedit" | |
fi | |
# Run DSMSPortable.exe with arguments | |
wine DSMSPortable.exe ../mod/regulation.bin -M+ "$CLEVERS" "$STARFARER_LOOT" | |
# Check for errors and log to the install manifest | |
if [ $? -eq 0 ]; then | |
echo "Merged Clever's Moveset Modpack v$CLEVERS_VERSION with Reforged" >> "$INSTALL_MANIFEST" | |
else | |
echo "Attempted merging Clever's with Reforged with error code $?" >> "$INSTALL_MANIFEST" | |
INSTALL_ERROR=$? | |
fi | |
# Handle recovery if necessary | |
if [ -f "../mod/regulation.bin.temp" ]; then | |
mv -f "../mod/regulation.bin.temp" "../mod/regulation.bin" | |
echo " and performed recovery" >> "$INSTALL_MANIFEST" | |
fi | |
# Unzip specific files to the temp directory | |
unzip -o -j "../downloads/$CLEVERS_ARCHIVE" '**/01_common.tpf.dcx' '**/item.msgbnd.dcx' -d "$tmp_dir" | |
# Use Yabber.exe to handle specific files | |
wine Yabber.exe "$tmp_dir/c0000.anibnd.dcx" | |
wine Yabber.exe "$tmp_dir/01_common.tpf.dcx" | |
wine Yabber.exe "$tmp_dir/item.msgbnd.dcx" | |
# Create directories and move files | |
mkdir -p "$tmp_dir/c0000" "$tmp_dir/fmg" "$tmp_dir/partials" | |
mv -f "$tmp_dir/c0000-anibnd-dcx/GR/data/INTERROOT_win64/chr/c0000/tae/"*.tae "$tmp_dir/c0000/" > /dev/null | |
mv -f "$tmp_dir/item-msgbnd-dcx/GR/data/INTERROOT_win64/msg/engUS/"*.fmg "$tmp_dir/fmg/" > /dev/null | |
# Animation merging and diffing using DSMSPortable.exe | |
wine DSMSPortable.exe --animerge ../mod/chr/c0000.anibnd.dcx "$tmp_dir/c0000" -I $VERBOSE | |
wine DSMSPortable.exe --animdiff ../ref/c0000_1091.anibnd.dcx "$tmp_dir/c0000/a00.tae" "$tmp_dir/c0000/a02.tae" "$tmp_dir/c0000/a03.tae" "$tmp_dir/c0000/a10.tae" "$tmp_dir/c0000/a12.tae" "$tmp_dir/c0000/a13.tae" "$tmp_dir/c0000/a14.tae" "$tmp_dir/c0000/a15.tae" "$tmp_dir/c0000/a16.tae" "$tmp_dir/c0000/a41.tae" "$tmp_dir/c0000/a44.tae" "$tmp_dir/c0000/a103.tae" "$tmp_dir/c0000/a129.tae" "$tmp_dir/c0000/a146.tae" "$tmp_dir/c0000/a205.tae" "$tmp_dir/c0000/a240.tae" "$tmp_dir/c0000/a614.tae" "$tmp_dir/c0000/a654.tae" "$tmp_dir/c0000/a791.tae" "$tmp_dir/c0000/a838.tae" "$tmp_dir/c0000/a850.tae" -O "$tmp_dir/partials" $VERBOSE | |
# Copy specific animation files | |
mv -f "$tmp_dir/c0000/a852.tae" "$tmp_dir/partials" | |
mv -f "$tmp_dir/c0000/a678.tae" "$tmp_dir/partials" | |
# Set the path for the temporary directory and create spell subdirectory | |
tmp_dir="$(dirname "$0")/unalloyed_temp" | |
mkdir -p "$tmp_dir/spells" | |
# Move spell-related files to the spells directory and delete some files | |
mv -f "$tmp_dir/c0000/a4"*.tae "$tmp_dir/spells" > /dev/null | |
mv -f "$tmp_dir/c0000/a5"*.tae "$tmp_dir/spells" > /dev/null | |
rm -f "$tmp_dir/spells/a4"?.tae | |
rm -f "$tmp_dir/spells/a5"?.tae | |
# Execute DSMSPortable.exe for animation differences and merging | |
wine DSMSPortable.exe --animdiff ../ref/c0000_1091.anibnd.dcx "$tmp_dir/spells" -O "$tmp_dir/partials" $VERBOSE | |
wine DSMSPortable.exe --animerge ../mod/chr/c0000.anibnd.dcx "$tmp_dir/partials" $VERBOSE | |
# Check for errors after running DSMSPortable and log to the install manifest | |
if [ $? -ne 0 ]; then | |
echo "; animation merging failed with error code $?" >> "$INSTALL_MANIFEST" | |
INSTALL_ERROR=$? | |
fi | |
# More DSMSPortable commands for texture merging, fmg merging, and diffing | |
wine DSMSPortable.exe --texturemerge ../mod/menu/hi/01_common.tpf.dcx "$tmp_dir/01_common-tpf-dcx/SB_Icon_02_A.dds" "$tmp_dir/01_common-tpf-dcx/SB_Icon_03_A.dds" $VERBOSE | |
wine DSMSPortable.exe --fmgmerge ../mod/msg/engus/item.msgbnd.dcx "$tmp_dir/fmg" -I $VERBOSE | |
wine DSMSPortable.exe --fmgmerge ../mod/msg/engus/item.msgbnd.dcx "$tmp_dir/fmg/GemCaption.fmg" "$tmp_dir/fmg/GemName.fmg" "$tmp_dir/fmg/ArtsName.fmg" "$tmp_dir/fmg/ArtsCaption.fmg" $VERBOSE | |
# Custom FMG entries based on CLEVERS_VERSION | |
if (( $(echo "$CLEVERS_VERSION <= 13.1" | bc -l) )); then | |
# Add specific entries with DSMSPortable.exe | |
wine DSMSPortable.exe --fmgentry [list of fmgentry commands] | |
fi | |
# Add more entries with DSMSPortable.exe | |
wine DSMSPortable.exe --fmgentry [additional list of fmgentry commands] | |
# Additional DSMSPortable commands for bnd differences and merging | |
wine DSMSPortable.exe --bnddiff "$tmp_dir/sfxbnd_commoneffects.ffxbnd.dcx" ../ref/sfxbnd_commoneffects_1091.ffxbnd.dcx $VERBOSE | |
wine DSMSPortable.exe --bndmerge ../mod/sfx/sfxbnd_commoneffects.ffxbnd.dcx "$tmp_dir/sfxbnd_commoneffects.ffxbnd.dcx.partial" $VERBOSE | |
wine DSMSPortable.exe --bnddiff "$tmp_dir/c0000_a9x.anibnd.dcx" ../ref/c0000_a9x_1091.anibnd.dcx $VERBOSE | |
wine DSMSPortable.exe --bndmerge ../mod/chr/c0000_a9x.anibnd.dcx "$tmp_dir/c0000_a9x.anibnd.dcx.partial" $VERBOSE | |
# Additional operations based on CLEVERS_VERSION | |
if (( $(echo "$CLEVERS_VERSION >= 14" | bc -l) )); then | |
wine DSMSPortable.exe --hksmerge ../mod/action/script/c0000.hks ../ref/CleversTrickWeapons.lua $VERBOSE | |
fi | |
# Clean up the temporary directory | |
rm -rf "$tmp_dir" | |
# Additional file operations | |
echo "" >> "$INSTALL_MANIFEST" | |
cd .. | |
cp -f ./ref/c0000.behbnd.dcx ./mod/chr/c0000.behbnd.dcx | |
# Install Rings of Talent | |
if [ ! -z "$TALENT_ARCHIVE" ]; then | |
cd tools | |
# Set the path for the temporary directory and create it | |
tmp_dir="$(dirname "$0")/unalloyed_temp" | |
mkdir -p "$tmp_dir" | |
# Unzip the Talent Archive with exclusions | |
unzip -o "../downloads/$TALENT_ARCHIVE" -x '**DSMSP/**' -d "$tmp_dir" | |
# Check for errors after unzipping and log to the install manifest | |
if [ $? -ne 0 ]; then | |
echo "Failed to extract $TALENT_ARCHIVE with error code $?" >> "$INSTALL_MANIFEST" | |
INSTALL_ERROR=$? | |
echo "" >> "$INSTALL_MANIFEST" | |
fi | |
# Copy extracted mod files to the mod directory | |
cp -r "$tmp_dir/mod/"* ../mod | |
# Execute DSMSPortable.exe for various merging operations | |
wine DSMSPortable.exe --fmgmerge ../mod/msg/engus/item.msgbnd.dcx "$tmp_dir/resources/RoT_Files/fmg_item" $VERBOSE | |
wine DSMSPortable.exe --fmgmerge ../mod/msg/engus/menu.msgbnd.dcx "$tmp_dir/resources/RoT_Files/fmg_menu" $VERBOSE | |
wine DSMSPortable.exe --emevdmerge ../mod/event/common.emevd.dcx "$tmp_dir/resources/RoT_Files/emevd/common.emevd.dcx" $VERBOSE | |
wine DSMSPortable.exe --hksmerge ../mod/action/script/c0000.hks "$tmp_dir/resources/RoT_Files/hks/c0000.hks" $VERBOSE | |
wine DSMSPortable.exe --bndmerge ../mod/sfx/sfxbnd_commoneffects.ffxbnd.dcx "$tmp_dir/resources/RoT_Files/sfx/sfxbnd_commoneffects.ffxbnd.dcx" $VERBOSE | |
wine DSMSPortable.exe ../mod/regulation.bin -M+ "$tmp_dir/resources/RoT_Files/massedit" | |
# Check for errors after running DSMSPortable and log to the install manifest | |
if [ $? -ne 0 ]; then | |
echo "Installed $TALENT_ARCHIVE" >> "$INSTALL_MANIFEST" | |
else | |
echo "Attempted Rings of Talent installation with error code $?" >> "$INSTALL_MANIFEST" | |
INSTALL_ERROR=$? | |
fi | |
# Handle recovery and additional logging | |
if [ -f "../mod/regulation.bin.temp" ]; then | |
mv -f "../mod/regulation.bin.temp" "../mod/regulation.bin" | |
echo " and performed recovery" >> "$INSTALL_MANIFEST" | |
fi | |
echo "" >> "$INSTALL_MANIFEST" | |
# Additional compatibility edits | |
if [ -z "$SKIP_RANDOMIZER" ]; then | |
wine DSMSPortable.exe "../mod/regulation.bin" -R "ItemLotParam_map:idrange 1044340041 1044340045" | |
fi | |
wine DSMSPortable.exe "../mod/regulation.bin" -M+ "../massedit/talent.massedit" | |
wine DSMSPortable.exe --emevdmerge ../mod/event/common.emevd.dcx ../ref/mutant.emevd.dcx $VERBOSE | |
# Navigate to the deploy directory | |
cd ../mod/menu/deploy | |
# Merge gideon project files | |
mv -f ./projects/EldenRingReforged/Solo/* ./projects/RingsofTalent/Solo | |
rm -f "$(dirname "$0")/mod/Setup UI Images (ELDEN RING Reforged).lnk" | |
rm -rf ./projects/ELDENRINGReforged | |
echo "Applying Large Icons for ERR and Rings of Talent..." | |
wine Gideon.exe --user --project "RingsofTalent" > gideon.log 2>&1 | |
# Clean up the temporary directory | |
rm -rf "$tmp_dir" | |
fi | |
# Navigate back to the original directory | |
cd "$(dirname "$0")" | |
# Install Arrow Expansion if applicable | |
if [ ! -z "$ARROW_ARCHIVE" ]; then | |
cd tools | |
mkdir -p tmp | |
unzip -o "../downloads/$ARROW_ARCHIVE" -d tmp | |
# Check if the unzip operation was successful | |
if [ $? -ne 0 ]; then | |
ARROW_ERROR=$? | |
else | |
ARROW_ERROR=0 | |
fi | |
cd tmp/"Arrow Expansion Files" | |
cp -r mod/* "$OLDPWD/../mod" | |
# Navigate to the DSMSPortable/Arrow Expansion directory | |
cd DSMSPortable/"Arrow Expansion" | |
# Execute DSMSPortable.exe with arguments | |
wine "$OLDPWD/../../tools/DSMSPortable.exe" "$OLDPWD/../../mod/regulation.bin" -P "$GAMEPATH" -M+ ./massedit | |
if [ $? -ne 0 ]; then | |
ARROW_ERROR=$? | |
fi | |
# Check for recovery file and move it if exists | |
if [ -f "$OLDPWD/../../mod/regulation.bin.temp" ]; then | |
mv -f "$OLDPWD/../../mod/regulation.bin.temp" "$OLDPWD/../../mod/regulation.bin" | |
fi | |
# More DSMSPortable commands for merging operations | |
wine "$OLDPWD/../../tools/DSMSPortable.exe" --fmgmerge "$OLDPWD/../../mod/msg/engus/item.msgbnd.dcx" ./fmg $VERBOSE | |
if [ $? -ne 0 ]; then | |
ARROW_ERROR=$? | |
fi | |
wine "$OLDPWD/../../tools/DSMSPortable.exe" --bndmerge "$OLDPWD/../../mod/sfx/sfxbnd_commoneffects.ffxbnd.dcx" ./sfx/sfxbnd_commoneffects.ffxbnd.dcx -P "$GAMEPATH" -I $VERBOSE | |
if [ $? -ne 0 ]; then | |
ARROW_ERROR=$? | |
fi | |
# Log the result to the install manifest | |
if [ $ARROW_ERROR -eq 0 ]; then | |
echo "Installed Arrow Expansion" >> "$INSTALL_MANIFEST" | |
else | |
echo "Attempted Arrow Expansion installation with error code $ARROW_ERROR" >> "$INSTALL_MANIFEST" | |
INSTALL_ERROR=$ARROW_ERROR | |
fi | |
echo "" >> "$INSTALL_MANIFEST" | |
# Navigate back to the tools directory and remove the temporary folder | |
cd "$OLDPWD/../../tools" | |
rm -rf tmp | |
fi | |
# Navigate back to the original directory | |
cd "$(dirname "$0")" | |
# ERR event scripting fix | |
if [ -z "$SKIP_REFORGED" ]; then | |
cd tools | |
RANDOCOMPAT="" | |
if [ -z "$SKIP_RANDOMIZER" ]; then | |
RANDOCOMPAT="../ref/randocompat.emevd.dcx" | |
fi | |
# Execute DSMSPortable.exe with arguments | |
wine DSMSPortable.exe "../mod/event/common.emevd.dcx" $RANDOCOMPAT -R 1799 $VERBOSE | |
# Check for errors and log | |
if [ $? -eq 0 ]; then | |
echo "Performed EMEVD Edits" >> "$INSTALL_MANIFEST" | |
else | |
echo "Attempted EMEVD Edits with error code $?" >> "$INSTALL_MANIFEST" | |
INSTALL_ERROR=$? | |
fi | |
# Check for recovery file and move it if exists | |
if [ -f "../mod/event/common.emevd.dcx.temp" ]; then | |
mv -f "../mod/event/common.emevd.dcx.temp" "../mod/event/common.emevd.dcx" | |
echo " and performed recovery" >> "$INSTALL_MANIFEST" | |
fi | |
echo "" >> "$INSTALL_MANIFEST" | |
cd .. | |
fi | |
# Custom edits | |
if [ -f massedit/custom.massedit ]; then | |
cd tools | |
size=$(stat -c %s "../massedit/custom.massedit") | |
# Execute DSMSPortable.exe for custom edits | |
wine DSMSPortable.exe "../mod/regulation.bin" -M+ "../massedit/custom.massedit" | |
# Check for errors and log | |
if [ $? -eq 0 ]; then | |
echo "Applied custom param edits; size: $size" >> "$INSTALL_MANIFEST" | |
else | |
echo "Attempted custom param edits with error code $?" >> "$INSTALL_MANIFEST" | |
INSTALL_ERROR=$? | |
fi | |
# Check for recovery file and move it if exists | |
if [ -f "../mod/regulation.bin.temp" ]; then | |
mv -f "../mod/regulation.bin.temp" "../mod/regulation.bin" | |
echo " and performed recovery" >> "$INSTALL_MANIFEST" | |
fi | |
echo "" >> "$INSTALL_MANIFEST" | |
cd .. | |
fi | |
# Install Item and Enemy Randomizer | |
if [ -z "$SKIP_RANDOMIZER" ]; then | |
if [ -d ./randomizer ]; then | |
mv -f ./randomizer/spoiler_logs . | |
rm -rf ./randomizer | |
fi | |
cd tools | |
# Unzip the Randomizer Archive | |
unzip -o "../downloads/$RANDOMIZER_ARCHIVE" -d .. | |
# Check if the unzip operation was successful | |
if [ $? -eq 0 ]; then | |
echo "Extracted $RANDOMIZER_ARCHIVE" >> "$INSTALL_MANIFEST" | |
else | |
echo "Failed to extract $RANDOMIZER_ARCHIVE with error code $?" >> "$INSTALL_MANIFEST" | |
INSTALL_ERROR=$? | |
fi | |
echo "" >> "$INSTALL_MANIFEST" | |
cd .. | |
# Move spoiler logs if they exist | |
if [ -d ./spoiler_logs ]; then | |
mkdir -p ./randomizer/spoiler_logs | |
mv -f spoiler_logs/* ./randomizer/spoiler_logs | |
rm -rf spoiler_logs | |
fi | |
fi | |
# Apply metadata changes | |
if [ -f "./randomizer/diste/Base/enemy.txt.bak" ]; then | |
rm -f "./randomizer/diste/Base/enemy.txt.bak" | |
fi | |
cp "./randomizer/diste/Base/enemy.txt" "./randomizer/diste/Base/enemy.txt.bak" | |
# Function to replace text in a file using sed | |
replace_text() { | |
local file_path="$1" | |
local search_pattern="$2" | |
local replace_pattern="$3" | |
sed -i -E "s/$search_pattern/$replace_pattern/g" "$file_path" | |
} | |
# Collapse Minor Boss Category with World Boss Category | |
replace_text "./randomizer/diste/Base/enemy.txt" '(\n\s+Class:) MinorBoss' '$1 Miniboss' | |
# Re-assign Story Boss Category to Minor Boss Category | |
replace_text "./randomizer/diste/Base/enemy.txt" '(\n\s+Class:) Boss' '$1 MinorBoss' | |
# Assign to World Boss Category for specific IDs | |
replace_text "./randomizer/diste/Base/enemy.txt" '(ID: 11050850.*\n\s*Map.*\n\s*Name.*\n\s*Class:) MinorBoss' '$1 Miniboss' | |
replace_text "./randomizer/diste/Base/enemy.txt" '(ID: 12020850.*\n\s*Map.*\n\s*Name.*\n\s*Class:) MinorBoss' '$1 Miniboss' | |
replace_text "./randomizer/diste/Base/enemy.txt" '(ID: 14000801.*\n\s*Map.*\n\s*Name.*\n\s*Class:) MinorBoss' '$1 Miniboss' | |
replace_text "./randomizer/diste/Base/enemy.txt" '(ID: 1043300800.*\n\s*Map.*\n\s*Name.*\n\s*Class:) MinorBoss' '$1 Miniboss' | |
# Check if any replacement failed | |
if [ $? -ne 0 ]; then | |
echo "Failed to apply randomizer presets" >> "$INSTALL_MANIFEST" | |
echo "" >> "$INSTALL_MANIFEST" | |
INSTALL_ERROR=$? | |
else | |
echo "Applied randomizer presets successfully" >> "$INSTALL_MANIFEST" | |
echo "" >> "$INSTALL_MANIFEST" | |
fi | |
# Function to replace text in a file using sed | |
replace_text() { | |
local file_path="$1" | |
local search_pattern="$2" | |
local replace_pattern="$3" | |
sed -i -E "s/$search_pattern/$replace_pattern/g" "$file_path" | |
} | |
# Define the path to the enemy.txt file | |
file_path="./randomizer/diste/Base/enemy.txt" | |
# Re-assign certain IDs from MinorBoss to Boss | |
replace_text "$file_path" '(ID: 11050800.*\n\s*Map.*\n\s*Name.*\n\s*Class:) MinorBoss' '$1 Boss' | |
replace_text "$file_path" '(ID: 12010800.*\n\s*Map.*\n\s*Name.*\n\s*Class:) MinorBoss' '$1 Boss' | |
replace_text "$file_path" '(ID: 12030800.*\n\s*Map.*\n\s*Name.*\n\s*Class:) MinorBoss' '$1 Boss' | |
replace_text "$file_path" '(ID: 12040800.*\n\s*Map.*\n\s*Name.*\n\s*Class:) MinorBoss' '$1 Boss' | |
replace_text "$file_path" '(ID: 12080800.*\n\s*Map.*\n\s*Name.*\n\s*Class:) MinorBoss' '$1 Boss' | |
replace_text "$file_path" '(ID: 12090800.*\n\s*Map.*\n\s*Name.*\n\s*Class:) MinorBoss' '$1 Boss' | |
replace_text "$file_path" '(ID: 13000830.*\n\s*Map.*\n\s*Name.*\n\s*Class:) MinorBoss' '$1 Boss' | |
replace_text "$file_path" '(ID: 14000800.*\n\s*Map.*\n\s*Name.*\n\s*Class:) MinorBoss' '$1 Boss' | |
replace_text "$file_path" '(ID: 15000800.*\n\s*Map.*\n\s*Name.*\n\s*Class:) MinorBoss' '$1 Boss' | |
replace_text "$file_path" '(ID: 16000800.*\n\s*Map.*\n\s*Name.*\n\s*Class:) MinorBoss' '$1 Boss' | |
replace_text "$file_path" '(ID: 19000810.*\n\s*Map.*\n\s*Name.*\n\s*Class:) MinorBoss' '$1 Boss' | |
replace_text "$file_path" '(ID: 19000800.*\n\s*Map.*\n\s*Name.*\n\s*Class:) MinorBoss' '$1 Boss' | |
replace_text "$file_path" '(ID: 1052380800.*\n\s*Map.*\n\s*Name.*\n\s*Class:) MinorBoss' '$1 Boss' | |
replace_text "$file_path" '(ID: 1052520800.*\n\s*Map.*\n\s*Name.*\n\s*Class:) MinorBoss' '$1 Boss' | |
# Check if any replacement failed | |
if [ $? -ne 0 ]; then | |
echo "Failed to apply randomizer presets" >> "$INSTALL_MANIFEST" | |
echo "" >> "$INSTALL_MANIFEST" | |
INSTALL_ERROR=$? | |
else | |
echo "Applied randomizer presets successfully" >> "$INSTALL_MANIFEST" | |
echo "" >> "$INSTALL_MANIFEST" | |
fi | |
# Function to replace text in a file using sed | |
replace_text() { | |
local file_path="$1" | |
local search_pattern="$2" | |
local replace_pattern="$3" | |
sed -i -E "s/$search_pattern/$replace_pattern/g" "$file_path" | |
} | |
# Path to the enemy.txt file | |
file_path="./randomizer/diste/Base/enemy.txt" | |
# Assign to Dragon Miniboss Category for specific IDs | |
replace_text "$file_path" '(ID: 1036540800.*\n\s*Map.*\n\s*Name.*\n\s*Class:) Miniboss' '$1 DragonMiniboss' | |
replace_text "$file_path" '(ID: 1041530800.*\n\s*Map.*\n\s*Name.*\n\s*Class:) Miniboss' '$1 DragonMiniboss' | |
# Check if any replacement failed | |
if [ $? -ne 0 ]; then | |
echo "Failed to apply randomizer presets for Dragon Miniboss" >> "$INSTALL_MANIFEST" | |
echo "" >> "$INSTALL_MANIFEST" | |
INSTALL_ERROR=$? | |
else | |
echo "Applied randomizer presets for Dragon Miniboss successfully" >> "$INSTALL_MANIFEST" | |
echo "" >> "$INSTALL_MANIFEST" | |
fi | |
# Continue applying changes to the enemy.txt file | |
file_path="./randomizer/diste/Base/enemy.txt" | |
# Function to replace text in a file using sed | |
replace_text() { | |
local file_path="$1" | |
local search_pattern="$2" | |
local replace_pattern="$3" | |
sed -i -E "s/$search_pattern/$replace_pattern/g" "$file_path" | |
} | |
# Assign to Dragon Miniboss Category for specific IDs | |
replace_text "$file_path" '(ID: 1036540800.*\n\s*Map.*\n\s*Name.*\n\s*Class:) Miniboss' '$1 DragonMiniboss' | |
replace_text "$file_path" '(ID: 1041530800.*\n\s*Map.*\n\s*Name.*\n\s*Class:) Miniboss' '$1 DragonMiniboss' | |
# Check if any replacement failed | |
if [ $? -ne 0 ]; then | |
echo "Failed to apply randomizer presets with error code $?" >> "$INSTALL_MANIFEST" | |
echo "" >> "$INSTALL_MANIFEST" | |
INSTALL_ERROR=$? | |
fi | |
# Create the presets directory if it doesn't exist | |
mkdir -p "./randomizer/presets" | |
# Copy Unalloyed preset files | |
cp "./ref/Unalloyed.txt" "./randomizer/presets/Unalloyed.txt" | |
cp "./ref/Unalloyed_Light.txt" "./randomizer/presets/Unalloyed_Light.txt" | |
cp "./ref/Unalloyed_Onslaught.txt" "./randomizer/presets/Unalloyed_Onslaught.txt" | |
cp "./ref/Unalloyed_Fog.txt" "./randomizer/presets/Unalloyed_Fog.txt" | |
# Append contents of ref files to randomizer names files | |
cat "./ref/EquipParamAccessory.txt" >> "./randomizer/diste/Names/EquipParamAccessory.txt" | |
cat "./ref/EquipParamWeapon.txt" >> "./randomizer/diste/Names/EquipParamWeapon.txt" | |
cat "./ref/EquipParamGoods.txt" >> "./randomizer/diste/Names/EquipParamGoods.txt" | |
cat "./ref/EquipParamGem.txt" >> "./randomizer/diste/Names/EquipParamGem.txt" | |
# Copy msg files if they don't exist | |
[ ! -f "./mod/msg/engus/item.msgbnd.dcx" ] && cp "./randomizer/diste/Vanilla/msg/engus/item.msgbnd.dcx" "./mod/msg/engus" | |
[ ! -f "./mod/msg/engus/menu.msgbnd.dcx" ] && cp "./randomizer/diste/Vanilla/msg/engus/menu.msgbnd.dcx" "./mod/msg/engus" | |
# Unalloyed-specific edits | |
cd tools | |
# Check if item message files exist, if not, copy them from the randomizer directory | |
if [ ! -f "../mod/msg/engus/item.msgbnd.dcx" ] && [ -d "../randomizer" ]; then | |
mkdir -p "../mod/msg/engus" | |
cp -f "../randomizer/diste/Vanilla/msg/engus/item.msgbnd.dcx" "../mod/msg/engus/item.msgbnd.dcx" | |
cp -f "../randomizer/diste/Vanilla/msg/engus/menu.msgbnd.dcx" "../mod/msg/engus/menu.msgbnd.dcx" | |
fi | |
if [ -f "../mod/msg/engus/item.msgbnd.dcx" ]; then | |
# Continue executing DSMSPortable.exe for additional fmgentry modifications | |
wine DSMSPortable.exe --fmgentry ../mod/msg/engus/item.msgbnd.dcx "GoodsInfo:195:Greatly increases Arcane and slows Bleed buildup" "GoodsInfo:196:Greatly increases Dexterity, slows Rot buildup, and recovers HP after damage is taken at the cost of reduced healing from other sources" "GoodsCaption:196:A Great Rune of the shardbearer Malenia...\nThough rotted, the rune exhibits a peculiar beauty which greatly increases Dexterity and slows the buildup of Rot. With the infusion of Malenia's spirit of resistance, attacks made immediately after receiving damage will partially recover HP.\n\nAnd yet, due to the rotted nature of the rune, all other sources of healing are diminished.\n\nMalenia is daughter to Queen Marika and Radagon, and her Great Rune should have been the most sacred of all." | |
wine DSMSPortable.exe --fmgentry ../mod/msg/engus/item.msgbnd.dcx "AccessoryName:8990:Great Serpent's Viscera" "AccessoryInfo:8990:Awakens the Great-Serpent Hunter at the cost of rune acquisition rate and fire defense" "AccessoryCaption:8990:A writhing chunk of viscera taken from the cadaver of the Lord of Blasphemy. It oozes with scalding hot mucous.\n\nThe lingering flesh of the God-Devouring Serpent feeds the Serpent-Hunter's hunger to destroy it, awakening some of its true power.\nThe cursed flesh however is eager to return to life, sapping some runes from its user in the process.\n\nWhen Rykard turned to heresy, taking by force became the rule. The gods themselves were no different, after all." "GoodsName:8174:Academy Glintstone Spare Key" | |
wine DSMSPortable.exe --fmgentry ../mod/msg/engus/item.msgbnd.dcx "AccessoryInfo:6060:Doubles damage taken, but doubles physical damage dealt and improves dodge rolls when unarmed with lower equip load" "AccessoryCaption:6060:Disturbing likeness of a woman whose skin was flayed.\nShe smiles with a serene tenderness.\n\nIncreases damage taken, but increases unarmed damage and dodge rolls when naked\n\nIt is said that this woman, named Daedicar, indulged in every form of adultery and wicked pleasure imaginable, giving birth to a myriad of grotesque children." | |
wine DSMSPortable.exe --fmgentry ../mod/msg/engus/item.msgbnd.dcx "AccessoryInfo:4110:Shrugs off weaker attacks and reduces damage and impact of headshots" "AccessoryCaption:4110:A talisman fashioned from a bony knot that embodies the aspects of various creatures.\nSaid to have grown on the human body long ago.\n\nShrugs off weaker attacks and reduces damage and impact of headshots\n\nA vestige of the crucible of primordial life. Born partially of devolution, it was considered a signifier of the divine in ancient times, but is now increasingly disdained as an impurity as civilization has advanced." | |
wine DSMSPortable.exe --fmgentry ../mod/msg/engus/item.msgbnd.dcx "AccessoryInfo:6060:Doubles damage taken, but doubles physical damage dealt and improves dodge rolls when unarmed with lower equip load" "AccessoryCaption:6060:Disturbing likeness of a woman whose skin was flayed.\nShe smiles with a serene tenderness.\n\nIncreases damage taken, but increases unarmed damage and dodge rolls when naked\n\nIt is said that this woman, named Daedicar, indulged in every form of adultery and wicked pleasure imaginable, giving birth to a myriad of grotesque children." | |
wine DSMSPortable.exe --fmgentry ../mod/msg/engus/item.msgbnd.dcx "AccessoryInfo:4110:Shrugs off weaker attacks and reduces damage and impact of headshots" "AccessoryCaption:4110:A talisman fashioned from a bony knot that embodies the aspects of various creatures.\nSaid to have grown on the human body long ago.\n\nShrugs off weaker attacks and reduces damage and impact of headshots\n\nA vestige of the crucible of primordial life. Born partially of devolution, it was considered a signifier of the divine in ancient times, but is now increasingly disdained as an impurity as civilization has advanced." | |
# Check if any DSMSPortable command failed | |
if [ $? -ne 0 ]; then | |
echo "Failed to apply Unalloyed-specific edits with error code $?" >> "$INSTALL_MANIFEST" | |
echo "" >> "$INSTALL_MANIFEST" | |
INSTALL_ERROR=$? | |
fi | |
fi | |
cd .. | |
cd tools | |
if [ -f "../mod/msg/engus/menu.msgbnd.dcx" ]; then | |
# Execute DSMSPortable.exe for fmgentry modifications to menu.msgbnd.dcx | |
wine DSMSPortable.exe --fmgentry ../mod/msg/engus/menu.msgbnd.dcx "GR_System_Message_win64:4191:Unable to read save data.\n\nIf you recently updated Elden Ring,\nexit the game and run update_saves.bat\nto update your save data." "GR_System_Message_win64:401102:Unable to read save data..." | |
# ... Continue with other fmgentry commands as in the script ... | |
fi | |
# Copy sfxbnd_commoneffects.ffxbnd.dcx if it doesn't exist | |
[ ! -f "../mod/sfx/sfxbnd_commoneffects.ffxbnd.dcx" ] && cp -f "../ref/sfxbnd_commoneffects_1091.ffxbnd.dcx" "../mod/sfx/sfxbnd_commoneffects.ffxbnd.dcx" | |
# Execute DSMSPortable.exe for bndmerge operation | |
wine DSMSPortable.exe --bndmerge ../mod/sfx/sfxbnd_commoneffects.ffxbnd.dcx ../ref/sfxbnd_commoneffects_serpenthunter.ffxbnd.dcx -I $VERBOSE | |
cd .. | |
# Install Parts | |
cd "/D/partmods" | |
PARTSMODS=0 | |
[ -f tmp.massedit ] && rm -f tmp.massedit | |
# Loop through .partsbnd.dcx files for model swaps | |
for file in *.partsbnd.dcx; do | |
if [[ "$file" != *_l.partsbnd.dcx ]]; then | |
partname=${file%.partsbnd.dcx} | |
echo "Applying model swap for $partname" | |
cp -f "$file" "../mod/parts/${partname}.partsbnd.dcx" | |
cp -f "$file" "../mod/parts/${partname}_l.partsbnd.dcx" | |
((PARTSMODS++)) | |
partsfedit="" | |
if [[ ${partname:3:1} == [fF] ]]; then | |
partsfedit=1 | |
fi | |
if [ ! -z "$partsfedit" ]; then | |
armortype=7 | |
case "${partname:0:2}" in | |
[aA][mM]) armortype=1 ;; | |
[bB][dD]) armortype=2 ;; | |
[hH][dD]) armortype=5 ;; | |
[lL][gG]) armortype=6 ;; | |
esac | |
echo "param EquipParamProtector: proprange equipModelId ${partname:5:4} ${partname:5:4} && prop equipModelCategory $armortype: equipModelGender: = 3;" >> tmp.massedit | |
fi | |
fi | |
done | |
# Navigate to the tools directory | |
cd "/D/tools" | |
# Create temporary directories | |
mkdir -p tmp | |
mkdir -p tmp/item | |
mkdir -p tmp/menu | |
# Decompile the message bundle files using Yabber | |
wine Yabber.exe ../mod/msg/engus/item.msgbnd.dcx | |
wine Yabber.exe ../mod/msg/engus/menu.msgbnd.dcx | |
# Move decompressed data to temporary directories | |
mv -f ../mod/msg/engus/item-msgbnd-dcx/GR/data/INTERROOT_win64/msg/engUS tmp/item | |
mv -f ../mod/msg/engus/menu-msgbnd-dcx/GR/data/INTERROOT_win64/msg/engUS tmp/menu | |
# Remove decompressed directories | |
rm -rf ../mod/msg/engus/item-msgbnd-dcx | |
rm -rf ../mod/msg/engus/menu-msgbnd-dcx | |
# Function to merge message files | |
merge_msg_files() { | |
local region="$1" | |
local skip_randomizer="$2" | |
[ ! -d "../mod/msg/$region" ] && mkdir -p "../mod/msg/$region" | |
if [ -f "../mod/msg/$region/item.msgbnd.dcx" ]; then | |
wine DSMSPortable.exe --fmgmerge -I "../mod/msg/$region/item.msgbnd.dcx" "./tmp/item/engUS" -O "../mod/msg/$region" | |
[ $? -eq 18 ] && rm -f "../mod/msg/$region/item.msgbnd.dcx" | |
fi | |
if [ -f "../mod/msg/$region/menu.msgbnd.dcx" ]; then | |
wine DSMSPortable.exe --fmgmerge -I "../mod/msg/$region/menu.msgbnd.dcx" "./tmp/menu/engUS" -O "../mod/msg/$region" | |
[ $? -eq 18 ] && rm -f "../mod/msg/$region/menu.msgbnd.dcx" | |
fi | |
if [ ! -f "../mod/msg/$region/item.msgbnd.dcx" ] && [ "$skip_randomizer" == "" ]; then | |
wine DSMSPortable.exe --fmgmerge -I "../randomizer/diste/Vanilla/msg/$region/item.msgbnd.dcx" "./tmp/item/engUS" -O "../mod/msg/$region" | |
fi | |
if [ ! -f "../mod/msg/$region/menu.msgbnd.dcx" ] && [ "$skip_randomizer" == "" ]; then | |
wine DSMSPortable.exe --fmgmerge -I "../randomizer/diste/Vanilla/msg/$region/menu.msgbnd.dcx" "./tmp/menu/engUS" -O "../mod/msg/$region" | |
fi | |
} | |
# Patch German message files | |
merge_msg_files "deude" "$SKIP_RANDOMIZER" | |
# Patch French message files | |
patch_language_files "frafr" "$SKIP_RANDOMIZER" | |
# Patch Italian message files | |
patch_language_files "itait" "$SKIP_RANDOMIZER" | |
# Patch Japanese message files | |
patch_language_files "jpnjp" "$SKIP_RANDOMIZER" | |
# Patch Korean message files | |
patch_language_files "korkr" "$SKIP_RANDOMIZER" | |
# Patch Polish message files | |
patch_language_files "polpl" "$SKIP_RANDOMIZER" | |
# Patch Portuguese (Brazil) message files | |
patch_language_files "porbr" "$SKIP_RANDOMIZER" | |
# Patch Russian message files | |
patch_language_files "rusru" "$SKIP_RANDOMIZER" | |
# Patch Spanish (Spain) message files | |
patch_language_files "spaar" "$SKIP_RANDOMIZER" | |
# Patch Spanish (Latin America) message files | |
patch_language_files "spaes" "$SKIP_RANDOMIZER" | |
# Patch Thai message files | |
patch_language_files "thath" "$SKIP_RANDOMIZER" | |
# Patch Chinese (China) message files | |
patch_language_files "zhocn" "$SKIP_RANDOMIZER" | |
# Patch Chinese (Taiwan) message files | |
patch_language_files "zhotw" "$SKIP_RANDOMIZER" | |
# Clean up temporary directory | |
rm -rf tmp | |
# Navigate to mod message directory and clean up previous files | |
cd ../mod/msg | |
rm -f *.prev | |
# Return to the original directory | |
cd "$OLDPWD" | |
# Install Fog Gate Randomizer | |
if [ ! -z "$FOG_ARCHIVE" ]; then | |
if [ -d ./fog ]; then | |
mv -f ./fog/spoiler_logs . | |
rm -rf ./fog | |
fi | |
cd tools | |
# Unzip the Fog Archive | |
unzip -o "../downloads/$FOG_ARCHIVE" -d .. | |
# Check if the unzip operation was successful | |
if [ $? -eq 0 ]; then | |
echo "Extracted $FOG_ARCHIVE" >> "$INSTALL_MANIFEST" | |
else | |
echo "Failed to extract $FOG_ARCHIVE with error code $?" >> "$INSTALL_MANIFEST" | |
INSTALL_ERROR=$? | |
fi | |
echo "" >> "$INSTALL_MANIFEST" | |
cd .. | |
# Move spoiler logs if they exist | |
if [ -d ./spoiler_logs ]; then | |
mkdir -p ./fog/spoiler_logs | |
mv -f spoiler_logs/* ./fog/spoiler_logs | |
rm -rf spoiler_logs | |
fi | |
fi | |
# Configure and Launch Randomizer | |
loops=0 | |
# Skip randomizer if specified | |
if [ ! -z "$SKIP_RANDOMIZER" ]; then | |
# go to fogstart (This part will be script-specific, depending on how 'fogstart' is defined) | |
exit 0 | |
fi | |
# If an alternative game path is specified, clear the randomizer settings | |
if [ ! -z "$ALT_GAMEPATH" ]; then | |
rm -rf "$APPDATA/../Local/EldenRingRandomizer" | |
fi | |
# Ensure the Elden Ring Randomizer directory exists | |
mkdir -p "$APPDATA/../Local/EldenRingRandomizer" | |
# Navigate to the randomizer directory | |
cd randomizer | |
echo "Initializing randomizer settings, please wait..." | |
# Initialize randomizer | |
while [ $loops -lt 5 ]; do # Change 5 to the maximum number of attempts | |
# Start the randomizer | |
wine EldenRingRandomizer.exe & | |
# Wait for 3 seconds | |
sleep 3 | |
# Kill the randomizer process | |
pkill -f EldenRingRandomizer.exe | |
# Check if randomizer data is ready | |
count=$(find "$APPDATA/../Local/EldenRingRandomizer" -type f | wc -l) | |
if [ $count -gt 0 ]; then | |
break | |
fi | |
loops=$((loops + 1)) | |
done | |
# If there are conflicting installations, purge them and start over | |
if [ ! -z "$1" ]; then | |
ls | |
fi | |
count=0 | |
for d in $(ls -d EldenRingRandomizer*/); do | |
count=$((count + 1)) | |
done | |
if [ $count -gt 1 ]; then | |
for e in $(ls -d EldenRingRandomizer*/); do | |
rm -rf "$e" | |
done | |
cd "/D/randomizer" | |
# Restart the initialization process (Refer to previous script for initrandomizer) | |
fi | |
if [ ! -d EldenRingRandomizer* ]; then | |
if [ $loops -ge 2 ]; then | |
echo "ERROR: Could not detect any randomizer settings in" | |
echo "$PWD" | |
read -p "Retry generating settings (Y/N)? " choice | |
if [ "$choice" != "${choice#[Yy]}" ]; then | |
# Go to fogstart (Specific to your script structure) | |
exit 0 | |
fi | |
fi | |
echo | |
echo "Warning: Randomizer could not locate your eldenring.exe file. Please click 'Select game exe' and point it towards" | |
echo "$GAMEPATH/eldenring.exe" | |
echo "then close the randomizer to continue" | |
echo | |
sleep 3 | |
cd "/D/randomizer" | |
wine EldenRingRandomizer.exe | |
# Return to checking randomizer data (Refer to previous script for checkrandomizerdata) | |
fi | |
cd EldenRingRandomizer*/ | |
cd 1.* | |
TYPEKEY="" | |
# Parse the config file for the PublicKeyToken | |
TYPEKEY=$(grep -o 'PublicKeyToken="[^"]*"' user.config | cut -d '"' -f 2) | |
# Scan the existing config file for a seed and try to preserve it | |
SEED=$(grep -o '<seed>[^<]*</seed>' user.config) | |
# Backup the original config file | |
mv user.config user.config.default | |
# Create a new XML configuration file | |
cat << EOF > user.config | |
<?xml version="1.0" encoding="utf-8"?> | |
<configuration> | |
<configSections> | |
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System.Configuration.ConfigurationManager, Version=6.0.0.0, Culture=neutral, PublicKeyToken=$TYPEKEY"> | |
<section name="RandomizerCommon.Properties.Settings" type="System.Configuration.ClientSettingsSection, System.Configuration.ConfigurationManager, Version=6.0.0.0, Culture=neutral, PublicKeyToken=$TYPEKEY" allowExeDefinition="MachineToLocalUser" requirePermission="false" /> | |
</sectionGroup> | |
</configSections> | |
<userSettings> | |
<RandomizerCommon.Properties.Settings> | |
<setting name="Exe" serializeAs="String"> | |
<value>%GAMEPATH%/eldenring.exe</value> | |
</setting> | |
<setting name="Mod" serializeAs="String"> | |
<value>%~dp0mod</value> | |
</setting> | |
<setting name="Options" serializeAs="String"> | |
<value>$SEED $RANDOMIZEOPT</value> | |
</setting> | |
</RandomizerCommon.Properties.Settings> | |
</userSettings> | |
</configuration> | |
EOF | |
cd "$HOME/.steam/root/steamapps/common/Elden Ring" | |
# Configure and launch Fog Gate Randomizer | |
fogstart() { | |
if [ -z "$FOG_ARCHIVE" ]; then | |
dslrstart | |
return | |
fi | |
# If the gamepath is undetectable, clean the randomizer settings | |
if [ -n "$ALT_GAMEPATH" ]; then | |
rm -rf "$HOME/.local/FogMod" | |
fi | |
mkdir -p "$HOME/.local/FogMod" | |
cd fog || exit | |
echo "Initializing randomizer settings, please wait..." | |
start FogMod.exe | |
sleep 3 | |
pkill -f FogMod.exe | |
# Check for Fog Gate Randomizer data | |
count=0 | |
cd "$HOME/.local/FogMod" || exit | |
# If there are conflicting installations, purge them and start over | |
if [ -n "$1" ]; then | |
ls -d */ | ((count++)) | |
fi | |
if [ "$count" -gt 1 ]; then | |
rm -rf FogMod*/ | |
cd "$HOME/.local/FogMod" || exit | |
fogstart | |
return | |
fi | |
# If FogMod* does not exist | |
if ! [ -d FogMod* ]; then | |
if [ -z "$SKIP_RANDOMIZER" ]; then | |
echo "Warning: Could not detect Fog Gate Randomizer settings, please click 'Merge Other Mod' then 'Select toml file' and point it towards" | |
echo "$CURDIR/randomizer/config_eldenringrandomizer.toml" | |
else | |
echo "Warning: Could not detect Fog Gate Randomizer settings, please click 'Merge Other Mod' then 'Select mod directory' and point it towards" | |
echo "$CURDIR/mod" | |
fi | |
echo "Then close the randomizer to continue." | |
sleep 3 | |
cd "$CURDIR/fog" || exit | |
FogMod.exe | |
checkfogdata | |
return | |
fi | |
cd FogMod*/1.* || exit | |
TYPEKEY="" | |
} | |
# Start DSLR Randomizer if Fog Gate Randomizer is not specified | |
dslrstart() { | |
# Your DSLR Randomizer setup code goes here | |
echo "Starting DSLR Randomizer..." | |
} | |
# Main script logic | |
main() { | |
fogstart | |
} | |
# Execute main function | |
main | |
# Parse the config file for the PublicKeyToken | |
if [ -f user.config ]; then | |
TYPEKEY=$(grep -o 'PublicKeyToken="[^"]*"' user.config | head -1 | cut -d '"' -f 2) | |
if [[ ! -z $TYPEKEY ]]; then | |
# Extracting the actual token | |
TYPEKEY=$(echo $TYPEKEY | awk '{print $NF}') | |
fi | |
fi | |
# Scan the existing config file for a seed and try to preserve it | |
PARAMSTR="" | |
SEED="" | |
if [ ! -z "$1" ]; then | |
grep "seed" user.config | |
fi | |
count=2 | |
while [ $count -lt 28 ]; do | |
PARAMSTR=$(sed -n "/seed/p" user.config | awk -v n=$count '{print $n}' | sed 's/[<>]//g') | |
if [[ ${PARAMSTR:0:4} == "seed" ]]; then | |
SEED=$PARAMSTR | |
break | |
fi | |
count=$((count + 1)) | |
done | |
# Backup the user.config file | |
if [ ! -f user.config.default ]; then | |
cp user.config user.config.default | |
fi | |
# Navigate to the script directory | |
cd "$(dirname "$0")" | |
# Create and populate user.config with XML content | |
{ | |
echo '<?xml version="1.0" encoding="utf-8"?>' | |
echo | |
echo '<configuration>' | |
echo | |
echo '<configSections>' | |
echo | |
echo "<sectionGroup name=\"userSettings\" type=\"System.Configuration.UserSettingsGroup, System.Configuration.ConfigurationManager, Version=6.0.0.0, Culture=neutral, PublicKeyToken=$TYPEKEY\" >" | |
echo | |
echo "<section name=\"RandomizerCommon.Properties.Settings\" type=\"System.Configuration.ClientSettingsSection, System.Configuration.ConfigurationManager, Version=6.0.0.0, Culture=neutral, PublicKeyToken=$TYPEKEY\" allowExeDefinition=\"MachineToLocalUser\" requirePermission=\"false\" />" | |
echo | |
echo '</sectionGroup>' | |
echo | |
echo '</configSections>' | |
echo | |
echo '<userSettings>' | |
echo | |
echo '<RandomizerCommon.Properties.Settings>' | |
echo | |
echo '<setting name="Exe" serializeAs="String">' | |
echo | |
echo "<value>${GAMEPATH}/eldenring.exe</value>" | |
echo | |
echo '</setting>' | |
echo | |
echo '<setting name="Mod" serializeAs="String">' | |
echo | |
echo "<value>$(pwd)/mod</value>" | |
echo | |
echo '</setting>' | |
echo | |
echo '<setting name="Options" serializeAs="String">' | |
echo | |
echo "<value>${SEED} ${RANDOMIZEOPT}</value>" | |
echo | |
echo '</setting>' | |
echo | |
echo '</RandomizerCommon.Properties.Settings>' | |
echo | |
echo '</userSettings>' | |
echo | |
echo '</configuration>' | |
} > user.config | |
# Configure and launch Fog Gate Randomizer | |
if [ -z "$FOG_ARCHIVE" ]; then | |
# go to dslrstart (This part will be script-specific, depending on how 'dslrstart' is defined) | |
exit 0 | |
fi | |
# If an alternative game path is specified, clear the randomizer settings | |
if [ ! -z "$ALT_GAMEPATH" ]; then | |
rm -rf "$APPDATA/../Local/FogMod" | |
fi | |
# Ensure the FogMod directory exists | |
mkdir -p "$APPDATA/../Local/FogMod" | |
# Navigate to the fog directory | |
cd fog | |
echo "Initializing randomizer settings, please wait..." | |
# Initialize FogMod | |
wine FogMod.exe & | |
# Wait for 3 seconds | |
sleep 3 | |
# Kill the FogMod process | |
pkill -f FogMod.exe | |
# Check if FogMod data is ready | |
count=0 | |
while [ $count -lt 5 ]; do # Change 5 to the maximum number of attempts | |
# Implementation for checking FogMod data | |
# If data is ready, break the loop | |
count=$((count + 1)) | |
done | |
# Navigate to the FogMod data directory | |
cd "$APPDATA/../Local/FogMod" | |
# Configure and launch Fog Gate Randomizer | |
if [ -z "$FOG_ARCHIVE" ]; then | |
# go to dslrstart (This part will be script-specific, depending on how 'dslrstart' is defined) | |
exit 0 | |
fi | |
# If an alternative game path is specified, clear the randomizer settings | |
if [ ! -z "$ALT_GAMEPATH" ]; then | |
rm -rf "$APPDATA/../Local/FogMod" | |
fi | |
# Ensure the Fog Gate Randomizer directory exists | |
mkdir -p "$APPDATA/../Local/FogMod" | |
cd fog | |
echo "Initializing randomizer settings, please wait..." | |
# Initialize fog | |
wine FogMod.exe & | |
# Wait for 3 seconds | |
sleep 3 | |
# Kill the FogMod process | |
pkill -f FogMod.exe | |
# Check fog data | |
count=0 | |
cd "$APPDATA/../Local/FogMod" | |
# If there are conflicting installations, purge them and start over | |
if [ ! -z "$1" ]; then | |
ls | |
fi | |
for d in $(ls -d FogMod*/); do | |
count=$((count + 1)) | |
done | |
if [ $count -gt 1 ]; then | |
for e in $(ls -d FogMod*/); do | |
rm -rf "$e" | |
done | |
cd "/D/fog" | |
# Restart the initialization process (Refer to previous script for initfog) | |
fi | |
if [ ! -d FogMod* ]; then | |
if [ -z "$SKIP_RANDOMIZER" ]; then | |
echo "Warning: Could not detect Fog Gate Randomizer settings, please click 'Merge Other Mod' then 'Select toml file' and point it towards" | |
echo "$CURDIR/randomizer/config_eldenringrandomizer.toml" | |
else | |
echo "Warning: Could not detect Fog Gate Randomizer settings, please click 'Merge Other Mod' then 'Select mod directory' and point it towards" | |
echo "$CURDIR/mod" | |
fi | |
echo "then close the randomizer to continue" | |
echo | |
sleep 3 | |
cd "/D/fog" | |
wine FogMod.exe | |
# Return to checking fog data (Refer to previous script for checkfogdata) | |
fi | |
cd FogMod*/ | |
cd 1.* | |
TYPEKEY="" | |
# Parse the config file for the PublicKeyToken | |
if [ -f user.config ]; then | |
TYPEKEY=$(grep -o 'PublicKeyToken="[^"]*"' user.config | head -1 | cut -d '"' -f 2) | |
if [[ ! -z $TYPEKEY ]]; then | |
# Extracting the actual token | |
TYPEKEY=$(echo $TYPEKEY | awk '{print $NF}') | |
fi | |
fi | |
# Scan the existing config file for a seed and try to preserve it | |
PARAMSTR="" | |
FOG_SEED="" | |
if [ ! -z "$1" ]; then | |
grep "seed" user.config | |
fi | |
count=2 | |
while [ $count -lt 28 ]; do | |
PARAMSTR=$(sed -n "/seed/p" user.config | awk -v n=$count '{print $n}' | sed 's/[<>]//g') | |
if [[ ${PARAMSTR:0:4} == "seed" ]]; then | |
FOG_SEED=$PARAMSTR | |
break | |
fi | |
count=$((count + 1)) | |
done | |
# Finalize configuration for Fog Gate Randomizer | |
# Param loop end logic | |
if [ -z "$FOG_SEED" ] || [ "$FOG_SEED" == "seed:0" ]; then | |
FOG_SEED="$SEED" | |
fi | |
# Backup the user.config file | |
if [ ! -f user.config.default ] && [ -f user.config ]; then | |
mv user.config user.config.default | |
fi | |
# Write XML to user.config | |
{ | |
echo '<?xml version="1.0" encoding="utf-8"?>' | |
echo | |
echo '<configuration>' | |
echo | |
echo '<configSections>' | |
echo | |
echo "<sectionGroup name=\"userSettings\" type=\"System.Configuration.UserSettingsGroup, System.Configuration.ConfigurationManager, Version=6.0.0.0, Culture=neutral, PublicKeyToken=$TYPEKEY\" >" | |
echo | |
echo "<section name=\"FogMod.Properties.Settings\" type=\"System.Configuration.ClientSettingsSection, System.Configuration.ConfigurationManager, Version=6.0.0.0, Culture=neutral, PublicKeyToken=$TYPEKEY\" allowExeDefinition=\"MachineToLocalUser\" requirePermission=\"false\" />" | |
echo | |
echo '</sectionGroup>' | |
echo | |
echo '</configSections>' | |
echo | |
echo '<userSettings>' | |
echo | |
echo '<FogMod.Properties.Settings>' | |
echo | |
echo '<setting name="Options" serializeAs="String">' | |
echo | |
echo "<value>$FOG_SEED coupledminor coupledwarp crawl lantern newgraces openstart physick req_catacomb req_cave req_divine req_grave req_graveyard req_minorwarp req_tunnel req_underground roundtable scale stoneshop v3</value>" | |
echo | |
echo '</setting>' | |
echo | |
echo '<setting name="Mod" serializeAs="String">' | |
echo | |
echo '</setting>' | |
echo | |
echo '</FogMod.Properties.Settings>' | |
echo | |
echo '</userSettings>' | |
echo | |
echo '</configuration>' | |
} > user.config | |
# Navigate to the script directory | |
cd "$(dirname "$0")" | |
# Append additional XML content to user.config | |
{ | |
if [ -z "$SKIP_RANDOMIZER" ]; then | |
echo "<setting name=\"Mod\" serializeAs=\"String\">" | |
echo "<value>$(pwd)/randomizer/config_eldenringrandomizer.toml</value>" | |
else | |
echo "<setting name=\"Mod\" serializeAs=\"String\">" | |
echo "<value>$(pwd)/mod/regulation.bin</value>" | |
fi | |
echo '</setting>' | |
echo | |
echo '</FogMod.Properties.Settings>' | |
echo | |
echo '</userSettings>' | |
echo | |
echo '</configuration>' | |
} >> user.config | |
# Return to the original directory | |
cd "$OLDPWD" | |
# Install and configure Diablo Style Loot Randomizer | |
DSL_START_LABEL="dslrstart" | |
DSLRSEED="MySeed" | |
# Skip to generatetoml if DSLR_ARCHIVE is not set | |
if [ -z "$DSLR_ARCHIVE" ]; then | |
# Replace with the actual goto equivalent or call to generatetoml function | |
generatetoml | |
exit 0 | |
fi | |
# Parse existing config file for seed | |
if [ -f ./DSLR/DSLData/DSLSave.ini ]; then | |
DSLRSEED=$(grep 'dslseed' ./DSLR/DSLData/DSLSave.ini | cut -d '"' -f 2) | |
fi | |
# Remove existing DSLR directory if it exists | |
[ -d ./DSLR ] && rm -rf ./DSLR | |
cd tools | |
unzip -o "../downloads/$DSLR_ARCHIVE" -d ../DSLR | |
# Check if unzip was successful | |
if [ $? -eq 0 ]; then | |
echo "Extracted $DSLR_ARCHIVE" >> "$INSTALL_MANIFEST" | |
else | |
echo "Failed to extract $DSLR_ARCHIVE with error code $?" >> "$INSTALL_MANIFEST" | |
INSTALL_ERROR=$? | |
fi | |
echo "" >> "$INSTALL_MANIFEST" | |
cd .. | |
# Apply DSLR compatibility edits if SKIP_REFORGED is not set | |
if [ -z "$SKIP_REFORGED" ]; then | |
cd tools | |
wine DSMSPortable.exe "../mod/regulation.bin" -M+ "../massedit/dslr.massedit" | |
if [ $? -eq 0 ]; then | |
echo "Applied DSLR compatibility edits" >> "$INSTALL_MANIFEST" | |
else | |
echo "Attempted DSLR compatibility edits with error code $?" >> "$INSTALL_MANIFEST" | |
INSTALL_ERROR=$? | |
fi | |
# Perform recovery if necessary | |
if [ -f ../mod/regulation.bin.temp ]; then | |
mv -f ../mod/regulation.bin.temp ../mod/regulation.bin | |
echo " and performed recovery" >> "$INSTALL_MANIFEST" | |
fi | |
echo "" >> "$INSTALL_MANIFEST" | |
cd .. | |
fi | |
# Delete specific file if exists | |
rm -f ./DSLR/DSLData/ER/Default/Param_Weapons/ids_excluded_from_random_choice.txt | |
# Copying configuration files from the reference directory to the DSLR directory | |
cp -f ./ref/DSLR_EquipParamAccessory.csv ./DSLR/DSLData/ER/Default/Param_Talisman/EquipParamAccessory.csv | |
cp -f ./ref/DSLR_TalismanConfig.csv ./DSLR/DSLData/ER/Default/Param_Talisman/TalismanConfig.csv | |
cp -f ./ref/DSLR_EquipParamProtector.csv ./DSLR/DSLData/ER/Default/Param_Armor/EquipParamProtector.csv | |
cp -f ./ref/DSLR_EquipParamWeapon_StaffsSeals.csv ./DSLR/DSLData/ER/Default/Param_Weapons/EquipParamWeapon_StaffsSeals.csv | |
cp -f ./ref/DSLR_EquipWeaponParamShields.csv ./DSLR/DSLData/ER/Default/Param_Weapons/EquipWeaponParamShields.csv | |
cp -f ./ref/DSLR_DamageTypeSetup.csv ./DSLR/DSLData/ER/Default/DamageTypes/DamageTypeSetup.csv | |
cp -f ./ref/DSLR_SpEffectParam.csv ./DSLR/DSLData/ER/Default/Param_SpEffects/SpEffectParam.csv | |
cp -f ./ref/DSLR_RaritySetup.csv ./DSLR/DSLData/ER/Default/Rarities/RaritySetup.csv | |
cp -f ./ref/DSLR_Elites.ini ./DSLR/DSLData/ER/Default/Itemlots_Enemies/banishedknights.ini | |
cp -f ./ref/DSLR_Champions.ini ./DSLR/DSLData/ER/Default/Itemlots_Enemies/crucibleknights.ini | |
cp -f ./ref/DSLR_runebears.ini ./DSLR/DSLData/ER/Default/Itemlots_Enemies/runebears.ini | |
cp -f ./ref/DSLR_crabsandlobstersdropanything.ini ./DSLR/DSLData/ER/Default/Itemlots_Enemies/crabsandlobstersdropanything.ini | |
cp -f ./ref/DSLR_dogsdroparmor.ini ./DSLR/DSLData/ER/Default/Itemlots_Enemies/dogsdroparmor.ini | |
cp -f ./ref/DSLR_imps.ini ./DSLR/DSLData/ER/Default/Itemlots_Enemies/imps.ini | |
cp -f ./ref/DSLR_castleexiles.ini ./DSLR/DSLData/ER/Default/Itemlots_Enemies/castleexiles.ini | |
cp -f ./ref/DSLR_misbegotten.ini ./DSLR/DSLData/ER/Default/Itemlots_Enemies/misbegotten.ini | |
cp -f ./ref/DSLR_caelid_dogscrows.ini ./DSLR/DSLData/ER/Default/Itemlots_Enemies/caelid_dogscrows.ini | |
cp -f ./ref/DSLR_limgrave.ini ./DSLR/DSLData/ER/Default/Itemlots_Map/limgrave.ini | |
cp -f ./ref/DSLR_map_talismans.ini ./DSLR/DSLData/ER/Default/Itemlots_Map/map_talismans.ini | |
cp -f ./ref/DSLR_map_armor.ini ./DSLR/DSLData/ER/Default/Itemlots_Map/map_armor.ini | |
cp -f ./ref/DSLR_map_weapons.ini ./DSLR/DSLData/ER/Default/Itemlots_Map/map_weapons.ini | |
rm -f ./DSLR/DSLData/ER/Default/Itemlots_Map/remembrance_godrick.ini | |
# Conditional setup based on the existence of CLEVERS_ARCHIVE | |
if [ ! -z "$CLEVERS_ARCHIVE" ]; then | |
cp -f ./ref/DSLR_EquipWeaponParam_clevers.csv ./DSLR/DSLData/ER/Default/Param_Weapons/EquipWeaponParam.csv | |
cp -f ./ref/DSLR_Whitelist_299.ini ./DSLR/DSLData/ER/Default/WhitelistedLoot/299_Clevers.ini | |
else | |
cp -f ./ref/DSLR_EquipWeaponParam.csv ./DSLR/DSLData/ER/Default/Param_Weapons/EquipWeaponParam.csv | |
cp -f ./ref/DSLR_Whitelist_297.ini ./DSLR/DSLData/ER/Default/WhitelistedLoot/297_Reforged.ini | |
echo "33710000" >> ./DSLR/DSLData/ER/Default/Param_Weapons/ids_excluded_from_random_choice.txt | |
echo "" >> ./DSLR/DSLData/ER/Default/Param_Weapons/ids_excluded_from_random_choice.txt | |
fi | |
# Conditional setup based on the existence of TALENT_ARCHIVE | |
if [ -z "$TALENT_ARCHIVE" ]; then | |
cp -f ./ref/DSLR_SpEffectConfig_Default.csv ./DSLR/DSLData/ER/Default/Param_SpEffects/SpEffectConfig_Default.csv | |
cat ./ref/DSLR_weapon_talent.txt >> ./DSLR/DSLData/ER/Default/Param_Weapons/ids_excluded_from_random_choice.txt | |
cat ./ref/DSLR_accessory_talent.txt >> ./DSLR/DSLData/ER/Default/Param_Talisman/ids_excluded_from_random_choice.txt | |
else | |
cp -f ./ref/DSLR_SpEffectConfig_Talent.csv ./DSLR/DSLData/ER/Default/Param_SpEffects/SpEffectConfig_Default.csv | |
cp -f ./ref/DSLR_Whitelist_298.ini ./DSLR/DSLData/ER/Default/WhitelistedLoot/298_Talent.ini | |
rm -f ./DSLR/DSLData/ER/Default/Itemlots_Map/limgrave_beastmanboss_farumazula_beasts.ini | |
echo "30402" >> ./DSLR/DSLData/ER/Default/Itemlots_Map/ItemlotIDBlacklist.txt | |
echo "" >> ./DSLR/DSLData/ER/Default/Itemlots_Map/ItemlotIDBlacklist.txt | |
fi | |
# Set DSLRSEED based on different conditions | |
if [[ "$DSLRSEED" == "MySeed" ]] || [[ "$DSLRSEED" == "DSL" ]]; then | |
if [ ! -z "$SEED" ] && [ "$SEED" != "0" ]; then | |
DSLRSEED="${SEED:5}" | |
fi | |
if [ ! -z "$FOGSEED" ] && [ "$FOGSEED" != "0" ]; then | |
DSLRSEED="${FOGSEED:5}" | |
fi | |
fi | |
# Set DSMSPATH and MODPATH | |
DSLR_DSMSPATH="$(pwd)/tools" | |
DSLR_MODPATH="$(pwd)/mod" | |
if [ ! -z "$FOG_ARCHIVE" ]; then | |
DSLR_MODPATH="$(pwd)/fog" | |
elif [ -z "$SKIP_RANDOMIZER" ]; then | |
DSLR_MODPATH="$(pwd)/randomizer" | |
fi | |
# Convert backslashes to forward slashes for Unix paths | |
DSLR_DSMSPATH="${DSLR_DSMSPATH//\\//}" | |
DSLR_MODPATH="${DSLR_MODPATH//\\//}" | |
# Writing configuration to DSLSave.ini | |
cd DSLR/DSLData | |
{ | |
echo "[version]" | |
echo | |
echo "version=3" | |
echo | |
echo "[seed]" | |
echo | |
echo "dslseed=\"$DSLRSEED\"" | |
echo | |
echo "[dsms]" | |
echo | |
echo "reg1path=\"${GAMEPATH//\\//}\"" | |
echo | |
echo "item1path=\"\"" | |
echo | |
echo "reg2path=\"\"" | |
echo | |
echo "item2path=\"\"" | |
echo | |
echo "usereg2=false" | |
echo | |
echo "useitem2=false" | |
echo | |
echo "dsmspath=\"$DSLR_DSMSPATH\"" | |
echo | |
echo "openexpauto=false" | |
} > DSLSave.ini | |
# Continue writing to DSLSave.ini | |
cd DSLR/DSLData | |
# Append additional configurations | |
{ | |
if [ -z "$SKIP_RANDOMIZER" ]; then | |
echo "chaosloot=true" | |
else | |
echo "chaosloot=false" | |
fi | |
chaosrarity=false | |
if [ ! -z "$SKIP_REFORGED" ] && [ -z "$SKIP_RANDOMIZER" ]; then | |
chaosrarity=true | |
fi | |
echo "chaosrarity=$chaosrarity" | |
echo "changeareascaling=false" | |
echo "areascaling_early_hp=100.0" | |
echo "areascaling_early_damage=100.0" | |
echo "areascaling_late_hp=742.0" | |
echo "areascaling_late_damage=379.0" | |
echo "lootdropchance=5.0" | |
echo "onesmithingstone=false" | |
echo "maxupgrademult=160.0" | |
echo "lootperitemlot=4.0" | |
echo "splitdamagechance=50.0" | |
echo "uniqueweaponnamechance=0" | |
echo "textmergesplitthreshold=7000.0" | |
echo "quickstartmode=0" | |
echo "lootdropsguaranteed=true" | |
if [ -z "$SKIP_REFORGED" ]; then | |
echo "rarityaffectsarmorabsorption=false" | |
else | |
echo "rarityaffectsarmorabsorption=true" | |
fi | |
# Ensure the path is formatted for Unix-style file systems | |
modfolderpath_unix="${DSLR_MODPATH//\\//}" | |
echo "modfolderpath=\"$modfolderpath_unix\"" | |
} >> DSLSave.ini | |
# Return to the original directory | |
cd "$OLDPWD" | |
#!/bin/bash | |
# Write to TOML file | |
GENERATE_TOML_LABEL="generatetoml" | |
{ | |
echo "[modengine]" | |
echo | |
echo "debug = false" | |
echo | |
# Check SKIP_LOADER variable to include external DLLs | |
if [ ! -z "$SKIP_LOADER" ]; then | |
echo "# Disable or add DLL mods by commenting them out or adding them here" | |
echo | |
echo "external_dlls = [" | |
echo | |
[ -z "$SKIP_SEAMLESS" ] && echo " \"DLL Mods/elden_ring_seamless_coop.dll\"," | |
[ ! -z "$FPS_ARCHIVE" ] && echo " \"DLL Mods/erfps.dll\"," | |
[ ! -z "$ERD_ARCHIVE" ] && echo " \"DLL Mods/ErdTools.dll\"," | |
[ ! -z "$POSTURE_ARCHIVE" ] && echo " \"DLL Mods/PostureBarMod.dll\"," | |
echo "]" | |
echo | |
fi | |
} > config_eldenring.toml | |
# Continue writing to config_eldenring.toml | |
{ | |
echo | |
echo "[extension.mod_loader]" | |
echo | |
echo "enabled = true" | |
echo | |
echo "loose_params = false" | |
echo | |
echo "# Disable mods by commenting them out or setting enabled = false here" | |
echo | |
echo "mods = [" | |
echo | |
if [ ! -z "$FOG_ARCHIVE" ]; then | |
echo " { enabled = true, name = \"foggaterandomizer\", path = \"fog\" }," | |
fi | |
if [ -z "$SKIP_RANDOMIZER" ]; then | |
echo " { enabled = true, name = \"randomizer\", path = \"randomizer\" }," | |
fi | |
if [ -z "$SKIP_REFORGED" ]; then | |
echo " { enabled = true, name = \"reforged\", path = \"mod\" }" | |
else | |
echo " { enabled = true, name = \"unalloyed\", path = \"mod\" }" | |
fi | |
echo "]" | |
echo | |
echo | |
echo "[extension.scylla_hide]" | |
echo | |
echo "enabled = false" | |
echo | |
} >> config_eldenring.toml | |
# Initialize variables | |
GENERATE_SAVES_LABEL="generatesaves" | |
loops=0 | |
STEAM_ID="" | |
# Function to check saves | |
check_saves() { | |
local steam_ids | |
steam_ids=$(ls -1tr "$APPDATA/EldenRing" | grep '^\d\+$') | |
for id in $steam_ids; do | |
STEAM_ID=$id | |
((loops++)) | |
done | |
# Compare IDs to check if new save data is found | |
if [ "$loops" -gt 1 ]; then | |
if [ "$COMPARE_ID" == "$STEAM_ID" ]; then | |
echo "ERROR: Could not detect any save data in" | |
echo "$APPDATA/EldenRing/$STEAM_ID" | |
read -p "Retry generating save data (Y/n)? " choice | |
if [ "$choice" != "${choice#[Nn]}" ]; then | |
goto configseamless | |
fi | |
fi | |
fi | |
} | |
# Main script | |
echo "Checking save data..." | |
COMPARE_ID="$STEAM_ID" | |
check_saves | |
# Check if the save file exists | |
if [ ! -f "$APPDATA/EldenRing/$STEAM_ID/ER0000.sl2" ]; then | |
# Update saves | |
echo | |
echo "--------------------------------------------------------------------------------" | |
echo "Launching game once in vanilla to generate or update save data to latest version." | |
echo "Please wait for the game to launch then select 'Quit Game' to generate save data." | |
echo "Note: Steam must be running in order to launch the game." | |
echo "--------------------------------------------------------------------------------" | |
echo | |
sleep 3 | |
echo "Press any key to launch the game..." | |
read -n 1 -s -r -p "" | |
"$GAMEPATH/start_protected_game.exe" | |
read -n 1 -s -r -p "" | |
if [ ! -f "$APPDATA/EldenRing/$STEAM_ID/ER0000.sl2" ]; then | |
check_saves # Assuming this function is defined in the context of your script | |
fi | |
fi | |
# Check for Seamless Co-op save data | |
if [ -z "$SKIP_SEAMLESS" ]; then | |
if [ ! -f "$APPDATA/EldenRing/$STEAM_ID/ER0000.co2" ]; then | |
echo | |
echo "--------------------------------------------------------------------------------" | |
echo "No Seamless Co-op save data found." | |
echo "Launching game once with only Seamless Co-op to generate save files." | |
echo "Please wait for the game to launch then select 'Quit Game' to generate save data." | |
echo "Note: Steam must be running in order to launch the game and make sure that" | |
echo "$DLLMODS/elden_ring_seamless_coop.dll" | |
echo "is not being blocked by anti-virus software." | |
echo "--------------------------------------------------------------------------------" | |
echo | |
sleep 3 | |
echo "Press any key to launch the game..." | |
read -n 1 -s -r -p "" | |
# Launch the game with Seamless Co-op | |
# Depending on your setup, you might need to modify this command. | |
fi | |
fi | |
if [ -z "$SKIP_LOADER" ]; then | |
if [ -f "$GAMEPATH/modloader.dll" ]; then | |
mv "$GAMEPATH/modloader.dll" "$GAMEPATH/dinput8.dll" | |
fi | |
if [ -d "$GAMEPATH/mods" ]; then | |
mv "$GAMEPATH/mods" "$GAMEPATH/tmp" | |
mkdir -p "$GAMEPATH/mods" | |
cp -f "$GAMEPATH/tmp/elden_ring_seamless_coop.dll" "$GAMEPATH/mods/" | |
cp -f "$GAMEPATH/tmp/seamlesscoopsettings.ini" "$GAMEPATH/mods/" | |
fi | |
modengine2_launcher -t er -c ./config_eldenring.toml.disabled | |
echo "Waiting for process to terminate..." | |
while pgrep -x "eldenring.exe" > /dev/null; do | |
sleep 2 | |
done | |
sleep 5 | |
if [ -f "$GAMEPATH/dinput8.dll" ]; then | |
mv "$GAMEPATH/dinput8.dll" "$GAMEPATH/modloader.dll" | |
fi | |
if [ -d "$GAMEPATH/tmp" ] && [ -d "$GAMEPATH/mods" ]; then | |
rm -rf "$GAMEPATH/mods" | |
mv "$GAMEPATH/tmp" "$GAMEPATH/mods" | |
fi | |
else | |
modengine2_launcher -t er -c ./config_eldenring.toml.disabled2 | |
sleep 5 | |
fi | |
if [ ! -f "$APPDATA/EldenRing/$STEAM_ID/ER0000.co2" ]; then | |
check_saves # Assuming this function is defined in the context of your script | |
fi | |
sed -i "s/(set STEAM_ID)=\d*/\1=$STEAM_ID/" launchmod_eldenring.bat | |
# Configure Seamless Co-op | |
config_seamless() { | |
if [ -n "$SKIP_SEAMLESS" ]; then | |
finalize | |
return | |
fi | |
if [ -n "$SEAMLESS_CONF" ]; then | |
finalize | |
return | |
fi | |
echo "Please set a Seamless Co-op password in SeamlessCoopSettings.ini and save the file before continuing." | |
sleep 3 | |
if [ -z "$SKIP_LOADER" ]; then | |
xdg-open "$GAMEPATH/mods/seamlesscoopsettings.ini" | |
else | |
xdg-open "$PWD/DLL Mods/seamlesscoopsettings.ini" | |
fi | |
if [ -z "$1" ]; then | |
read -p "Press any key to continue..." -n 1 -s | |
fi | |
finalize | |
} | |
# Finalize Configuration | |
finalize() { | |
echo "Creating shortcuts..." | |
# Disable RTX | |
sed -i 's/\(<RaytracingQuality>\).*\(<\/RaytracingQuality>\)/\1DISABLED\2/' "$APPDATA/EldenRing/GraphicsConfig.xml" | |
} | |
config_seamless | |
# Function to create a desktop entry | |
create_desktop_entry() { | |
local name="$1" | |
local exec="$2" | |
local icon="$3" | |
local comment="$4" | |
local desktop_file="$HOME/Desktop/$name.desktop" | |
echo "[Desktop Entry]" > "$desktop_file" | |
echo "Version=1.0" >> "$desktop_file" | |
echo "Type=Application" >> "$desktop_file" | |
echo "Name=$name" >> "$desktop_file" | |
echo "Exec=$exec" >> "$desktop_file" | |
echo "Icon=$icon" >> "$desktop_file" | |
echo "Comment=$comment" >> "$desktop_file" | |
echo "Terminal=false" >> "$desktop_file" | |
chmod +x "$desktop_file" | |
} | |
# Create shortcuts | |
create_desktop_entry "Elden Ring Unalloyed" "$PWD/launchmod_eldenring.bat" "$PWD/unalloyed_icon.ico" "Launch Elden Ring with Unalloyed mod" | |
if [ -z "$SKIP_LOADER" ]; then | |
create_desktop_entry "DLL Mods" "$GAMEPATH/mods" "" "DLL Mods for Elden Ring" | |
create_desktop_entry "Mod Loader Config" "$GAMEPATH/mod_loader_config.ini" "" "Configuration for Mod Loader" | |
[ -f "$GAMEPATH/mods/seamlesscoopsettings.ini" ] && create_desktop_entry "Seamless Coop Settings" "$GAMEPATH/mods/seamlesscoopsettings.ini" "" "Settings for Seamless Coop Mod" | |
[ -f "$GAMEPATH/mods/erfps_settings.ini" ] && create_desktop_entry "ERFPS Settings" "$GAMEPATH/mods/erfps_settings.ini" "" "Settings for ERFPS Mod" | |
[ -f "$GAMEPATH/mods/PostureBarModConfig.ini" ] && create_desktop_entry "Posture Bar Mod Config" "$GAMEPATH/mods/PostureBarModConfig.ini" "" "Configuration for Posture Bar Mod" | |
[ -f "$GAMEPATH/mods/erd_tools.ini" ] && create_desktop_entry "Erd Tools" "$GAMEPATH/mods/erd_tools.ini" "" "Erd Tools for Elden Ring" | |
else | |
[ -f "$PWD/DLL Mods/seamlesscoopsettings.ini" ] && create_desktop_entry "Seamless Coop Settings" "$PWD/DLL Mods/seamlesscoopsettings.ini" "" "Settings for Seamless Coop Mod" | |
[ -f "$PWD/DLL Mods/erfps_settings.ini" ] && create_desktop_entry "ERFPS Settings" "$PWD/DLL Mods/erfps_settings.ini" "" "Settings for ERFPS Mod" | |
[ -f "$PWD/DLL Mods/PostureBarModConfig.ini" ] && create_desktop_entry "Posture Bar Mod Config" "$PWD/DLL Mods/PostureBarModConfig.ini" "" "Configuration for Posture Bar Mod" | |
[ -f "$PWD/DLL Mods/erd_tools.ini" ] && create_desktop_entry "Erd Tools" "$PWD/DLL Mods/erd_tools.ini" "" "Erd Tools for Elden Ring" | |
fi | |
# Create shortcuts | |
echo "Creating shortcuts..." | |
desktop_shortcut_path="$HOME/Desktop/Elden Ring Unalloyed.lnk" | |
ln -s "$PWD/launchmod_eldenring.bat" "$desktop_shortcut_path" | |
# More shortcuts based on condition | |
if [ -z "$SKIP_LOADER" ]; then | |
# Create shortcuts for different configuration files inside 'mods' directory | |
for file in seamlesscoopsettings.ini erfps_settings.ini PostureBarModConfig.ini erd_tools.ini; do | |
if [ -f "$GAMEPATH/mods/$file" ]; then | |
ln -s "$GAMEPATH/mods/$file" "$PWD/${file%.*}.lnk" | |
fi | |
done | |
else | |
# Create shortcuts for different configuration files inside 'DLL Mods' directory | |
for file in seamlesscoopsettings.ini erfps_settings.ini PostureBarModConfig.ini erd_tools.ini; do | |
if [ -f "$PWD/DLL Mods/$file" ]; then | |
ln -s "$PWD/DLL Mods/$file" "$PWD/${file%.*}.lnk" | |
fi | |
done | |
fi | |
# SaveData Shortcut | |
save_data_shortcut_path="$PWD/SaveData.lnk" | |
ln -s "$APPDATA/EldenRing/$STEAM_ID" "$save_data_shortcut_path" | |
echo "Performing cleanup..." | |
# Cleanup operations | |
rm -f mod/regulation.bin.prev mod/chr/c0000.anibnd.dcx.prev mod/chr/c0000_a9x.anibnd.dcx.prev | |
rm -f mod/menu/hi/01_common.tpf.dcx.prev mod/menu/hi/01_common.sblytbnd.dcx.prev | |
rm -f mod/msg/engus/item.msgbnd.dcx.prev mod/msg/engus/menu.msgbnd.dcx.prev | |
rm -f mod/sfx/sfxbnd_commoneffects.ffxbnd.dcx.prev | |
rm -rf "$TMPDIR/unalloyed_temp" | |
# Update Install Manifest | |
sed -i 's/ \([1-9]\).zip/.zip/g' "$INSTALL_MANIFEST" | |
checksum=$(md5sum install_manifest.txt | cut -d' ' -f1) | |
echo "Checksum: $checksum" | |
# Create a shortcut to Save Data folder | |
powershell -Command "$s=(New-Object -COM WScript.Shell).CreateShortcut('%~dp0\SaveData.lnk');$s.TargetPath='%APPDATA%\EldenRing\%STEAM_ID%';$s.WorkingDirectory='%APPDATA%\EldenRing\%STEAM_ID%';$s.Save();" | |
echo "Performing cleanup..." | |
# Delete previous backup files if they exist | |
rm -f mod\regulation.bin.prev | |
rm -f mod\chr\c0000.anibnd.dcx.prev | |
rm -f mod\chr\c0000_a9x.anibnd.dcx.prev | |
rm -f mod\menu\hi\01_common.tpf.dcx.prev | |
rm -f mod\menu\hi\01_common.sblytbnd.dcx.prev | |
rm -f mod\msg\engus\item.msgbnd.dcx.prev | |
rm -f mod\msg\engus\menu.msgbnd.dcx.prev | |
rm -f mod\sfx\sfxbnd_commoneffects.ffxbnd.dcx.prev | |
# Remove temporary unalloyed_temp directory if it exists | |
rm -rf "%~d0\unalloyed_temp" | |
# Normalize the install manifest file content | |
sed -i 's/ \([1-9]\).zip/.zip/g' "%INSTALL_MANIFEST%" | |
# Calculate the checksum of the installation | |
CHECKSUM=$(certutil -hashfile install_manifest.txt MD5 | grep -v ':') | |
echo "Install Checksum: $CHECKSUM" >> "%INSTALL_MANIFEST%" | |
echo >> "%INSTALL_MANIFEST%" | |
echo "Misc:" >> "%INSTALL_MANIFEST%" | |
echo >> "%INSTALL_MANIFEST%" | |
# Record additional information in the install manifest | |
[[ -n "$LOADER_ARCHIVE" ]] && echo "Extracted $LOADER_ARCHIVE" >> "%INSTALL_MANIFEST%" | |
[[ -n "$FPS_ARCHIVE" ]] && echo "Extracted $FPS_ARCHIVE" >> "%INSTALL_MANIFEST%" | |
[[ -n "$ERD_ARCHIVE" ]] && echo "Extracted $ERD_ARCHIVE" >> "%INSTALL_MANIFEST%" | |
[[ -n "$POSTURE_ARCHIVE" ]] && echo "Extracted $POSTURE_ARCHIVE" >> "%INSTALL_MANIFEST%" | |
[[ "$PARTSMODS" != "0" ]] && echo "Applied $PARTSMODS model swap(s)" >> "%INSTALL_MANIFEST%" | |
# Check if there were installation errors | |
if [ -n "$INSTALL_ERROR" ]; then | |
echo "----------------------------------------------------" | |
echo "One or more errors were detected during installation" | |
echo "----------------------------------------------------" | |
echo "See \"$INSTALL_MANIFEST\" for details" | |
echo "Your install checksum is: $CHECKSUM" | |
[[ -z "$1" ]] && read -p "Press any key to continue..." -n 1 -s | |
fi | |
# Check and launch randomizers as needed | |
if [[ -n "$SKIP_RANDOMIZER" ]] && [[ -z "$FOG_ARCHIVE" ]]; then | |
goto :norando | |
fi | |
if [[ -z "$1" ]]; then | |
timeout 2 > nul | |
fi | |
echo "You may now start randomizing." | |
powershell -Command "write-host -ForegroundColor Yellow 'Double check that the text box by \"Merge other mod\" is pointing to %CURDIR%\mod'" | |
if [[ $? -ne 0 ]]; then | |
echo "Double check that the text box by 'Merge other mod' is pointing to %CURDIR%\mod" | |
fi | |
if [[ -z "$SKIP_RANDOMIZER" ]] && [[ -n "$FOG_ARCHIVE" ]]; then | |
powershell -Command "write-host -ForegroundColor Yellow 'and in Fog Gate Randomizer, it should be pointing to %CURDIR%\randomizer\config_eldenringrandomizer.toml'" | |
if [[ $? -ne 0 ]]; then | |
echo "and in Fog Gate Randomizer, it should be pointing to %CURDIR%\randomizer\config_eldenringrandomizer.toml" | |
fi | |
fi | |
echo | |
# If first argument is empty, sleep for 2 seconds | |
if [[ -z "$1" ]]; then | |
sleep 2 | |
fi | |
# Randomizer operations | |
if [[ -n "$DSLR_ARCHIVE" ]]; then | |
if [[ -z "$SKIP_RANDOMIZER" ]]; then | |
cd randomizer | |
echo "Launching Item and Enemy Randomizer..." | |
EldenRingRandomizer.exe | |
cd .. | |
fi | |
fi | |
if [[ -n "$FOG_ARCHIVE" ]]; then | |
cd fog | |
echo "Launching Fog Gate Randomizer..." | |
FogMod.exe | |
cd .. | |
fi | |
cd DSLR | |
echo "Launching Diablo Style Loot Remastered..." | |
./DSLR.exe > dslr.log 2>&1 | |
cd .. | |
cd "$DSLR_MODPATH" | |
cd DSLR_* | |
# This will find the most recent DSLR_Install_*.bat file | |
DSLR_Installer=$(find . -maxdepth 1 -type f -name "DSLR_Install_*.bat" | sort | tail -n 1) | |
if [[ -z "$1" ]] && [[ -f "$DSLR_Installer" ]]; then | |
read -p "Begin applying Diablo Style Loot script ($DSLR_Installer)? [y/N] " -n 1 -r | |
echo | |
if [[ $REPLY =~ ^[Yy]$ ]]; then | |
# Call the installer script here | |
./"$DSLR_Installer" | |
else | |
# Handle skipping the installer script | |
echo "Skipping DSLR Installer..." | |
fi | |
fi | |
if [[ -n "$FOG_ARCHIVE" ]] && [[ -z "$SKIP_RANDOMIZER" ]]; then | |
cd randomizer | |
echo "Launching Item and Enemy Randomizer..." | |
./EldenRingRandomizer.exe | |
cd .. | |
fi | |
# Define variables | |
GAMEPATH="/path/to/EldenRing" | |
MODPATH="/path/to/mods" | |
INSTALL_MANIFEST="/path/to/install_manifest.txt" | |
STEAM_ID="YourSteamID" | |
SEED="YourSeed" | |
# Function to launch randomizer | |
launch_randomizer() { | |
echo "Launching Randomizer..." | |
# Command to launch randomizer (if applicable) | |
} | |
# Function to finalize installation | |
finalize_installation() { | |
echo "Finalizing Installation..." | |
# Additional commands for finalizing | |
} | |
# Check for existing save data | |
echo "Checking for existing save data..." | |
if [ ! -f "$HOME/EldenRing/$STEAM_ID/ER0000.sl2" ]; then | |
echo "Save data not found. Launching game to generate save data..." | |
# Command to launch game | |
fi | |
# Configure Randomizers | |
if [ -f "$MODPATH/randomizer/config.toml" ]; then | |
echo "Configuring Randomizer..." | |
# Configuration steps for randomizer | |
fi | |
# Apply mods and launch game | |
echo "Applying mods..." | |
# Copy mods to appropriate directories or execute relevant commands | |
echo "Launching Elden Ring with mods..." | |
# Command to launch Elden Ring with mods | |
# Finalization | |
finalize_installation | |
# Open installation manifest | |
echo "Opening installation manifest..." | |
xdg-open "$INSTALL_MANIFEST" | |
exit 0 | |
::============================================================================= | |
# Define variables | |
DSLR_MODPATH="/path/to/DSLR/mod" | |
TOOLS_PATH="/path/to/tools" | |
PARTSMODEDIT="" | |
echo "Preparing DSLR Script..." | |
# Replace 'pause' with 'timeout 2 > nul' in the DSLR Installer script | |
sed -i 's/pause/timeout 2 > nul/' "$DSLR_MODPATH/DSLR_Installer.bat" | |
# Replace '#' with '\#' in the DSLRMassedit.massedit file | |
sed -i 's/#/\\#/' "$DSLR_MODPATH/DSLRMassedit.massedit" | |
# Run DSLR Installer script | |
bash "$DSLR_MODPATH/DSLR_Installer.bat" | |
echo "Applying optional DSLR fixes..." | |
# Check if the tmp.massedit exists and set variable | |
if [ -f "$TOOLS_PATH/partmods/tmp.massedit" ]; then | |
PARTSMODEDIT="$TOOLS_PATH/partmods/tmp.massedit" | |
fi | |
# Execute DSMSPortable with specified parameters | |
DSMSPortable "$DSLR_MODPATH/regulation.bin" -M "$TOOLS_PATH/massedit/dslr2.massedit" "$PARTSMODEDIT" -R "ItemLotParam_enemy:431100009" "ItemLotParam_enemy:431100029" "ItemLotParam_enemy:431100109" "ItemLotParam_enemy:431100119" | |
echo "Applying DSLR international language patch..." | |
# Create tmp directory and subdirectories | |
mkdir -p tmp/item | |
# Extract item.msgbnd.dcx file | |
Yabber "$DSLR_MODPATH/msg/engus/item.msgbnd.dcx" | |
mv "$DSLR_MODPATH/msg/engus/item-msgbnd-dcx/GR/data/INTERROOT_win64/msg/engUS" tmp/item | |
rm -r "$DSLR_MODPATH/msg/engus/item-msgbnd-dcx" | |
# Define DSLR_MODPATH | |
DSLR_MODPATH="/path/to/DSLR/mod" | |
# Function to copy and merge item message files | |
copy_and_merge() { | |
local source_path="$1" | |
local dest_path="$2" | |
local item_msgbnd="$3" | |
if [ ! -f "$dest_path/item.msgbnd.dcx" ]; then | |
if [ "$SKIP_RANDOMIZER" == "" ]; then | |
cp -r "$source_path" "$dest_path" | |
else | |
cp -r "/path/to/mod/msg/$item_msgbnd" "$dest_path" | |
fi | |
DSMSPortable --fmgmerge -I "$dest_path/item.msgbnd.dcx" tmp/item/engUS -O "$dest_path" | |
fi | |
} | |
# Ensure tmp directory is present | |
mkdir -p tmp/item | |
# Extract item.msgbnd.dcx file | |
Yabber "$DSLR_MODPATH/msg/engus/item.msgbnd.dcx" | |
mv "$DSLR_MODPATH/msg/engus/item-msgbnd-dcx/GR/data/INTERROOT_win64/msg/engUS" tmp/item | |
rm -r "$DSLR_MODPATH/msg/engus/item-msgbnd-dcx" | |
# Copy and merge operations for different languages | |
copy_and_merge "/path/to/randomizer/msg/deude" "$DSLR_MODPATH/msg/deude" "deude" | |
copy_and_merge "/path/to/randomizer/msg/frafr" "$DSLR_MODPATH/msg/frafr" "frafr" | |
copy_and_merge "/path/to/randomizer/msg/itait" "$DSLR_MODPATH/msg/itait" "itait" | |
copy_and_merge "/path/to/randomizer/msg/jpnjp" "$DSLR_MODPATH/msg/jpnjp" "jpnjp" | |
copy_and_merge "/path/to/randomizer/msg/korkr" "$DSLR_MODPATH/msg/korkr" "korkr" | |
copy_and_merge "/path/to/randomizer/msg/polpl" "$DSLR_MODPATH/msg/polpl" "polpl" | |
copy_and_merge "/path/to/randomizer/msg/porbr" "$DSLR_MODPATH/msg/porbr" "porbr" | |
copy_and_merge "/path/to/randomizer/msg/rusru" "$DSLR_MODPATH/msg/rusru" "rusru" | |
copy_and_merge "/path/to/randomizer/msg/spaar" "$DSLR_MODPATH/msg/spaar" "spaar" | |
copy_and_merge "/path/to/randomizer/msg/spaes" "$DSLR_MODPATH/msg/spaes" "spaes" | |
copy_and_merge "/path/to/randomizer/msg/thath" "$DSLR_MODPATH/msg/thath" "thath" | |
copy_and_merge "/path/to/randomizer/msg/zhocn" "$DSLR_MODPATH/msg/zhocn" "zhocn" | |
copy_and_merge "/path/to/randomizer/msg/zhotw" "$DSLR_MODPATH/msg/zhotw" "zhotw" | |
# Clean up temporary files | |
rm -r tmp | |
# Move to the DSLR mod message directory and clean up | |
cd "$DSLR_MODPATH/msg" | |
rm -f *.prev | |
# Proceed to installation complete section | |
echo "Installation complete." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment