Page 1 of 1

little LUA help needed - bind hooks dynamically?

Posted: Tue Oct 16, 2012 10:15 pm
by Mebaru
Hello,
I am newbie to LUA and I don't know if this possible but I hope it is.
The basic idea is to bind hooks for spawn monster dynamically. For example, I spawn a spider and hook his onMove - all within script entity. Currently, I have to use cloneObject{} in monsters.lua and I find it not very comfortable if I spawn plenty of different monsters with different hooks.

Hope I was clear to understand :)

Re: little LUA help needed - bind hooks dynamically?

Posted: Tue Oct 16, 2012 10:45 pm
by JKos
I have made a framework for this viewtopic.php?f=14&t=3321

It could be bit much if you are beginner in lua, but so was I a month ago :)
If the documentation is not clear enough please give me a feedback in Log Framework thread.

Re: little LUA help needed - bind hooks dynamically?

Posted: Tue Oct 16, 2012 10:47 pm
by Mebaru
Oh, great job! Thanks, will look into it :geek: