Page 1 of 2
Help! My dungeon won't load!
Posted: Sun Nov 11, 2012 10:25 pm
by SharinaDarkstar
I've been working on this huge 24 level dungeon for weeks, and today have spent the entire day designing a new level.
Just now, I pressed the play button in the editor to test my latest changes and a message immediately appeared saying "Software failure - attempt to index a nil value" and the editor crashed.
Now, I can't load my dungeon. Every time I try to do so in the editor, it says something like "map.lua: 0 attempt to index a nil value" and won't load.
What do I do?

Re: Help! My dungeon won't load!
Posted: Sun Nov 11, 2012 10:33 pm
by Neikun
Something like that happened to me today when I changed a part of the physical model of an ogre. I figured the animations didn't like that. Did you change the model of anything that animates?
Re: Help! My dungeon won't load!
Posted: Sun Nov 11, 2012 10:35 pm
by msyblade
When u built the most recent level, did you make changes to your external scripts? Like items.lua/objects.lua/materials.lua? If so, delete the changes, save the file and rerun the dungeon. This problem is (Hopefully!) the result of a small error in an external script, but the offending object is placed in the dungeon so the dungeon cannot load. The problem is that any objects you have placed already, must be defined perfectly to load the dungeon, so think hard about any small changes you made to a scripted object you have already placed in your dungeon.
Re: Help! My dungeon won't load!
Posted: Sun Nov 11, 2012 10:42 pm
by SharinaDarkstar
Unfortunately, I haven't made any changes to scripts or anthing else outside the editor all day. The only thing I did between the dungeon running and it failing to load was place some standard doors on the map in the editor.
I guess that, because the editor crashed when pressing play, it has trashed my dungeon - although I don't know why it would've been saving while pressing play. Perhaps it trashed the dungeon the last time I pressed save?
Luckily, I had the foresight to backup the entire dungeon folder this morning before I started on the new level - and although it's taken all day to create the new level I do, of course, now know what I did and how may lua script entities were working so it shouldn't take another day to redo it.
Where does the editor save the on map lua script entities for the dungeon? Perhaps there's an error in the map script entities that stops it loading, and if I could find the lua file that contains in map entities, I could edit it?
Re: Help! My dungeon won't load!
Posted: Sun Nov 11, 2012 10:48 pm
by Brodie301
If I'm not mistaken its the dungeon.lua in scripts. If you post a pic of crash screen I'm sure someone can give a better answer.
Re: Help! My dungeon won't load!
Posted: Sun Nov 11, 2012 11:03 pm
by msyblade
I am SO glad to hear you had it backed up. That is such a relief. I would be pained to hear the tale of the modder that lost a 24 floor dungeon. Would lose a little part of my soul.
Re: Help! My dungeon won't load!
Posted: Sun Nov 11, 2012 11:26 pm
by SharinaDarkstar
Thank you - I'm looking forward to releasing it, although you're likely to get a preview with a few levels to start with as there are lots of multilevel puzzles which would simply confuse without all the levels done.
The dungeon is designed to feel like a true sequel to Grimrock and begins with the party waking up in prison with no knowledge of how they got there. You MUST import a fully rounded party from Grimrock and the party should be level 14ish ideally with access to high level fireball spells. This is because the first level is all about escaping from the prison and literally the only weapons available are spears you salvage from fallen skeletons - so nothing substantial. The creatures are designed for high level players so without fireballs and other high level spells you're not getting much further than your cell...
On the other hand, by the time you've completed 24 levels of intriguing puzzles and battles, you're going to have one hell of a party. In playtesting, it took me several hours to get out of level 1 and I designed the thing - you're going to have to think on your feet.
I'm using all of Daniv's wallsets and much more besides. Anyway, back to work

Re: Help! My dungeon won't load!
Posted: Sun Nov 11, 2012 11:47 pm
by SharinaDarkstar
Lucky I'm a programmer
Once I knew where to look, I delved into the code in duneon.lua and cut and paste all the stuff from the new level to the backup and now I have my days work back. Fascinated to discover that the entire dungeon is just a load of lua code in dungeon.lua
Re: Help! My dungeon won't load!
Posted: Mon Nov 12, 2012 12:06 am
by JKos
I recommend version control tool for everyone who does some serious modding. Mercurial is free and really easy to use and it has saved my day couple of times.
TortoiseHg is a gui for mercurial.
http://tortoisehg.bitbucket.org/
Just install it and right click your mods directory -> select TortoiseHg -> Create repository here -> create
then right click the directory again and select Hg commit -> select all files, enter some commit message and press ok.
Next time you edit your dungeon just do a commit again and Mercurial will keep track of your changes. It can show you all differences between versions and you can go back to any version any time.
And I also recommend to use DropBox or Google drive for external backups and source distribution.
Re: Help! My dungeon won't load!
Posted: Mon Nov 12, 2012 12:16 am
by SharinaDarkstar
Time Machine would do that automatically on my iMac if I didn't have to boot it into Windoze to edit my dungeons
