Skip to content

Instantly share code, notes, and snippets.

@RunningDroid
Last active December 17, 2015 23:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RunningDroid/5689196 to your computer and use it in GitHub Desktop.
Save RunningDroid/5689196 to your computer and use it in GitHub Desktop.
A script to fix the current issues preventing Project Zomboid from working on Linux, with the option to alter the projectzomboid.sh
#!/bin/sh
#
# Written for Project Zomboid Version RC2.9 0008b
#
# this script assumes that it's being run from the directory that projectzomboid.sh is in
#
# usage:
# pz-linux-fix.sh [options]
#
# --optional:
# also change things in the projectzomboid.sh
#
# --optional-only:
# *only* change things in the projectzomboid.sh
if [ "$1" = '--optional' ] || [ "$1" = '--optional-only' ]
then
# make sure we get projectzomboid.log instead of projectzomboid.sh.log
sed -i 's/^SCRIPT="`basename $0`"/SCRIPT="`basename $0 .sh`"/' projectzomboid.sh
# fix something that's probably a typo
sed -i 's/^XMODIFIERS= java \\/XMODIFIERS=\njava \\/' projectzomboid.sh
# make the script return an error if java returns an error
sed -i -e 's/^java \\/exec java \\/' -e '/^exit 0/d' projectzomboid.sh
# make sure things printed on stderr are sent to the log as well
sed -i 's/^ >"${LOGFILE}"/ >"${LOGFILE}" 2>\&1/' projectzomboid.sh
if [ "$1" = "--optional-only" ]
then
exit 0
fi
fi
# information comes from http://www.theindiestone.com/community/viewtopic.php?f=22&t=14381
mv media/sound/ambientOutsideDaybirds.ogg media/sound/ambientOutsideDayBirds.ogg
mv media/sound/Bathit.ogg media/sound/bathit.ogg
mv media/sound/batswing.ogg media/sound/batSwing.ogg
# this should work unless you aren't using gnu or bsd sed
#sed -i '1s/^/prepend\n/' file
sed -i '6s|^|require "ISUI/ISScrollingListBox"\n|' media/lua/OptionScreens/MainOptions.lua
sed -i '6s|^|require "BuildingObjects/ISBuildingObject"\n|' media/lua/Camping/BuildingObjects/*
sed -i '5s|^|require "BuildingObjects/ISBuildingObject"\n|' media/lua/Farming/BuildingObjects/*
sed -i '1s|^|require "Reloading/ISReloadableMagazine"\nrequire "Reloading/ISSemiAutoWeapon"\nrequire "Reloading/ISShotgunWeapon"\n|' media/lua/Reloading/ISReloadUtil.lua
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment