Page 1 of 1

[Solved] Can't get any hooks to work for monsters

Posted: Sun Nov 02, 2014 10:44 pm
by MrChoke
In LoG 1 you can add an onMove() hook for a monster. I want to do that here in 2. I think I have the syntax correct but its not working.

Code: Select all

skeleton_trooper_1.move:addConnector("onMove", "script_entity_3", "mobMoved")
Monsters have the "move" component. The syntax for adding connectors looks right to me. Yet, I get nothing. The hook function is not called. Please tell me I am missing something here??? I really hope there is a way to get this to work.

Re: Can't get any hooks to work for monsters

Posted: Mon Nov 03, 2014 12:22 am
by Jouki
try

Code: Select all

skeleton_trooper_1.monster:addConnector("onMove" , "script_entity_3" , "mobMoved")
you can try something similiar where I've tried cheking if monster is dead. link

Re: Can't get any hooks to work for monsters

Posted: Mon Nov 03, 2014 12:32 am
by MrChoke
Thanks but Prozail solved it in another thread. Solved for dynamic adding of the hooks anyway.

For monsters, onMove() is now part of onPerformAction(). You get "move" and "turn" actions. Probably other ones too but that is the answer. I can't get these hooks to work when I define a monster though..