• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Comparing Tags

Lawful_g

Well-known member
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?
 
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.
 
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?
 
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.
 
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:
Back
Top