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
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: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()
The "floor_fw_trigger" (a cloned one with fw_addHooks/class="FloorTrigger") has a connector to the script; my purpose is to have one script for several floortriggers and treasures spawned accordingly and not on the location of the script, but for the moment I tried only to print "ok" for testing... so where is the issue (using a cloned floortrigger?)?
So I see... here floortrigger call the script...which call the hook and it's the point because it's too late! It's an "autotrigger" problem... some clue be appreciated
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 »

Cloning is not the problem, I tested the exact code you pasted here and it seems to work fine. Maybe you have understood
the function of the framework incorrectly. This:

Code: Select all

fw.script:set('floor_fw_trigger@floorttrigger.Vallee des Anciens.onActivate',function(hook,self)
print("ok")
end)
Adds that hook to all floor_fw_triggers, so AFTER executing this code, activating any floor_fw_trigger should print ok.
- 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:Cloning is not the problem, I tested the exact code you pasted here and it seems to work fine. Maybe you have understood
the function of the framework incorrectly. This:

Code: Select all

fw.script:set('floor_fw_trigger@floorttrigger.Vallee des Anciens.onActivate',function(hook,self)
print("ok")
end)
Adds that hook to all floor_fw_triggers, so AFTER executing this code, activating any floor_fw_trigger should print ok.
Is working! Thanks! Some progress are time expensive... but I got the treasure finally! :geek:
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/?
Post Reply