Page 1 of 1

[Scripting] Introspecting entities

Posted: Sun Nov 04, 2012 11:58 pm
by 3socks
Hi guys,

I've just started learning log scripting and I thought I'd be good to learn within the code. And so I created a little function, which might help me with it. This function gets a table as an input and outputs its functions and attributes.

Code: Select all

function introspect(obj)
	for k,v in pairs(obj) do print(k,v) end
end
It works for tables that I create, but doesn't for any log entity like party or any entity returned with findEntity. Why is that? How can I introspect the entities? Is this possible?

I am new to this so I apologize if answer is straightforward.

Edit:
I've found this in documentation: http://www.grimrock.net/modding/scripting-reference/ This seems like an answer for what I am trying to do. But is it the full coverage of what we can do with scripts?

Re: [Scripting] Introspecting entities

Posted: Mon Nov 19, 2012 12:42 pm
by Edsploration
The scripting reference is quite valuable and comprehensive as far as I can tell, although a few things such as offsets for shootProjectile() do not work.

I've heard that there are undocumented functions, but I don't know exactly how to find them. AH warned against using undocumented functions as they may change in the future. So any mod that relies on undocumented functions may break in a future update.