• 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

Help with Weapon Proficiency based on pick list

bertraze

Active member
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:

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.
 
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.
 
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[].
 
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.
 
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
 
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.
 
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!
 
Last edited:
Back
Top