Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   HL - Pathfinder Roleplaying Game (http://forums.wolflair.com/forumdisplay.php?f=62)
-   -   Help with Weapon Proficiency based on pick list (http://forums.wolflair.com/showthread.php?t=49559)

bertraze June 2nd, 2014 07:08 AM

Help with Weapon Proficiency based on pick list
 
I'm currently working on building out the Machinesmith third-party class, and I'm having trouble with finding examples to cannibalize for one of the class's custom abilities:

Quote:

The machinesmith gains proficiency in a single firearm of his choice. In
addition he gains the Gunsmithing feat as a bonus feat.
There are two things that I want to do that I can't figure out:
  1. How to limit the selection list to only firearms. I can limit it to ranged weapons, but I couldn't find an example of a custom expression to limit the list.
  2. How to assign a weapon proficiency for the chosen weapon. I'm pretty sure it involves assigning WepProf.<thing chosen> to the hero, but I'm having a hard time figuring out the syntax to do that.

bertraze June 2nd, 2014 10:38 AM

I managed to figure out the selection list bit myself. It took me a long time to figure out the right values for Select From (-none-, as All Weapons and Ranged Weapons seem to select ones on the hero), and Restrict First List To (All Things, as it doesn't seem the default is working the same way), but once I figured out that an "expression" really was what it said on the tin, I just needed wCategory.Firearm in order to only get firearms.

bertraze June 2nd, 2014 10:46 AM

My main problem now is that I don't get how to use a tag name that I've constructed (such as "WepProf." & field[usrChosen1].chosen. As far as I know, you can only use literal tag names in assign[].

ShadowChemosh June 2nd, 2014 10:48 AM

Quote:

Originally Posted by bertraze (Post 184583)
I managed to figure out the selection list bit myself. It took me a long time to figure out the right values for Select From (-none-, as All Weapons and Ranged Weapons seem to select ones on the hero), and Restrict First List To (All Things, as it doesn't seem the default is working the same way), but once I figured out that an "expression" really was what it said on the tin, I just needed wCategory.Firearm in order to only get firearms.

Nice! Takes a bit to find what you need at first but it gets easier and easier. Allot of it because LW did a nice job on standards so after awhile you can even "guess" what a tag name is and good chance its correct.

Otherwise using "Debug" and looking at the tags/fields on your character is very useful. If you are not using this yet I recommend watching Video Three from the FAQ on the editor.

Aaron June 2nd, 2014 01:27 PM

Quote:

Originally Posted by bertraze (Post 184586)
My main problem now is that I don't get how to use a tag name that I've constructed (such as "WepProf." & field[usrChosen1].chosen. As far as I know, you can only use literal tag names in assign[].

Use assignstr to assign a tag based on a string. For example:

Code:


      foreach pick in hero from BaseWep where "IsWeapon.wShuriken | IsWeapon.wShurikenM |(Helper.Improvised & wCategory.Range?)"
        ~ Reset the value for this pick
        range = 0

        ~ Set our expanded range.
        range = eachpick.tagvalue[wRangeInc.?] + 20

        ~ Delete the old tag
        perform eachpick.delete[wRangeInc.?]

        ~ Assign the new one
        perform eachpick.assignstr["wRangeInc." & range]

        nexteach


ShadowChemosh June 2nd, 2014 01:35 PM

Quote:

Originally Posted by Aaron (Post 184602)
Use assignstr to assign a tag based on a string.

The only "FYI" about assignstr[] is that if you try and assign a tag that does not exist you will get errors. It will not "dynamically" create the tag for you. I am pretty sure not every single range increment is in HL. So if you try and assign "wRangeInc.21" you will get a script error as 21 does not exist.

If you create the tag and place it on a weapon in the editor then it will be available to assign.

bertraze June 2nd, 2014 02:06 PM

And I finally found an example that tought me how to do what I needed to do: Here is the script on this ability, in case anyone wants to see how pulltags and pushtags works to generate a tag like this:

Code:

~ If we haven't chosen anything, get out now
doneif (field[usrChosen1].ischosen + tagis[Target.?] = 0)

if (field[usrChosen1].ischosen <> 0) then
  perform field[usrChosen1].chosen.pulltags[WepProf.?]

  perform hero.pushtags[WepProf.?]
endif

...and apparently I found something that worked around the same time Aaron was showing me something completely different that worked. Thanks, Aaron!


All times are GMT -8. The time now is 04:30 PM.

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