Jump to content
XCOMUFO & Xenocide

Attempt To Index Local `fh' (a Nil Value)


Kraplax

Recommended Posts

Hello

 

I'm trying to refresh the PKGBUILD for ArchLinux distro. I've already set up the dependencies and made a patch for makefile (it ignores the CFLAGS environment variable, thus, it's impossible to set -march=i686 to be able to build it - somehow it defaults to i386 wich gives an error during the build, so i've just replaced 'CFLAGS=...' with 'CFLAGS+=...').

The built package installed fine into /opt/ufo2000, linked it's binary to /usr/bin/ufo2000 and used the .desktop file for convenience (which adds a PNG icon and simply executes ufo2000).

But when i'm trying to run the game (no matter from what dir - my home, root, /opt/ufo2000 or any other) the result is always the same:

 

ufo2000

 

./init-scripts/main.lua:53: attempt to index local `fh' (a nil value)

stack traceback:

./init-scripts/main.lua:53: in main chunk

 

I've googled about this kind of error and it appeared that it might be because of relative paths used in Lua scripts, but i'm not sure of that.

 

So, how do we fix this? Any ideas?

Link to comment
Share on other sites

Argh..

Sorry for distracting your attention: it was my fault. I should've used search before posting this question. Anyways, solutions follows.

 

As my predecessor (previous packager of ufo2000) has warned - i should've added my user to the ufo2000 group that is created during game installation and relogin.

I've added the user with:

sudo gpasswd -a ufo2000 kraplax

where kraplax is naturally my username and should be substituted by any other username.

After that you'd better to actually relogin (or just reboot, to be 101% sure).

 

Now it runs fine. It lacks sound, but i guess it's really fixable with setting right keys during compilation.

I hope this post will help anyone after me who will use ufo2000 package on ArchLinux (maybe even me - who knows? :P).

Link to comment
Share on other sites

Argh..

Sorry for distracting your attention: it was my fault. I should've used search before posting this question. Anyways, solutions follows.

 

As my predecessor (previous packager of ufo2000) has warned - i should've added my user to the ufo2000 group that is created during game installation and relogin.

I've added the user with:

sudo gpasswd -a ufo2000 kraplax

where kraplax is naturally my username and should be substituted by any other username.

After that you'd better to actually relogin (or just reboot, to be 101% sure).

 

Now it runs fine. It lacks sound, but i guess it's really fixable with setting right keys during compilation.

I hope this post will help anyone after me who will use ufo2000 package on ArchLinux (maybe even me - who knows? :P).

 

About the sound, we broke support with the dumb library but do not have a replacement in yet. You can fix it by installing the old dumb library and calling :

 

make dumbogg=1

Link to comment
Share on other sites

About the sound, we broke support with the dumb library but do not have a replacement in yet. You can fix it by installing the old dumb library and calling :

make dumbogg=1

This is only related to background music. Normal sound effects (loaded from .wav files) should work fine, though we don't have many of them.

Link to comment
Share on other sites

Thanks for taking care of packaging ufo2000 for ArchLinux distro, we really appreciate this.

 

Argh..

Sorry for distracting your attention: it was my fault. I should've used search before posting this question. Anyways, solutions follows.

 

As my predecessor (previous packager of ufo2000) has warned - i should've added my user to the ufo2000 group that is created during game installation and relogin.

I've added the user with:

sudo gpasswd -a ufo2000 kraplax

where kraplax is naturally my username and should be substituted by any other username.

After that you'd better to actually relogin (or just reboot, to be 101% sure).

This is a bit weird. The game tries to create/modify some files in user's home directory (under '.ufo2000'), but fails. Overall, most of the data files from ufo2000 are read-only and are installed to a shared location in the system. But some of the files like configs, platoon settings and logs are supposed to be kept for each user separately.

 

Having to add a user to some group sounds like all the users share the personal configuration files.

Link to comment
Share on other sites

About the sound, we broke support with the dumb library but do not have a replacement in yet. You can fix it by installing the old dumb library and calling :

 

make dumbogg=1

Thanks, i'll make corresponding changes to the build script :)

 

This is only related to background music. Normal sound effects (loaded from .wav files) should work fine, though we don't have many of them.

Thanks for clarification - i already found out, that laser sounds work fine :D

For other sound - have you tried looking at freesound.org? There're lots of sounds with very convenient licences to be used in your game :)

Also consider visiting Partners in Rhyme, Free Play Music (for background music, maybe?) and SoundSnap. Also, Jamendo might be the source where to search a band, who'd be glad to share their music for free :)

 

Thanks for taking care of packaging ufo2000 for ArchLinux distro, we really appreciate this.

You're welcome :) Just keep up with your good work on the game and i'll try to keep the package up to date :)

 

This is a bit weird. The game tries to create/modify some files in user's home directory (under '.ufo2000'), but fails. Overall, most of the data files from ufo2000 are read-only and are installed to a shared location in the system. But some of the files like configs, platoon settings and logs are supposed to be kept for each user separately.

 

Having to add a user to some group sounds like all the users share the personal configuration files.

 

Yeah, since the 'make install' rule doesn't work in your makefile (or does it..? haven't tried it since 1086) the original packager made a custom buildscript, which installs ufo2000 to /opt. I guess that's the right place - the game itself is quite 'standalone'. But about saving user-specific changes to .ufo2000 - no, it doesn't save anything into that dir. In fact, it doesn't create that dir and i still don't have it. Thus, fresh-created test-squad.squad was written to /opt/ufo2000/. which isn't very cool, indeed.

 

And yeah, i've also tried to recompile the game on Windows - but failed. Not sure why, i've got quite messy devel environment (also experimenting with KDE on Windows). Well, i have no time to play now anyways - my exams are at their hottest point :/

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...