Senior Member
Volunteer Data File Contributor
Join Date: Mar 2007
Posts: 1,245
|
Working on something and have a question whose answer might help others, so thought I'd ask here.
I have written a script that looks at something (the selected deity) and uses the pulltags mechanism to copy all of one type of tag (the AllowDom tags) onto this ability. I then want to compare this list of pulled tags to the actual domains chosen and confirm that exactly 1 allowed domain has been chosen. I am aware from a forum search that there is a "compare" command, but here I have several different tags (4-8 depending on the deity) to compare to 2 different domains. How would I do this? |
#1 |
Senior Member
Join Date: Aug 2008
Location: Miamisburg, OH
Posts: 1,322
|
Could you check to see if each one is valid. I think it returns a 1 it is it. then just keep adding these values up, in the end if the total value is greater then 1 it should mean that more then one domain has been selected.
but i might be stating the obvious. Web site - Cheese Weasel Logistics - www.cheeseweasel.net Twitter - @CheeseWeaselGMZ For user created content check out www.d20pfsrd.com and www.cheeseweasel.net For video demos of Hero Lab go to http://www.youtube.com/user/TheChiefweasel?blend=9&ob=5 |
#2 |
Senior Member
Volunteer Data File Contributor
Join Date: Mar 2007
Posts: 1,245
|
Well the tags and the numbers vary depending on the deity taken, so it is more that I don't know how to set up x number of variables as strings and then compare them to the unique IDs of the domains.
If there were only 1 domain allowed tag on each deity I might be able to figure out the compare function with some fiddling. But how do I set up multiple string variables and comapare them all? |
#3 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,217
|
If you're a cleric, won't both of your domains have come from the allowed domains? If that's so, is that an error for what you're searching for?
If not, you can use intersect: hero.child[wherever you have stored the domain tags that were chosen].intersect[AllowDom,AllowDom] <> 0 (the first AllowDom is looked for wherever hero.child[] takes you, and the second is checked on whatever's running the script) It sounds like those tags may be on the hero, so hero.intersect[HasDomain,AllowDom] <> 0 Should work. Another option that my work: The druid class cancels the restriction that a deity's allowed domains match the hero's domains chosen by assigning the Hero.AllowAllDom tag to the hero (at First/1600), so by deleting that tag from the hero, you'd impose the same restriction a cleric has to follow - that they select domains from their deity's list. |
#4 |
Senior Member
Volunteer Data File Contributor
Join Date: Mar 2007
Posts: 1,245
|
The point of this thing is that the cleric must select 1 domain that is not allowed by his deity and 1 that is.
I'll give those a shot and ask again if I have trouble. Last edited by Lawful_g; May 3rd, 2011 at 04:16 PM. Reason: clarify |
#5 |
|
|