Project Zomboid

Project Zomboid

Responsive Zoom [Java]
10hana 7 Feb, 2024 @ 1:25am
macOS automated install script
@msmr Automated install for macOS should be *relatively* simple with a command script that you can copy/paste.

I haven't used macOS in a hot minute, so this is based on memory of the language and organization of files, but:

1. Subscribe to this mod to download the relevant files.

2. Open the Terminal App (use either Spotlight Search (command+spacebar), or look in the Utilities Folder under Applications and Click the icon)

____________________________________________________________

I know this looks long, there's a TL;DR at the bottom („• ᴗ •„)

This is just in case you want to know what's happening or need to manually troubleshoot a little
____________________________________________________________


(Apple's support website details this at
https://support.apple.com/guide/terminal/open-or-quit-terminal-apd5265185d-f365-44cb-8b09-71a064a42125/mac

https://support.apple.com/guide/terminal/execute-commands-and-run-tools-apdb66b5242-0d18-49fc-9c47-a2498b7c91d5/mac
)

The Terminal App will allow you to copy/paste in the following commands to automate the install.

You might get a pop-up asking if it's okay for the Terminal App to modify the file system, since most Mac users don't interface with the OS via code, so it would probably detect unusual behavior (which is a good thing most of the time).

To test this, type:

echo "Hi there" > ~/Desktop/Look-at-this-text-file

then press the ENTER or RETURN key (these are the same thing) to run the command.
This command will write "Hi there" inside a new text file on your Desktop called:
"Look-at-this-text-file"

If you do get a pop-up here about permission for Terminal to work on files, go ahead and OK it.
That should allow the rest of the Terminal commands to automate the install.

________________________________________

I'm going to explain some details in case you're curious, or have some issues and want to try and fix it yourself.

Otherwise, you can scroll down to the big
####################
TL;DR
####################
part below to copy/paste the commands into the Terminal if you're comfortable.
________________________________________


Details:

ASSUMING the game and mod files are located under the folder location:

~/Library/Application\ Support/Steam/steamapps/common/ProjectZomboid/projectzomboid/zombie

- The tail/tilde sign '~' gets automatically converted to your user's/account's home folder
- The forward slash signs '/' followed by a name, such as "~/Library", means the Library folder in your home folder, "~/Library/Application\ Support" means the Application Support folder, inside the Library folder, inside your user's home folder (represented in the terminal as '~' tilde sign, etc.

This would mean that if you look in your home folder, then the Library sub-folder, the Library folder's "Application Support" sub-folder, all the way down to

steamapps/common/ProjectZomboid/projectzomboid

you should find a folder called 'zombie'.

This is where the mod files WILL go (NOT where they initially get downloaded to)

The mod files should initially get downloaded to a slightly different file path (a location), probably:

~/Library/Application\ Support/Steam/steamapps/workshop/content/108600/2919952739/mods/ResponsiveZoom/zombie

The only real unknown here is the first part of both file locations, called file pathways, or paths.
The

~/Library/Application\ Support/Steam

part. If that part is correct, then the rest of the commands listed herein should "just work."

We'll store that part of the file paths in a variable preceding all the other commands, so IF that's the wrong location, all you have to do is replace the text:

FIRST_PART_OF_FILE_PATH="~/Library/Application Support/Steam"

with

FIRST_PART_OF_FILE_PATH="whatever the actual first part is"

and re-copy/paste and run the commands.

Now on to the actual commands, finally (⌒_⌒;)


####################
TL;DR
####################

3. Copy/paste the following block of commands below into the Terminal and press the ENTER or RETURN key to execute them.



FIRST_PART_OF_FILE_PATH="~/Library/Application Support/Steam"

echo "- Initiating macOS automated install for ResponsiveZoom."
echo "- Assuming Project Zomboid game files are located at:"
GAME_zombie_folder="${FIRST_PART_OF_FILE_PATH}/steamapps/common/ProjectZomboid/projectzomboid/zombie"
echo " ${GAME_zombie_folder}"
echo "- Verifying ..."
if ! [ -d "${GAME_zombie_folder}" ] # if folder DOESN'T exist
then
echo " False. ProjectZomboid game's 'zombie' folder is not at the specified location."
echo " Find the game's 'zombie' folder location and update the GAME_zombie_folder variable before re-running these commands."
echo "- Aborting."
exit 1
fi
echo " True."
echo "- Assuming ResponsiveZoom mod files are located at:"
MOD_zombie_folder="${FIRST_PART_OF_FILE_PATH}/steamapps/workshop/content/108600/2919952739/mods/ResponsiveZoom/zombie"
echo " ${MOD_zombie_folder}"
echo "- Verifying ..."
if ! [ -d "${MOD_zombie_folder}" # if folder DOESN'T exist
then
echo " False. ResponsiveZoom mod's 'zombie' folder is not at the specified location."
echo " Find the mod's 'zombie' folder location and update the MOOD_zombie_folder variable before re-running these commands."
echo "- Aborting."
exit 2
fi
# At this point in the code, both folders have been verified to exist,
# so we just need to backup the original files
# We'll just add the suffix '.bup' to the original file names,
# then copy the modded java '.class' files over to where the original files were.
echo "- Backing up original game files by suffixing file names with '.bup' ..."
cp \
"${GAME_zombie_folder}/core/textures/MultiTextureFBO2.class" \
"${GAME_zombie_folder}/core/textures/MultiTextureFBO2.class.bup"
cp \
"${GAME_zombie_folder}/iso/PlayerCamera.class" \
"${GAME_zombie_folder}/iso/PlayerCamera.class.bup"
echo "- Backup completed."
echo "- Copying ResponsiveZoom '.class' mod files to original game file locations ..."
cp \
"${MOD_zombie_folder}/core/textures/MultiTextureFBO2.class" \
"${GAME_zombie_folder}/core/textures/MultiTextureFBO2.class"
cp \
"${MOD_zombie_folder}/iso/PlayerCamera.class" \
"${GAME_zombie_folder}/iso/PlayerCamera.class"
echo "- Copy completed. ResponsiveZoom Mod installed."
echo "- You can close this window or quit the Terminal application now."