Page 1 of 1
Open door from secret button
Posted: Wed Oct 22, 2014 1:56 pm
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??
Re: Open door from secret button
Posted: Wed Oct 22, 2014 2:03 pm
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!).
Re: Open door from secret button
Posted: Wed Oct 22, 2014 2:06 pm
by mpuppetier
Thank you !!! It works.
Is there a way to find all object property?
Re: Open door from secret button
Posted: Wed Oct 22, 2014 2:12 pm
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.
Re: Open door from secret button
Posted: Wed Oct 22, 2014 2:36 pm
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.