Jump to content
  • 0

[Fix] ../projectzomboid error


snipertyler

Question

I figured out how to run pz in the latest steam release for Linux 64bit using Mint 15, I posted my instructions below.

I'm not sure of the version, but in the bottom right I see '17 (0014)'

_____________________________

In the latest steam release, pz for linux does not boot. I ran my lwjgl command but there was still no result.

 

I ran the program directly in terminal and got this:

./projectzomboid.sh: line 11: cd: ../projectzomboid: No such file or directoryError: Could not find or load main class zombie.gameStates.MainScreenState

Now, the first error has occurred in the past and didn't affect the game.

However, it does now, so we need to fix it.

 

I don't know if you recognize this though, but .. is a way of saying in bash (linux) to go down one directory.

For example, at ~/Music/indie if you ran cd ../rock you would go from ~/Music/indie --> ~/Music --> ~/Music/rock

Relating to our script, doing the exact opposite of what our developers want!   :)

 

So how to fix?

Edit the file projectzomboid.sh at ~/.local/share/Steam/SteamApps/common/ProjectZomboid

 

In the line that contains this (INSTDIR one):

GAMEDIR="${HOME}/.project_zomboid_2.9.9.17"LOGFILE="${GAMEDIR}/${SCRIPT}.log"--> INSTDIR="`dirname $0`"./projectzomboid ; cd "${INSTDIR}" ; INSTDIR="`pwd`"

Delete the last line and add this:

cd `dirname $0`if [ ! -d projectzomboid ];    then INSTDIR=`pwd`    else INSTDIR="$(cd "projectzomboid"; pwd)"; cd $INSTDIRfi

so that it looks like this:

SCRIPT="`basename $0`"GAMEDIR="${HOME}/.project_zomboid_2.9.9.17"LOGFILE="${GAMEDIR}/${SCRIPT}.log"cd `dirname $0`if [ ! -d projectzomboid ];    then INSTDIR=`pwd`    else INSTDIR="$(cd "projectzomboid"; pwd)"; cd $INSTDIRfi[[ ! -d "${GAMEDIR}" ]] && mkdir -m 0755 "${GAMEDIR}"JARPATH=".:lwjgl.jar:lwjgl_util.jar:jinput.jar"

If you're wondering why do a if test, you can do the same thing in the projectzomboid.sh file inside ProjectZomboid/projectzomboid/ and won't screw up the script (as the orginal code did)

Might be helpful to dev's...

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

EDIT : following into spoiler turned out to be offtopic, see http://theindiestone.com/forums/index.php/topic/1151-craft-helper-111/page-2#entry45211 if you ever land here for the same reason as me


Thanks for the trick... even if the game still crashess later on  :)
I'm on Kubuntu 32bit.
 
When i don't touch anything i get the error you reported :

projectzomboid.sh: 12: cd: can't cd to ../projectzomboid
projectzomboid.sh: 21: projectzomboid.sh: [[: not found
Error: Could not find or load main class zombie.gameStates.MainScreenState

 
Now when i use snipertyler's modified script :

*GAMEDIR points at ~/.project_zomboid_2.9.9.17, only the log file is in there*
*goes through the else of the if statement (dir exists)*
*INSTDIR has the correct value, ie points at the root dir of the game ~/../ProjectZomboid/projectzomboid*
java.lang.NullPointerException
at zombie.ZomboidFileSystem.searchForModInfo(ZomboidFileSystem.java:103)
at zombie.ZomboidFileSystem.searchForModInfo(ZomboidFileSystem.java:86)
at zombie.ZomboidFileSystem.searchForModInfo(ZomboidFileSystem.java:86)
at zombie.gameStates.ChooseGameInfo.getModDetails(ChooseGameInfo.java:56)
at zombie.gameStates.ChooseGameInfo.getModDetails(ChooseGameInfo.java:42)
at zombie.ZomboidFileSystem.loadMods(ZomboidFileSystem.java:150)
at zombie.GameWindow.maina(GameWindow.java:904)
at zombie.gameStates.MainScreenState.main(MainScreenState.java:112)
AL lib: (EE) alc_cleanup: 1 device not closed

 
I had a look at the source code and as far as i can tell it has something to do with paths when the nullpointerexception is raised :

  public String searchForModInfo(File path, String modSearched)  {    if (path.isDirectory())    {      String[] internalNames = path.list();      for (int i = 0; i < internalNames.length; ++i)      {        String result = searchForModInfo(new File(path.getAbsolutePath() + File.separator + internalNames[i]), modSearched);        if (result != null) {          return result;        }      }    }    else if (path.getAbsolutePath().contains("mod.info"))    {      ChooseGameInfo storySelec = new ChooseGameInfo();      ChooseGameInfo tmp108_107 = storySelec; tmp108_107.getClass(); ChooseGameInfo.Mod s = new ChooseGameInfo.Mod(tmp108_107, modSearched);      try {        storySelec.getModDetails(s, path.getAbsolutePath().substring(0, path.getAbsolutePath().lastIndexOf(File.separator)), true);      } catch (FileNotFoundException ex) {        Logger.getLogger(ChooseGameInfo.class.getName()).log(Level.SEVERE, null, ex);      }      if (s.getId().equals(modSearched))      {        this.modDirList.put(modSearched, path.getAbsolutePath().substring(0, path.getAbsolutePath().lastIndexOf(File.separator)));        return path.getAbsolutePath().substring(0, path.getAbsolutePath().lastIndexOf(File.separator));      }    }    return null;  } 



On the other hand INSTDIR and GAMEDIR variables seem to be correctly initialized, so i'm a bit at a loss, especially since it's working at least on one 64bit machine.

Link to comment
Share on other sites

I don't know how to fix the null point exception, but this error:

projectzomboid.sh: 21: projectzomboid.sh: [[: not found

can be fixed by replacing (in projectzomboid.sh)

[[ ! -d "${GAMEDIR}" ]] && mkdir -m 0755 "${GAMEDIR}"

with

if [ ! -d "${GAMEDIR}" ]; then mkdir -m 0755 "${GAMEDIR}"; fi

The 1st one isn't as posix as the second.

 

You can test this (if it doesn't occur to you) by running 'sh projectzomboid.sh' versus 'bash projectzomboid.sh'

Link to comment
Share on other sites

I don't know how to fix the null point exception, but this error:

No worries, it was just to report the error, though it appears i should have created a ticket and not polluted your thread with it, my apologies  :oops:

EDIT : for the record the NullPointerException came from a mod.info file not having an id field as said here :

http://theindiestone.com/forums/index.php/topic/1151-craft-helper-111/?p=45211 (so nothing to do with paths and even less with this current thread)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...