[SOLVED] call hooks from ingame script

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
Granamir
Posts: 202
Joined: Wed Jan 07, 2015 7:19 pm

[SOLVED] call hooks from ingame script

Post by Granamir »

Hi everyone,
sorry today i'm lazy so didn't make a search if an answer already exists.

Just want to know,if possible, how to call an inside hook of an object (say a monster) from an ingame script; so that i can change a specific monster behaviour without creating a new monster in my monster.lua file.
TY
Last edited by Granamir on Sun Aug 02, 2015 4:43 pm, edited 1 time in total.
User avatar
Isaac
Posts: 3190
Joined: Fri Mar 02, 2012 10:02 pm

Re: call hooks from ingame script

Post by Isaac »

Granamir wrote:Hi everyone,
sorry today i'm lazy so didn't make a search if an answer already exists.

Just want to know,if possible, how to call an inside hook of an object (say a monster) from an ingame script; so that i can change a specific monster behaviour without creating a new monster in my monster.lua file.
TY
It might be better to have the hook always call the in-game script; where you can change how the function behaves.
The script can get the calling monster as an argument, and you can do your checks on it, and make changes to the outcome based on the individual monster calling the script.
Granamir
Posts: 202
Joined: Wed Jan 07, 2015 7:19 pm

Re: call hooks from ingame script

Post by Granamir »

Understood. TY
Post Reply