• 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

Bonus on Weapon Groups

Angela2013

Well-known member
I am looking to write a script to add a bonus to a weapon group. Could I get some help or at least point me in the right direction. My script-fu is weak.
 
You will need to do a "foreach" loop through all the Base Weapons. Then specifically for those in a specific Fighter Group. The fighter group's are set by "tags" on the weapons.

Also you list bonus which is it a specific "named" type and does it add to hit and damage? I "assume" for now its a generic bonus to hit and damage:

Also feel free to look at THIS post as it has more detailed information.

Pre-Levels/10000
Code:
[B][COLOR="Green"]~ Loop through all weapons of a specific fighter type[/COLOR][/B]
foreach pick in hero from BaseWep where "[B][COLOR="Red"]ENTER YOUR SEARCH TAGS HERE[/COLOR][/B]"
   [B][COLOR="Green"]~ Set the bonus on each weapon found[/COLOR][/B]
   eachpick.field[Bonus].value += 1
nexteach
Here is part of the script to get you started but you will need to fill in search "tags" (the section in red that says "ENTER YOUR SEARCH TAGS HERE") needs to be replaced.

You can add a weapon to your character and then view its "tags" to get the fighter weapon tag you are trying to give the bonus too.

I also assumed a bonus of "+1" as you didn't mention how much to give. But it should give you a good starting point. :)
 
Last edited:
+1 is the right bonus. I am adding the bonus to Light Blades. I hope this is the right search tag.

Pre-Levels 10000

~ Loop through all weapons of a specific fighter type
foreach pick in hero from BaseWep where "wClass.BladeLight"
~ Set the bonus on each weapon found
perform eachpick.field[Bonus].value += 1
nexteach

When I add this script though I get the following:

Hero Lab was forced to stop compilation after the following errors were detected:

Syntax error in 'eval' script for Thing 'trArc1' (Eval Script '#2') on line 4
-> Error in string expression
 
Ok the script compiles now. But when I add the trait to the character to give it a +1 bonus with light blades nothing happens. When I add a variety of heavy blades and light blades to the test 1st- level human fighter I get a +1 attack roll for all weapons when light blades should be a +2.
 
Back
Top