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

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Post Reply
MrChoke
Posts: 324
Joined: Sat Oct 25, 2014 7:20 pm

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

Post 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.
Last edited by MrChoke on Mon Nov 03, 2014 12:33 am, edited 1 time in total.
User avatar
Jouki
Posts: 127
Joined: Fri Oct 24, 2014 12:57 pm

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

Post 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
MrChoke
Posts: 324
Joined: Sat Oct 25, 2014 7:20 pm

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

Post 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..
Post Reply