Page 5 of 5

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

Posted: Fri Mar 27, 2015 7:12 pm
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

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

Posted: Fri Mar 27, 2015 8:06 pm
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.

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

Posted: Fri Mar 27, 2015 11:31 pm
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