Open door from secret button

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!
Post Reply
mpuppetier
Posts: 16
Joined: Tue Sep 02, 2014 11:20 am

Open door from secret button

Post by mpuppetier »

Hi guys,
i have a problem with secret button.

lua script

Code: Select all

function openDoor()
	dungeon_wall_grating_1:open()
end
on secret button i call that function with a connector but i got an error:
attempt to call method 'open' ( a nil value )

So, how can i refer to that door from a secret button??
User avatar
JohnWordsworth
Posts: 1397
Joined: Fri Sep 14, 2012 4:19 pm
Location: Devon, United Kingdom
Contact:

Re: Open door from secret button

Post by JohnWordsworth »

In LOG2, each "game object" now has all of it's properties put into separate components. As such, you have to first access the door component and open that...

Code: Select all

function openDoor()
  dungeon_wall_grating_1.door:open();
end
(A tiny bit of guessing going on here, because I don't know 100% that this works and I'm not at home to test, but I believe it should work!).
My Grimrock Projects Page with links to the Grimrock Model Toolkit, GrimFBX, Atlas Toolkit, QuickBar, NoteBook and the Oriental Weapons Pack.
mpuppetier
Posts: 16
Joined: Tue Sep 02, 2014 11:20 am

Re: Open door from secret button

Post by mpuppetier »

Thank you !!! It works.
Is there a way to find all object property?
NutJob
Posts: 426
Joined: Sun Oct 19, 2014 6:35 pm

Re: Open door from secret button

Post by NutJob »

mpuppetier wrote:Thank you !!! It works.
Is there a way to find all object property?

I wish! Spent nearly 30+ hours now trying guess this and the structure of objects.
mpuppetier
Posts: 16
Joined: Tue Sep 02, 2014 11:20 am

Re: Open door from secret button

Post by mpuppetier »

NutJob wrote:
mpuppetier wrote:Thank you !!! It works.
Is there a way to find all object property?

I wish! Spent nearly 30+ hours now trying guess this and the structure of objects.
I don't know if they are all the components of one object,
but in the window where you can write the object id there is a lable :
Components, maybe this is what we are looking for.
Post Reply