Dungeon Editor locked up

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
User avatar
Halluinoid
Posts: 165
Joined: Tue Apr 02, 2013 7:08 pm
Contact:

Dungeon Editor locked up

Post by Halluinoid »

my dungeon in LOG2 has now come to a halt, all of a sudden when I press play in Dungeon Editor I get
assets/scripts/objects/base.lua:0: attempt to compare number with nil
now what? I can't even go back to a previous save of my dungeon because there's only one save, the editor is just locked :shock:

I can still change things in the Dungeon levels but it won't play the Dungeon I created - it just brings in that error message every time I try and press play

I have removed the last few changes but this has made no difference, can anybody help?
User avatar
Eleven Warrior
Posts: 745
Joined: Thu Apr 18, 2013 2:32 pm
Location: Australia

Re: Dungeon Editor locked up

Post by Eleven Warrior »

In your lua files have you written a symbol eg: sx_door)_1 I did this and got the same problem as you did the ) should not be in the name. It gave me the same message you had.
minmay
Posts: 2780
Joined: Mon Sep 23, 2013 2:24 am

Re: Dungeon Editor locked up

Post by minmay »

I believe putting certain characters in an entity ID can also cause this.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
MrChoke
Posts: 324
Joined: Sat Oct 25, 2014 7:20 pm

Re: Dungeon Editor locked up

Post by MrChoke »

I have not had this particular problem but I have had MANY weird ones that kill your dungeon until you hunt it down. The game has very poor support for debugging. Basically you need to comment out code until it starts working again, focusing on the most suspect areas first (recent changes probably). Another good thing is adding print() statements to the code. The console will print them until it blows up. However, the console only shows maybe 30 lines worth of text. That is another big pain. And of course I think in your case, you may not even get the chance to see the console before it closes the window.

Since this is blowing up in the main-game base defineObject code, maybe start by commenting out any custom LUA files you added in init.lua? That is my best suggestion.
User avatar
Halluinoid
Posts: 165
Joined: Tue Apr 02, 2013 7:08 pm
Contact:

Re: Dungeon Editor locked up

Post by Halluinoid »

I haven't done any lua files, I haven't done any coding

I have simply used the dungeon editor with the inbuilt commands and assets and then suddenly this. Mr Choke - " custom LUA files you added in init.lua? " I never added any

I have 10 levels of dungeon and then this error

I have no previous save so what do I do now?
Batty
Posts: 509
Joined: Sun Apr 15, 2012 7:04 pm

Re: Dungeon Editor locked up

Post by Batty »

If it is a bad character in an ID then press CTRL-F and you can examine all the entity IDs.

Other than that, start removing entities one-by-one starting with the last one you placed, i.e. slowly undo the latest changes you made until preview works.
minmay
Posts: 2780
Joined: Mon Sep 23, 2013 2:24 am

Re: Dungeon Editor locked up

Post by minmay »

MrChoke wrote:I have not had this particular problem but I have had MANY weird ones that kill your dungeon until you hunt it down. The game has very poor support for debugging.
If you run the game from the command prompt, you'll see it prints all kinds of useful debugging information, including any Lua error encountered.

Halluinoid, if you send me your dungeon.lua, I can take a look at it.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
User avatar
Halluinoid
Posts: 165
Joined: Tue Apr 02, 2013 7:08 pm
Contact:

Re: Dungeon Editor locked up

Post by Halluinoid »

thanks to all above for your support, it is solved :mrgreen:
Batty wrote:If it is a bad character in an ID then press CTRL-F and you can examine all the entity IDs.

Other than that, start removing entities one-by-one starting with the last one you placed, i.e. slowly undo the latest changes you made until preview works.
I looked at the .dat in notepad and it was huge, went on page after page, I couldn't see any mistake

so I realised it must be to do with a recent change, it turned out I had done a whole load of changes and just not hit PLAY so it was tripping on a change I made about 10 changes back

I saw a torch holder that was on remove was opening a nearby door, fine, that always worked long ago

I realised that a new approach route to the hidden area could result in the player coming up against a locked hidden door, so I added a new command to that torch holder

I added a connection make the torch holder open a hidden door many levels away but I FORGOT to change the drop down to Remove, so it showed INSERT

it was THIS that was causing that error

I simply changed the 2nd command to onRemove nad it played fine, no error

THANK YOU TO ALL ABOVE FOR YOUR SUPPORT :twisted: I AM BACK IN THE GAME!!
User avatar
JohnWordsworth
Posts: 1397
Joined: Fri Sep 14, 2012 4:19 pm
Location: Devon, United Kingdom
Contact:

Re: Dungeon Editor locked up

Post by JohnWordsworth »

That's good to know minmay! When I was in the thick of GrimTK I had a few crashes. Wish I was running from a prompt to see if there was any useful feedback! Ahh well, will do so in the future when working with the GUI just incase (although, the GUI context seems a lot less fragile in LoG2 than it was in LoG1).

Glad your issue got solved Halluinoid!
My Grimrock Projects Page with links to the Grimrock Model Toolkit, GrimFBX, Atlas Toolkit, QuickBar, NoteBook and the Oriental Weapons Pack.
MrChoke
Posts: 324
Joined: Sat Oct 25, 2014 7:20 pm

Re: Dungeon Editor locked up

Post by MrChoke »

minmay wrote:
MrChoke wrote:I have not had this particular problem but I have had MANY weird ones that kill your dungeon until you hunt it down. The game has very poor support for debugging.
If you run the game from the command prompt, you'll see it prints all kinds of useful debugging information, including any Lua error encountered.

Halluinoid, if you send me your dungeon.lua, I can take a look at it.
Are you serious???? It prints messages to the command prompt? If that is the case I cannot tell you how many hours that would have saved me to know. It will save tons more now. Thanks!
Post Reply