Fantasy Grounds Merchandise
  1. #1

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

    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!

  2. #2
    found it myself!

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

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

  3. #3
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,985
    As aTargets is a numerically indexed LUA table you can use #aTargets to get the number of records in the table.
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
GI JOE RPG Launch

Log in

Log in