Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   HL - d20 System (http://forums.wolflair.com/forumdisplay.php?f=46)
-   -   Count if things share a tag (http://forums.wolflair.com/showthread.php?t=59231)

Illyahr September 24th, 2017 03:06 PM

Count if things share a tag
 
I'm trying to come up with the coding to allow me to check the tags of a special. The scripting needs to cycle through all custom specials and find their tags. If there are three of the same tag, then check +1 for each group of three.

Is this doable?

Sendric September 25th, 2017 04:09 AM

Something like this might help you out:

Code:

var tagexist as number

foreach pick in BaseCustSp
  if (eachpick.tagis[Custom.Tag] <> 0) then
    tagexist += 1
  endif
nexteach

tagexist = round(tagexist/3,0,-1)

This should provide a result equal to the number of "groups of three" you are looking for.

Illyahr September 25th, 2017 04:54 PM

Thanks. I'll what I can do with that.


All times are GMT -8. The time now is 07:35 PM.

Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.