Page 1 of 1

Hook Signature Discrepancy

Posted: Sun Nov 09, 2014 8:49 pm
by strangely
I have successfully added an 'onAttack' hook to the party component.
The signature for my hook is as follows:

Code: Select all

onAttack = function(party, champion, weapon)
   ...
end
However, the script reference shows the following signature:

Code: Select all

onAttack(self, champion, action, slot)
I changed my script to use the second signature and the engine accepted it and called it on attacks.

Does anybody know which signature I am supposed to use? In the second one, the one listed in the scripting reference, I can't figure out what is in the action parameter. Calling type(action) returns 'table' but when I try the following:

Code: Select all

for key,value in pairs(action) do
   hudPrint(key, value)
end
nothing is printed on the hud.

Any help would be appreciated.

Thanks.