JohnWordsworth's script to get object definitions does something pretty brilliant.NutJob wrote:Is there a way to print to a text/log file instead of the screen? I understand, that if there was, it would be a problem with compiled modules (exported) and modders potentially could write something malicious but looking for something that would only work in a development setting (the editor).
You're trying to call methods that don't exist.Soaponarope wrote:Don't know what I'm doing wrong
Because it's Grimrock 2 and not Grimrock 1.Soaponarope wrote:or why the scripting ref changed so much.
Because GameObject doesn't have an isOpen() method, GameObject doesn't have a close() method, GameObject doesn't have an open() method, and "PitComponent" is the name of the class, not an actual instance of it. You probably wanted to call i.pit:isOpen(), i.pit:close(), etc. All of this information is in the scripting reference.Soaponarope wrote:function massopenpit()
for i in party.map:allEntities() do
if i.id:sub(1,8) == "tomb_pit" then
if i:isOpen() then
i:close()
else
i:open()
end
end
end
end
PitComponent:isOpen() also doesn't work
I'm currently having problems too. I'm trying to call the stop() method on an object's controller component.cameronC wrote:I just can't get delayedCall to work. I've combed through the various posts regarding it in other threads and the brief mention of it in the scripting ref but I think I'm completely misunderstanding it. I've tried many things to get a script function to be ran after X seconds and sometimes the editor crashes on delayedCall() and sometimes it passes through it fine but gives me an invalidconnector warning onscreen and nothing else happens.
If I have entityID with a functionName I want to run after X seconds, is that something this can do?