PDA

View Full Version : Is there a way to get the total number of targets on an attack roll?



alloowishus
July 16th, 2024, 18:56
Specifically I am looking in manager_action_attack.lua in my custom ruleset, the function is performRoll. I need to find the number of targets.

Thanks!

alloowishus
July 16th, 2024, 19:25
found it myself!

aTargets = {};
aTargets = TargetingManager.getFullTargets(rActor);

nTargetCount = 0;
for _,sTar in pairs(aTargets) do
nTargetCount = nTargetCount+1;
end

Trenloe
July 16th, 2024, 20:18
As aTargets is a numerically indexed LUA table you can use #aTargets to get the number of records in the table.