Senior Member
Join Date: Aug 2011
Posts: 363
|
i've got a feat that requires Weapon Focus (any crossbow or firearm) as a prerequisite.
i couldn't seem to find any tags or fields other than the actName, sbName or shortname that reference the weapon selected. is there a way to specify which weapon is selected on Weapon Focus for a prereq validation? or a weapon grouping (such as all crossbows and all firearms)? |
#1 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
Take a look at the feat "Aldori Dueling Mastery" for how you test for a specific weapon. Testing for a group of any crossbows would be a little harder but can be done.
Pre-Reqs Code:
~ Default not valid @valid = 0 var sTags as string var iX as number ~ Build a search string of crossbow tags foreach thing in BaseWep where "wFtrGroup.Crossbows" ~ after adding the first tag add an "OR" if (iX <> 0) then sTags &= "|" endif sTags &= eachthing.tagids[WepFocus.?] iX += 1 nexteach ~ Check hero for any matching weapon focus tags. If we find ~ any of them we are valid. if (hero.tagsearch[sTags] <> 0) then @valid = 1 endif The really bad of this script is it is MASSIVE CPU overhead. Between the foreach and the tagseach. Then add in the Pre-Req that fires like 6 times and is BAD BAD BAD. It will work. Honestly I think from a point of view of adding this the community stuff we would be better off just hard-coding the tests of the different crossbows that are already in the game. I can't see many or any more crossbows being added to the game. Hero Lab Resources: Pathfinder - d20pfsrd and Pathfinder Pack Setup 3.5 D&D (d20) - Community Server Setup 5E D&D - Community Server Setup Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources. Created by the community for the community - Realm Works kickstarter backer (Alpha Wolf) and Beta tester.- d20 HL package volunteer editor. |
#2 |
Senior Member
Join Date: Aug 2011
Posts: 363
|
looking at the Aldori Dueling Mastery was great hint.
so far this code seems to work (and how do you all keep getting the code in that separate 'box' in the post??): (tagis[WepFocus.wCrsDouble] + tagis[WepFocus.wCrsHand] + tagis[WepFocus.wCrsHeavy] + tagis[WepFocus.wCrsLight] + tagis[WepFocus.wCrsRpHvy] + tagis[WepFocus.wCrsRpLgt]) <> 0 it validates on each of the separate crossbows. how can i find a list of the firearms out there? when i did a search for crossbow i got all of the above (plus bolts) returned, but when i try searching 'firearm' i only get "Exotic Weapons: Firearms (wHdrFire)" and a bunch of bullets. |
#3 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
So take a look at the Exotic Weapon Prof (Firearms) feat (thingid.fExoticGun). It assigns a single tag to the hero you can check for.
To have code display in you use code tags around your stuff. You can do this by pressing the "#" image. Or put the code tags yourself. So you do this as follows: {code} {/code} Just replace the { with [ to get it work. Hero Lab Resources: Pathfinder - d20pfsrd and Pathfinder Pack Setup 3.5 D&D (d20) - Community Server Setup 5E D&D - Community Server Setup Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources. Created by the community for the community - Realm Works kickstarter backer (Alpha Wolf) and Beta tester.- d20 HL package volunteer editor. |
#4 |
Senior Member
Join Date: Aug 2011
Posts: 363
|
so looking at Exotic Weapon Proficiency (firearms) it does say this:
Even though Exotic Weapon Proficiency (firearms) grants you proficiency with all firearms, when you take feats that modify a single type of weapon (such as Weapon Focus or Rapid Reload), you must still pick one type of firearm (such as musket or pistol) for those feats to affect. so it sounds like the tag it gives the hero isn't quite specific enough for a weapon focus prereq. or am i reading too much into it? |
#5 |
Senior Member
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975
|
The feat Prone Shooter from Ultimate Combat has this exact pre-req and is covered by
Code:
~search through all the crossbows and firearms (and maybe also slings) ~in the game, and compare them to the list of weapons we have weapon ~focus in - if there's a match, then we're valid foreach thing in BaseWep where "wFtrGroup.Crossbows | wCategory.Firearm" validif (eachthing.intersect[WepFocus,WepFocus] <> 0) nexteach |
#6 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
Quote:
That is one step better than building the whole list and checking all at once like I did. Hero Lab Resources: Pathfinder - d20pfsrd and Pathfinder Pack Setup 3.5 D&D (d20) - Community Server Setup 5E D&D - Community Server Setup Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources. Created by the community for the community - Realm Works kickstarter backer (Alpha Wolf) and Beta tester.- d20 HL package volunteer editor. |
|
#7 |
Senior Member
Join Date: Mar 2013
Location: Greater London, UK
Posts: 2,623
|
Doesn't validif only finish if the result is true?
So the loop will find the first crossbow/firearm with weapon focus? |
#8 |
Senior Member
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975
|
Correct
|
#9 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
Correct. The Pre-Req is weapon focus with ANY crossbow/firearm.
Hero Lab Resources: Pathfinder - d20pfsrd and Pathfinder Pack Setup 3.5 D&D (d20) - Community Server Setup 5E D&D - Community Server Setup Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources. Created by the community for the community - Realm Works kickstarter backer (Alpha Wolf) and Beta tester.- d20 HL package volunteer editor. |
#10 |
|
|