Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - d20 System

Notices

Reply
 
Thread Tools Display Modes
chiefweasel
Senior Member
 
Join Date: Aug 2008
Location: Miamisburg, OH
Posts: 1,321

Old January 25th, 2009, 07:43 PM
I am using the same script pulled from weapon focus, but even using that, it doesnt add a +1 to the weapon chosen.
chiefweasel is offline   #11 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 12,587

Old January 25th, 2009, 08:00 PM
Adding a damage bonus to all ranged weapons is going to be complex.

You'll need a foreach...nexteach loop to cycle through every ranged weapon on the hero. Since it already needs a foreach to modify the damage and range increment, might as well directly modify the weapon's attack bonus while we're there.

timing: UserPreLv, 100

Code:
 
foreach pick in hero where "wCategory.Range?"
   eachpick.field[wAttBonus].value +=2
   eachpick.field[wDamBonus].value +=2
   eachpick.field[wRangeInc].value +=20
nexteach
Explaining everything in that script:
wCategory.Range? finds both wCategory.RangeProj (projectile weapons) and wCategory.RangeThrow (throwing weapons), and putting in the "?" wildcard allows the foreach loop to find both types of ranged weapons (but not wCategory.Melee or wCategory.Unarmed).

Each line starts with "eachpick", which changes the context to whatever selection the foreach loop is currently working on.

The "Reference Information" page I mentioned earlier, at the bottom, details weapons, which is where I found the specific fields I wanted to modify.
Mathias is online now   #12 Reply With Quote
chiefweasel
Senior Member
 
Join Date: Aug 2008
Location: Miamisburg, OH
Posts: 1,321

Old January 25th, 2009, 08:12 PM
That seems to have done the trick, thank you. Now I can sue the same code to make some other changes I have been working at as well. Thanks again.
chiefweasel is offline   #13 Reply With Quote
Reply

Thread Tools
Display Modes

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 08:20 AM.


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