PDA

View Full Version : Getting the target for a PC from the Combat Tracker



morgurth
March 16th, 2015, 00:27
So, I can get the nodeCT and sCTNode using the CombatManager.getCTFromNode function, but I need to get the level of that target, if it's another PC.

If it's just the Actor, I use "DB.getValue(rActor, "level", 0);". Is there a function that can strip off "combattracker.list.id-00004" and turn into a PC CreatureNode like "charsheet.id-00004" so I can use that getValue?

Or am I way overthinking this and there's an easier way?

Trenloe
March 16th, 2015, 03:03
If it's a PC then the link to charsheet.id-XXXXX will be in the combattracker.list.id-XXXXX.link.recordname field. combattracker.list.id-XXXXX.link.class will tell you if it's a PC (charsheet) or npc. If it's an NPC there is no <recordname> link as the whole NPC record gets copied to the combat tracker so there is no external link to the data for that NPC record in the CT.

You might want to look at scripts\manager_actor.lua in the CoreRPG ruleset - this has many helper functions that can be used to get info from the rActor record, which is used in many areas of the CoreRPG ruleset (and rulesets layered on CoreRPG).

morgurth
March 17th, 2015, 02:23
So, I was getting closer using "TargetingManager.getFullTargets". But then I realized I was modifying "manager_action_heal.lua" and I don't think I want that.

Currently the "manager_char.lua" function "useHealingSurge" has been modified to work like a 13th Age Recovery. I probably should look at the Powers instead and adjust a power with the "heal" type to use the Recovery code, plus some additions that clerics get. Like adding double their level to the recovery roll (Domain: Healing), etc.

Thanks! Guess I'll go to look there tomorrow.