Page 1 of 2
Ye Official Callbacks Request Thread
Posted: Wed Mar 12, 2014 8:02 pm
by Doctornull
Callbacks are awesome. They allow talents (sustained & passive) and timed effects to add per-actor hooks which get called just like hooks would, but they're way more efficient because they only apply to those specific actors who have the talent or are subject to the timed effect.
Callbacks are new, and there are not enough of them yet. Here is where you can request more!
Re: Ye Official Callbacks Request Thread
Posted: Wed Mar 12, 2014 8:07 pm
by Fortescue
I want a callback for any projectile object that collides with an actor.
For example, I want a talent that "blocks" projectiles regardless of their composition (physical / magical / mental / etc...). If it has a travel time, I want to be able to block it.
Re: Ye Official Callbacks Request Thread
Posted: Thu Mar 13, 2014 1:15 am
by Doctornull
callbackOnFireSpell_Location(self, t, x, y)
callbackOnFireSpell_Grids(self, t, {{x,y},{x,y},{x,y},...})
Use this in Spell/Fire to set Inferno on tiles if Wildfire is active, other addon talents can do cool non-Inferno things.
callbackOnWilderSummon(self, t, summon_string)
Use this for Grand Arrival and for items which heal on wilder summoning.
Please separate out callbackOnCrit into callbackOnCrit_Physical, callbackOnCrit_Mental and callbackOnCrit_Spell because having a function call for events which will never be relevant is a waste of time and against the idea of callbacks.
Re: Ye Official Callbacks Request Thread
Posted: Sun Mar 16, 2014 10:15 pm
by Doctornull
callbackOnSummon_Post(self, t, entity)
Callback triggered after summoned entity is created.
Re: Ye Official Callbacks Request Thread
Posted: Mon Mar 17, 2014 2:46 am
by PureQuestion
Doctornull wrote:items which heal on wilder summoning.
This is, unfortunately, not how callbacks work.
Re: Ye Official Callbacks Request Thread
Posted: Mon Mar 17, 2014 6:08 am
by Doctornull
PureQuestion wrote:This is, unfortunately, not how callbacks work.
Callbacks should work for wearable items.
You may consider this a request for that.
Re: Ye Official Callbacks Request Thread
Posted: Mon Mar 17, 2014 9:14 am
by darkgod
With a little trick they do, just make your item teach a passive talent that has the callback
Re: Ye Official Callbacks Request Thread
Posted: Thu Mar 20, 2014 8:03 pm
by Doctornull
darkgod wrote:With a little trick they do, just make your item teach a passive talent that has the callback
You are awesome.
PureQuestion wrote:This is, unfortunately, not how callbacks work.
You are useless!
---
callbackOnCalculate_Spellpower
callbackOnCalculate_Physpower
callbackOnCalculate_Mindpower - These would all be called inside actor:getXpower. This would allow for talents like Arcane Cunning to be implemented without superloading, and for ephemeral debuffs like Indimidated.
Re: Ye Official Callbacks Request Thread
Posted: Sun Apr 06, 2014 1:11 am
by Nagyhal
edit: Pointless post, carry on

Re: Ye Official Callbacks Request Thread
Posted: Thu May 22, 2014 1:13 am
by Doctornull
General interface to trigger whenever a talent is used:
callbackOnUseTalent
Interface to trigger whenever a class of talent is used:
callbackOnUseTalent_spell
callbackOnUseTalent_mind
callbackOnUseTalent_technique
callbackOnUseTalent_cunning
callbackOnUseTalent_nature
callbackOnUseTalent_infusion
callbackOnUseTalent_rune
callbackOnUseTalent_taint
etc. (are there more classes of talents?)
Specific interface to trigger whenever a specific talent is used:
"callbackOnUseTalent_%s" : format( t.short_name )
Re: Ye Official Callbacks Request Thread
Posted: Tue Sep 09, 2014 12:28 pm
by Nagyhal
Any chance of a callback at the beginning of the base damage projector function in damage_types.lua?
There's already both a callback and a hook for the end of the damage projector function, and there's a hook at the beginning, too, but no callback.
Essentially I just want to deal additional damage upon damaging an enemy, but because the damage type used provides a beneficial effect for the source, it needs to occur before the triggering damage kills a target.
I'll do it in hooks/load.lua for now, but a callback would be just perfect! Thanks for hearing me out!
Re: Ye Official Callbacks Request Thread
Posted: Sat Oct 11, 2014 1:14 am
by HousePet
Seconding a request for callbacks on items.
Slipping on a passive talent is kinda missing the point on what makes callbacks good.
Re: Ye Official Callbacks Request Thread
Posted: Tue Dec 02, 2014 2:40 am
by Nagyhal
Can't believe there's no hook/callback on level up!
Please see to it that this dreadful state of affairs is amended at once.
Re: Ye Official Callbacks Request Thread
Posted: Tue Dec 16, 2014 11:24 am
by Nagyhal
ElectronicRU and I have been discussing callbacks quite a bit on the IRC channel.
One thing that - for me - is a huge omission is the inability to interrupt melee attacks.
callbackOnMeleeHit and
callbackOnMeleeMiss are invoked only after the hit/miss status of an attack is decided.
callbackOnMeleeAttack is placed at the end of the entire attack function ("attackTargetWith") and doesn't do anything, the hook
"Combat:attackTargetWith" looks like it sends something back, but in reality this only determines whether particles display and whether whatever making the attack
treats the attack as if it had succeeded.
Truth be told, none of us can figure out what the return values of "Combat:attackTargetWith" are actually good for.
I'd like a callback at the beginning of the "attackTargetWith" function in Combat.lua which can cause the provoking melee attack to be altered / interrupted (attackTarget is useable in this way but will only work for bump attacks, and only once per bump - rather per weapon strike.)
The Combat:attackTarget hook is the best-featured of its kind, and may send back the following information, although it is not in a place to be of very much use:
Code: Select all
speed, hit, damtype, mult = hd.speed, hd.hit, hd.damtype, hd.mult
if hd.stop then return hit end
I'd like to see a similar check at the beginning of attackTargetWith, before the damage is projected and roughly at the point at which Repel and Evasion are checked for (before, after or within these features is not something I can decide.)
And I'd like to see all callbacks made equal to their equivalent hooks, and given the same ability to pass data back to their calling functions, within reason (I understand that multiple addons having similar callbacks can create strange interactions, but ElectronicRU is working on that, and besides the same should be true for hooks anyway.)
Re: Ye Official Callbacks Request Thread
Posted: Wed Dec 17, 2014 1:17 am
by Doctornull
Suggestion for naming conventions:
callbackPreMelee(...)
callbackPostMeleeHit(...)
callbackPostMeleeMiss(...)