Hook framework (a.k.a LoG Framework 2)

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!
User avatar
melierax
Posts: 29
Joined: Sat Oct 27, 2012 2:08 am
Location: Quebec, Canada

Re: Hook framework (a.k.a LoG Framework 2)

Post by melierax »

Hello
No need to dungeon I found my mistake :roll: , now it works
Bye :)
User avatar
Duncan1246
Posts: 404
Joined: Mon Jan 19, 2015 7:42 pm

Re: Hook framework (a.k.a LoG Framework 2)

Post by Duncan1246 »

Hello JKos,
I have installed Hook Framework and my first attempt is a success with a party hook. Thanks for your work!
But... I tried another one with a floortrigger, and I don't understand where I am wrong, but nothing happened! Here is my test code:
SpoilerShow
function battlefielddig()

fw.script:set('floor_trigger@floortrigger.Vallee des Anciens.onActivate',function(hook,self)
print("ok")
end)
end
I tried with object Id, with FloorTrigger for component, etc... I am lost :cry:
Duncan
The Blue Monastery (LOG1)
download at:http://www.nexusmods.com/grimrock/mods/399/?

Finisterrae(LOG2)
download at:http://www.nexusmods.com/legendofgrimrock2/mods/61/?
User avatar
JKos
Posts: 464
Joined: Wed Sep 12, 2012 10:03 pm
Location: Finland
Contact:

Re: Hook framework (a.k.a LoG Framework 2)

Post by JKos »

You have to manually add framework hooks to floor_trigger game object like you did with party object. like this:

Code: Select all

defineObject{
	name="floor_trigger",
	baseObject="floor_trigger",
	components = {
		fw_addHooks{
			class="FloorTrigger"
		}
	}
}
- LoG Framework 2http://sites.google.com/site/jkoslog2 Define hooks in runtime by entity.name or entity.id + multiple hooks support.
- cloneObject viewtopic.php?f=22&t=8450
User avatar
Duncan1246
Posts: 404
Joined: Mon Jan 19, 2015 7:42 pm

Re: Hook framework (a.k.a LoG Framework 2)

Post by Duncan1246 »

JKos wrote:You have to manually add framework hooks to floor_trigger game object like you did with party object. like this:

Code: Select all

defineObject{
	name="floor_trigger",
	baseObject="floor_trigger",
	components = {
		fw_addHooks{
			class="FloorTrigger"
		}
	}
}
Thanks! I haven't understood this in reading your doc, but it is logical :mrgreen:
The Blue Monastery (LOG1)
download at:http://www.nexusmods.com/grimrock/mods/399/?

Finisterrae(LOG2)
download at:http://www.nexusmods.com/legendofgrimrock2/mods/61/?
User avatar
Duncan1246
Posts: 404
Joined: Mon Jan 19, 2015 7:42 pm

Re: Hook framework (a.k.a LoG Framework 2)

Post by Duncan1246 »

Hi JKos,
I tried your solution this morning (instead of solar eclipse, I have had a brain one, I think...): no result...
What I have done:
SpoilerShow
Put this in init.lua:

Code: Select all

cloneObject{
       name="floor_fw_trigger",
       baseObject="floor_trigger",
                  components = {
                                        fw_addHooks{
                                        class="FloorTrigger"
                                            }
                                }
          }
(I tried also with a replacment one by "defineObject", same result)
then I put a floor_fw_trigger with "digonly" and a connected script: function battlefielddig()

fw.script:set('floor_fw_trigger@FloorTrigger.Vallee des Anciens.onActivate',function(hook,self)
print("ok")
end)
end
Script is called, but do nothing... Where am I wrong?
The Blue Monastery (LOG1)
download at:http://www.nexusmods.com/grimrock/mods/399/?

Finisterrae(LOG2)
download at:http://www.nexusmods.com/legendofgrimrock2/mods/61/?
User avatar
Duncan1246
Posts: 404
Joined: Mon Jan 19, 2015 7:42 pm

Re: Hook framework (a.k.a LoG Framework 2)

Post by Duncan1246 »

Duncan1246 wrote:Hi JKos,
I tried your solution this morning (instead of solar eclipse, I have had a brain one, I think...): no result...
What I have done:
SpoilerShow
Put this in init.lua:

Code: Select all

cloneObject{
       name="floor_fw_trigger",
       baseObject="floor_trigger",
                  components = {
                                        fw_addHooks{
                                        class="FloorTrigger"
                                            }
                                }
          }
(I tried also with a replacment one by "defineObject", same result)
then I put a floor_fw_trigger with "digonly" and a connected script: function battlefielddig()

fw.script:set('floor_fw_trigger@floorttrigger.Vallee des Anciens.onActivate',function(hook,self)
print("ok")
end)
end
Script is called, but do nothing... Where am I wrong?
As I said in the post above, I have made now many tests without any success, and I don't understand why I can't figure out where is my error. I have no problem with party hooks as I said before, so I surely miss something important. Can you help me?
Duncan
The Blue Monastery (LOG1)
download at:http://www.nexusmods.com/grimrock/mods/399/?

Finisterrae(LOG2)
download at:http://www.nexusmods.com/legendofgrimrock2/mods/61/?
User avatar
JKos
Posts: 464
Joined: Wed Sep 12, 2012 10:03 pm
Location: Finland
Contact:

Re: Hook framework (a.k.a LoG Framework 2)

Post by JKos »

floorttrigger, there is an extra t.
- LoG Framework 2http://sites.google.com/site/jkoslog2 Define hooks in runtime by entity.name or entity.id + multiple hooks support.
- cloneObject viewtopic.php?f=22&t=8450
User avatar
Duncan1246
Posts: 404
Joined: Mon Jan 19, 2015 7:42 pm

Re: Hook framework (a.k.a LoG Framework 2)

Post by Duncan1246 »

JKos wrote:floorttrigger, there is an extra t.
God Damned! No! It's a bug in my post, in my mod I write it correctly "floortrigger". So my ask stays alive...
Duncan
The Blue Monastery (LOG1)
download at:http://www.nexusmods.com/grimrock/mods/399/?

Finisterrae(LOG2)
download at:http://www.nexusmods.com/legendofgrimrock2/mods/61/?
User avatar
Dr.Disaster
Posts: 2876
Joined: Wed Aug 15, 2012 11:48 am

Re: Hook framework (a.k.a LoG Framework 2)

Post by Dr.Disaster »

Can we have the whole thing, please?
User avatar
JKos
Posts: 464
Joined: Wed Sep 12, 2012 10:03 pm
Location: Finland
Contact:

Re: Hook framework (a.k.a LoG Framework 2)

Post by JKos »

Well I actually tested your code and it works for me after removing the extra t. What do you mean by:
then I put a floor_fw_trigger with "digonly" and a connected script: function battlefielddig()
- LoG Framework 2http://sites.google.com/site/jkoslog2 Define hooks in runtime by entity.name or entity.id + multiple hooks support.
- cloneObject viewtopic.php?f=22&t=8450
Post Reply