Request: New hooks!

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
Lilltiger
Posts: 95
Joined: Sun Sep 16, 2012 1:12 am

Request: New hooks!

Post by Lilltiger »

Id like to see some new hooks added to the items so we can use them in the cloned objects like:

onItemLeftMouseButton():
A hook which is called when the item is pressed on with the left mouse button, the default behavior is:

Code: Select all

      onItemLeftMouseButton() = function(self)
         setMouseItem(self)
      end
By specifying this hook for an item you can make the player unable to pick up the item, or play some special
effects etc. when picking it up.

onItemAdded():
A hook which is called when the item is added to an inventory/slot/container(sack, altar, etc..)
User avatar
Montis
Posts: 340
Joined: Sun Apr 15, 2012 1:25 am
Location: Grimrock II 2nd playthrough (hard/oldschool)

Re: Request: New hooks!

Post by Montis »

The following party hook that already exists might be something that might interest you:
onPickUpItem: a hook which is called when an item is picked up. The function gets two parameters, the party itself and the item. If the function returns false, the pick up action is cancelled.
Last edited by Montis on Mon Sep 24, 2012 5:16 pm, edited 2 times in total.
When destiny calls, the chosen have no choice.

My completed dungeon (LoG1): Hypercube
Lilltiger
Posts: 95
Joined: Sun Sep 16, 2012 1:12 am

Re: Request: New hooks!

Post by Lilltiger »

Indeed, that might replace the first proposed hook, ill try it out.
User avatar
Emciel
Posts: 34
Joined: Fri Sep 14, 2012 2:19 am

Re: Request: New hooks!

Post by Emciel »

onItemAdded does sound very useful actually =)
Lilltiger
Posts: 95
Joined: Sun Sep 16, 2012 1:12 am

Re: Request: New hooks!

Post by Lilltiger »

Well both would be as the current "onPickUpItem" hook is not called when picking up from the inventory making it quite useless.
User avatar
Montis
Posts: 340
Joined: Sun Apr 15, 2012 1:25 am
Location: Grimrock II 2nd playthrough (hard/oldschool)

Re: Request: New hooks!

Post by Montis »

Request:
A monster "onAggro" hook would also be nice (maybe name it a bit differently though :P).
That would be called when a monster spots the party and turns to attack it.
Last edited by Montis on Mon Sep 24, 2012 5:16 pm, edited 2 times in total.
When destiny calls, the chosen have no choice.

My completed dungeon (LoG1): Hypercube
User avatar
Komag
Posts: 3659
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: Request: New hooks!

Post by Komag »

ah I like that one, so when you're spotted an alarm goes off, or there is "insta-kill" if you are supposed to sneak through the map, or the lights go out, etc
Finished Dungeons - complete mods to play
User avatar
Montis
Posts: 340
Joined: Sun Apr 15, 2012 1:25 am
Location: Grimrock II 2nd playthrough (hard/oldschool)

Re: Request: New hooks!

Post by Montis »

Another request:
onCraft
A hook in the recipes when crafting an item. Should returns crafted item, champion that crafts it and which item is used to craft (e.g. mortar & pestle, hammer & anvil etc). If false is returned, no item is crafted and the materials are not consumed. If true is returned, the materials are consumed, no matter if they actually crafted something.
When destiny calls, the chosen have no choice.

My completed dungeon (LoG1): Hypercube
Post Reply