View Single Post
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old December 28th, 2009, 04:17 PM
The "intersect[]" reference is what you can use to test whether a tag on the hero also exists on the thing you're testing.

Here's an example of it in use, from the Pathfinder files:
Code:
 
if (hero.intersect[FavClass,FavClass] <> 0) then
perform assign[Helper.FavorClass]
endif
If a FavClass tag on the hero matches a FavClass tag on the pick that's running this script, then it assigns itself a tag. This means that something external (a feat for example) can say "Fighter is a favored class" by doing this:

perform hero.assign[FavClass.cFighter]

Later on, that snippet of code runs, and if it's running on the Fighter class (which has the FavClass identity group), and finds FavClass.cFighter, then it knows it's supposed to be a favored class.
Mathias is offline   #20 Reply With Quote