Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Game crashes after death #309

Closed
themightyglider opened this issue Dec 28, 2017 · 11 comments
Closed

Game crashes after death #309

themightyglider opened this issue Dec 28, 2017 · 11 comments

Comments

@themightyglider
Copy link

I got the source code from the games website and compiled/installed it on my GNU/Linux system like described in INSTALL.
The game runs fine but if I die it crashes and throws this error message:

Can't open /usr/local/var/ivan/ivan-highscore.scores for output!

I checked the path on my system but it does not exist.

@Larzid
Copy link

Larzid commented Dec 28, 2017

That is because the game does not have privileges to create the directory.

Try this on the terminal:
$ sudo mkdir -p /usr/local/var/ivan
$ sudo chmod 766 /usr/local/var/ivan

@themightyglider
Copy link
Author

Thank you very much for the quick help!

I expected the game to run properly if I follow the instructions. If this steps are necessary they should be mentioned in INSTALL.

@Larzid
Copy link

Larzid commented Dec 28, 2017

I believe that it should be done by the make install script. I haven't learned how those work yet, else I would have already made a pull request.

@themightyglider
Copy link
Author

The two commands you mentioned above only solved the problem if I run IVAN with root privileges ($ sudo ivan). You also need to give your user account write access to

/usr/local/var/ivan/ivan-highscore.scores

@emlai
Copy link
Contributor

emlai commented Dec 29, 2017

Thanks for reporting. Definitely a bug in how the game is being installed by CMake.

I believe this should be fixed by specifying the appropriate permissions in this CMake install command:

install(DIRECTORY Graphics Script Music DESTINATION "${CMAKE_INSTALL_DATADIR}/ivan")

Can you test if adding something along the lines of DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE WORLD_READ WORLD_WRITE to the arguments of install and doing a fresh install fixes the issue for you?

@Larzid
Copy link

Larzid commented Dec 29, 2017

Hello emlai.

I tried adding the line as you suggest, but I get an error when I run cmake

This is how I edited the line:
install(DIRECTORY Graphics Script Music DESTINATION "${CMAKE_INSTALL_DATADIR}/ivan" PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE WORLD_READ WORLD_WRITE)

and this is the error I get:
CMake Error at CMakeLists.txt:12 (install):
install DIRECTORY does not allow "PERMISSIONS" before a PATTERN or REGEX is
given.

@Larzid
Copy link

Larzid commented Dec 29, 2017

themightyglider:

try:
$ sudo chmod -R 776 /usr/local/var/ivan
$ sudo groupadd -f games
$ sudo chgrp -R games /usr/local/var/ivan
$ sudo usermod -a -G games your-username

as a last resort you could try:
$ sudo chmod 777 /usr/local/var/ivan
however many people will warn you against this last command since it gives read write and execute rights to everybody.

@emlai
Copy link
Contributor

emlai commented Dec 29, 2017

@Larzid It should be DIRECTORY_PERMISSIONS instead of just PERMISSIONS for install(DIRECTORY ...).

@Larzid
Copy link

Larzid commented Dec 30, 2017

I corrected the line to:
install(DIRECTORY Graphics Script Music DESTINATION "${CMAKE_INSTALL_DATADIR}/ivan" DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE WORLD_READ WORLD_WRITE)

but now the game won't run:
$ /usr/local/bin/ivan
File /usr/local/share/ivan/Script/define.dat not found!

@jakwings
Copy link
Member

jakwings commented Nov 4, 2018

#490 could be a solution for this issue.

@jakwings
Copy link
Member

After #496, the bone files and highscore file are stored in ~/.ivan too, but you need to manually move the old files from /usr/local/var/ivan/ into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants