[Scripting] Introspecting entities

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
3socks
Posts: 11
Joined: Sun Nov 04, 2012 11:29 pm

[Scripting] Introspecting entities

Post 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?
User avatar
Edsploration
Posts: 104
Joined: Wed Sep 19, 2012 4:32 pm

Re: [Scripting] Introspecting entities

Post 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.
Open Project -> Community FrankenDungeon: viewtopic.php?f=14&t=4276
Post Reply