ToME: the Tales of Maj'Eyal

Everything about ToME
It is currently Sun Nov 18, 2018 12:19 pm

All times are UTC




Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Wed Mar 12, 2014 8:02 pm 
Offline
Sher'Tul Godslayer

Joined: Tue Jun 18, 2013 10:46 pm
Posts: 2275
Location: Ambush!
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!

_________________
Check out my addons: Nullpack (classes), Null Tweaks (items & talents), and New Gems fork.


Top
 Profile  
 
PostPosted: Wed Mar 12, 2014 8:07 pm 
Offline
Wyrmic

Joined: Sat Feb 08, 2014 1:02 am
Posts: 285
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.


Top
 Profile  
 
PostPosted: Thu Mar 13, 2014 1:15 am 
Offline
Sher'Tul Godslayer

Joined: Tue Jun 18, 2013 10:46 pm
Posts: 2275
Location: Ambush!
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.

_________________
Check out my addons: Nullpack (classes), Null Tweaks (items & talents), and New Gems fork.


Top
 Profile  
 
PostPosted: Sun Mar 16, 2014 10:15 pm 
Offline
Sher'Tul Godslayer

Joined: Tue Jun 18, 2013 10:46 pm
Posts: 2275
Location: Ambush!
callbackOnSummon_Post(self, t, entity)

Callback triggered after summoned entity is created.

_________________
Check out my addons: Nullpack (classes), Null Tweaks (items & talents), and New Gems fork.


Top
 Profile  
 
PostPosted: Mon Mar 17, 2014 2:46 am 
Offline
Master Artificer

Joined: Fri Feb 03, 2012 3:53 am
Posts: 726
Doctornull wrote:
items which heal on wilder summoning.


This is, unfortunately, not how callbacks work.


Top
 Profile  
 
PostPosted: Mon Mar 17, 2014 6:08 am 
Offline
Sher'Tul Godslayer

Joined: Tue Jun 18, 2013 10:46 pm
Posts: 2275
Location: Ambush!
PureQuestion wrote:
This is, unfortunately, not how callbacks work.
Callbacks should work for wearable items.

You may consider this a request for that.

_________________
Check out my addons: Nullpack (classes), Null Tweaks (items & talents), and New Gems fork.


Top
 Profile  
 
PostPosted: Mon Mar 17, 2014 9:14 am 
Offline
Master of Eyal

Joined: Wed Jul 24, 2002 9:26 pm
Posts: 10230
Location: Angolwen
With a little trick they do, just make your item teach a passive talent that has the callback

_________________
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)


Top
 Profile  
 
PostPosted: Thu Mar 20, 2014 8:03 pm 
Offline
Sher'Tul Godslayer

Joined: Tue Jun 18, 2013 10:46 pm
Posts: 2275
Location: Ambush!
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.

_________________
Check out my addons: Nullpack (classes), Null Tweaks (items & talents), and New Gems fork.


Top
 Profile  
 
PostPosted: Sun Apr 06, 2014 1:11 am 
Offline
Wyrmic

Joined: Tue Feb 15, 2011 12:01 am
Posts: 282
edit: Pointless post, carry on :mrgreen:


Top
 Profile  
 
PostPosted: Thu May 22, 2014 1:13 am 
Offline
Sher'Tul Godslayer

Joined: Tue Jun 18, 2013 10:46 pm
Posts: 2275
Location: Ambush!
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 )

_________________
Check out my addons: Nullpack (classes), Null Tweaks (items & talents), and New Gems fork.


Top
 Profile  
 
PostPosted: Tue Sep 09, 2014 12:28 pm 
Offline
Wyrmic

Joined: Tue Feb 15, 2011 12:01 am
Posts: 282
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!


Top
 Profile  
 
PostPosted: Sat Oct 11, 2014 1:14 am 
Offline
Perspiring Physicist

Joined: Sun Sep 09, 2012 7:43 am
Posts: 5770
Seconding a request for callbacks on items.
Slipping on a passive talent is kinda missing the point on what makes callbacks good.

_________________
My feedback meter decays into coding. Give me feedback and I make mods.


Top
 Profile  
 
PostPosted: Tue Dec 02, 2014 2:40 am 
Offline
Wyrmic

Joined: Tue Feb 15, 2011 12:01 am
Posts: 282
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.


Top
 Profile  
 
PostPosted: Tue Dec 16, 2014 11:24 am 
Offline
Wyrmic

Joined: Tue Feb 15, 2011 12:01 am
Posts: 282
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:
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.)


Top
 Profile  
 
PostPosted: Wed Dec 17, 2014 1:17 am 
Offline
Sher'Tul Godslayer

Joined: Tue Jun 18, 2013 10:46 pm
Posts: 2275
Location: Ambush!
Suggestion for naming conventions:

callbackPreMelee(...)

callbackPostMeleeHit(...)
callbackPostMeleeMiss(...)

_________________
Check out my addons: Nullpack (classes), Null Tweaks (items & talents), and New Gems fork.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group