User levels not writable (3.1.1)

Found a bug in R'n'D? Report it here!

Moderators: Flumminator, Zomis

Post Reply
Guest

User levels not writable (3.1.1)

Post by Guest »

I downloaded the src package for R'n'D 3.1.1, compiled and tried to make a level. The game complained that my levels were read only. I played with the files in ~/.rocksndiamonds/levels/username but that didn't help. The README made a vague reference to setting the levelinfo.conf to writable but none of the configurations i tried worked ("writable: on", etc.). Eventually I took a look at the source and got it to work. In the file src/libgame/setup.c on line 1684 I changed

Code: Select all

    ldi->readonly = TRUE;
to

Code: Select all

    ldi->readonly = FALSE;
. This seems to work - my levels are now writable but the built in levels are still read only. Thanks

Chris Guirl
thelusiv hat gmail got com
User avatar
bojster
Posts: 458
Joined: Fri Jun 18, 2004 7:42 pm
Location: Poland
Contact:

Re: User levels not writable (3.1.1)

Post by bojster »

Anonymous wrote:my levels are now writable but the built in levels are still read only.
And that's the way it should be. To change it, insert "readonly: false" in levelinfo.conf for a levelset you want to edit (the same would work for your own levelset, if it wasn't set like that; editing the program source is not necessary).
User avatar
Holger
Site Admin
Posts: 4081
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Post by Holger »

Chris, welcome to the forum!

Thanks a lot for reporting this major bug -- it was already reported here and there, but for some strange reason I wasn't able to reproduce it until now (although it's only needed to remove/rename the R'n'D user data directory and have it re-created at next start of R'n'D -- with the newly created private level set being read-only :-o ).

Although your patch works (sort of), it's not the best solution, as it leaves some non-private level sets being writable. As bojster wrote, explicitly adding a line "readonly: false" to the "levelinfo.conf" file of those sets which are to be edited is also a possibly solution, although requiring manual interaction.

I have traced this bug down and fixed it now, leaving only those level sets writable by default which have the same directory name as the player's login name, the same "name" field as the player's login name or the same "author" field as the player's real name. This way it's easy to just copy the default private level set or only the default private "levelinfo.conf" to create a new, writable private level set directory (unless you change both the "name" and "author" lines).

Thanks again for reporting this very nasty bug (which in fact should be classified as a "show-stopper" bug, because of making it impossible for the "normal" R'n'D user to create own levels at all)!

The bugfix will find its way into the next bugfix release 3.1.2, which should be released very soon.
Guest

Post by Guest »

Great! Glad to help, I know what it's like to work on an open source game, and I know bug reports are never frequent or specific enough...anyway, yes, my method was a hack, but it worked. To be honest I don't play this game much but I keep it around for my son, who <b>loves</b> creating and playing his own levels...and I couldn't bear to watch him make them and not save. Thanks for fixing it! I'll grab the new version when it's released.

Chris G
Guest

Post by Guest »

Oh, another note: when I was trying to fix this problem I first went to the web site, read the documentation, and looked at the level files I found. In the documentation it mentions that levels can be set as readonly or not, but it does not tell how to do this. If I had this information to begin with I wouldn't have even looked at the source code, I went there to figure out how it worked and just happened to start poking around and figured out an alternate way to fix it. It wouldn't hurt for the project to provide a little documentation on the formats you use, the different options available in them, and some examples. Thanks!

Chris
User avatar
Holger
Site Admin
Posts: 4081
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Post by Holger »

Yes, you're perfectly right -- missing documentation is one of the bigger problems of R'n'D... :-(

At the current state of complexity of R'n'D, it really would need some better introductions, tutorials, HOWTOs, technical documentation and all that...
Post Reply