PDA

View Full Version : Targeting Complication...



Blackfoot
February 15th, 2016, 21:51
I'm working on a piece of my Champions Ruleset where it does a secondary roll based on the results of the Damage Roll. This roll generates something called 'Knockback' which is modified by certain aspects of the target (knockback resistance, if they are 'clinging' to something, if they are 'flying'... stuff like that). Anyway... I need to reference the Target but it seems to be getting lost on me and I'm having trouble tracking down where the target is captured. My ruleset is a subRuleset of CoreRPG and was originally based on but does not share code with 3.5E (code was duplicated and modified, not inherited). Is there a getTarget function or something?
I'm following the 3.5E DamageManager code through and it seems to not need rTarget for some functions but has it at the end when it's time to applyDamage. PerformAction (where it starts) doesn't seem to give a hoot about targets. I am guessing, the target gets retrieved along the way... or is out there floating around somewhere as a variable.. but it seems like the easiest thing to do would be to call rSource and ask it who it's target is when I need it.

Blackfoot
February 16th, 2016, 01:03
I got around this issue, sort of, by doing my calculations earlier and making the result a Mod.. but it isn't really the 'right way' to do it.. and I can't apply automatic effects or apply damage based on the results since I don't have a target. I do see that PerformAction seems to have the target hidden in the draginfo.. and I presume that the draginfo for my secondary roll is nil. Then I guess the question would be is there an easy way to build draginfo. I also found in the TargetingManager a function for finding an array of targets. I can probably work with that... it's more complicated than I'd like but I think I can sort it out.

Blackfoot
February 16th, 2016, 01:37
Hrm. New twist... it's only drag targeting that isn't working... so what I really need help with understanding is drag targeting for secondary rolls apparently.

Moon Wizard
February 20th, 2016, 07:47
Both the token and CT code call CombatManager.onDrop with the parameters ("ct", <CT entry node name>, <draginfo object>).

When the callback registered to ActionsManager.registerResultHandler for the action type is called, the callback is passed the parameters (<source actor>, <target actor>, <roll structure>).

You would want to pass the source and target actor records on to the next roll via ActionsManager.roll(<source actor>, <target actor>, <roll structure>)

The "critconfirm" roll type in the 3.5E ruleset is a good example of this. (see ActionAttack script in the 3.5E ruleset)

Regards,
JPG

Blackfoot
February 21st, 2016, 03:49
Thanks. That helped a lot. My issue seems to be worked out now.
Thanks again.