Bug: overriding the cube crashes the editor

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
User avatar
Billick
Posts: 201
Joined: Thu Apr 19, 2012 9:28 pm

Bug: overriding the cube crashes the editor

Post by Billick »

I was playing around with trying to make a "not invincible" version of the cube, so I added the following code to my monster.lua.

Code: Select all

cloneObject {
	name = "weak_cube",
	baseObject = "cube",
	health = 30,
	exp = 100,
	attackPower = 5,
	onDamage = function(monster, damage)
		return true
	end,
}
When I added my cloned cube to my map, the editor crashed when I started the preview. I'm not sure, this might be an invalid thing to try to do. If it is, the editor should probably display an error instead of crashing. The cube is a neat model though, and I'd like to have it in my mod without it being an unstoppable killing machine.
Halls of Barrian - current version 1.0.3 - Steam Nexus
Me Grimrock no bozo!
User avatar
Montis
Posts: 340
Joined: Sun Apr 15, 2012 1:25 am
Location: Grimrock II 2nd playthrough (hard/oldschool)

Re: Bug: overriding the cube crashes the editor

Post by Montis »

There's no such thing as a weak cube! :twisted:

Seriously though, I think what's wrong here is that "return true" doesn't work here.
Can you try the following (I'm unable to test at the moment):

Code: Select all

onDamage = false
With that you should be able to "reset" all previously written statements in the onDamage hook.
If that doesn't work you can also try:

Code: Select all

onDamage = function()
end
When destiny calls, the chosen have no choice.

My completed dungeon (LoG1): Hypercube
User avatar
Billick
Posts: 201
Joined: Thu Apr 19, 2012 9:28 pm

Re: Bug: overriding the cube crashes the editor

Post by Billick »

Montis wrote:There's no such thing as a weak cube! :twisted:

Seriously though, I think what's wrong here is that "return true" doesn't work here.
Can you try the following (I'm unable to test at the moment):

Code: Select all

onDamage = false
With that you should be able to "reset" all previously written statements in the onDamage hook.
If that doesn't work you can also try:

Code: Select all

onDamage = function()
end
I commented everything else out except for the first two lines, just to see if my function was messed up, and it still crashed the editor. I wasn't planning on having my cube be that weak, I was just using low numbers for testing so that I could get it working, but I haven't gotten past that point yet. :lol:
Halls of Barrian - current version 1.0.3 - Steam Nexus
Me Grimrock no bozo!
User avatar
Montis
Posts: 340
Joined: Sun Apr 15, 2012 1:25 am
Location: Grimrock II 2nd playthrough (hard/oldschool)

Re: Bug: overriding the cube crashes the editor

Post by Montis »

Ok I tried it as well: When just cloning the cube with another name, it will crash the editor good. I even have to restart steam because that thinks that LoG is still running for some reason.
When destiny calls, the chosen have no choice.

My completed dungeon (LoG1): Hypercube
Post Reply