Page 1 of 1

Grimrock 2 editor: Button disableSelf has no function!

Posted: Mon Mar 14, 2016 3:17 am
by Illidan
I don't know if it is a bug but it is very anoying for me that activating the checkbox "disableSelf" for buttons in Grimrock 2 editor does not work/has no effect.
Example: Take a lever and a door, activte the checkbox "disableSelf" of the lever-component and it works, it opens or closes the door and after that it has itself deactivted and no function anymore.
But, when you do the same with any button, activating the checkbox "disableSelf" has no effect. The button never deactivates itself.
Is this a bug or do I miss something? I really would like to have this function enabled for buttons because I need it for my custom dungeon.

Re: Grimrock 2 editor: Button disableSelf has no function!

Posted: Mon Mar 14, 2016 5:03 am
by minmay
You're right, it doesn't work. Fortunately, this is very easy to fix. Just define all your buttons with this onActivate hook:

Code: Select all

defineObject{
	name = "wall_button",
	baseObject = "wall_button",
	components = {
		{
			class = "Button",
			sound = "button",
			onActivate = function(self)
				return self:isEnabled()
			end,
		},
	}
}
Then disableSelf will have the desired effect.

Re: Grimrock 2 editor: Button disableSelf has no function!

Posted: Mon Mar 14, 2016 2:06 pm
by Illidan
Great, works like a charm!
Thank you for the help and fast reply! :)