[Scripting] Introspecting entities
Posted: Sun Nov 04, 2012 11:58 pm
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.
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?
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
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?