Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Pathfinder Roleplaying Game
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
psych777
Senior Member
 
Join Date: Aug 2011
Posts: 363

Old May 31st, 2015, 11:22 AM
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)?
psych777 is offline   #1 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old May 31st, 2015, 11:56 AM
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
Above is an example. I have not actually tested it but it should work. That builds a list of all Weapon Focus tags for Crossbows and then does a tagsearch.

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.
ShadowChemosh is offline   #2 Reply With Quote
psych777
Senior Member
 
Join Date: Aug 2011
Posts: 363

Old May 31st, 2015, 01:10 PM
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.
psych777 is offline   #3 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old May 31st, 2015, 05:00 PM
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.
ShadowChemosh is offline   #4 Reply With Quote
psych777
Senior Member
 
Join Date: Aug 2011
Posts: 363

Old May 31st, 2015, 11:16 PM
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?
psych777 is offline   #5 Reply With Quote
AndrewD2
Senior Member
 
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975

Old June 1st, 2015, 08:56 AM
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
AndrewD2 is offline   #6 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old June 1st, 2015, 10:18 AM
Quote:
Originally Posted by AndrewD2 View Post
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
Yep that would be a little better. I should have thought about using validif in the middle for the foreach loop. That way it ends as soon as it finds the very first crossbow or firearm.

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.
ShadowChemosh is offline   #7 Reply With Quote
Farling
Senior Member
 
Join Date: Mar 2013
Location: Greater London, UK
Posts: 2,623

Old June 1st, 2015, 10:47 AM
Doesn't validif only finish if the result is true?

So the loop will find the first crossbow/firearm with weapon focus?
Farling is offline   #8 Reply With Quote
AndrewD2
Senior Member
 
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975

Old June 1st, 2015, 11:34 AM
Correct
AndrewD2 is offline   #9 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old June 1st, 2015, 02:01 PM
Quote:
Originally Posted by Farling View Post
Doesn't validif only finish if the result is true?

So the loop will find the first crossbow/firearm with weapon focus?
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.
ShadowChemosh is offline   #10 Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 09:45 PM.


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