Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   HL - d20 System (http://forums.wolflair.com/forumdisplay.php?f=46)
-   -   +1 to attack and Damage (http://forums.wolflair.com/showthread.php?t=8175)

chiefweasel January 25th, 2009 05:44 PM

+1 to attack and Damage
 
I was looking to add a new feat, which give a + to attack and damage, but was having a hard time finding the code to do so. I pulled up the code for a feat that gives + to attack, but just cant find where the code says to give it. same for the + to damage, just cant find the code to allow this to occur.

Anyone know how to do this? Thanks.

Mathias January 25th, 2009 05:49 PM

The code is in the "Eval Scripts" button.

Start with the help file accessed by pressing help within the editor. The "Reference Information" section is where attack and defense are covered.

chiefweasel January 25th, 2009 05:56 PM

Check there, I see the code, but dont see the actual number that is being used as the increase. I am looking at the feat, Weapon Focus, which gives a +1 to attack. But I dont see the number 1 used in the code anywhere.

Mathias January 25th, 2009 06:14 PM

Don't start from weapon focus - it works by adding a tag to the weapon, which in the weapon's own calculations gives the bonus to hit.

chiefweasel January 25th, 2009 06:18 PM

Not quite following you here. The weapons dont have any bonus to them yet, they need to be added with feats like weapon focus. Weapon focus gives a +1 attack, where does it assign the +1?

Mathias January 25th, 2009 06:20 PM

I'd start with something like improved initiative - that way, you can see how the script adds a bonus to initiative.

Then, in the help, you'll find how to modify the +initiative code to be +attack or +damage code.

chiefweasel January 25th, 2009 06:42 PM

k, I messed with trying the Improve Init and changed the Thing to the range attack, but no effect.

It am still confused how Weapon Focus adds the attack value in. I just dont see it in the feat anywhere. Any idea how it assigns a +1 to the chosen weapon?

Mathias January 25th, 2009 06:58 PM

The relevant line in weapon focus is:
result = eachpick.assign[Broadcast.WepFocus]

What the script in weapon focus does is to find each weapon your character carries that matches the weapon type you have focus in, and assign it the Broadcast.WepFocus tag.

Later, when it comes time for the weapon to calculate its attack bonus, it performs its own calculations, looking up everything it needs; for example its enhancement bonus, the character's BAB, etc., and then it adds +1 to hit if the Broadcast.WepFocus tag is present.

There's currently a bug in "Test Now" - it won't load the script of the tested thing. You'll need to use ctrl-r "Reload All" to get the script loaded. Is that the reason your new script isn't working?

Timing is also important in scripts, but I checked, and the Improved Initiative script runs at Pre-Level 5000. The adjustment "Attack Bonus (Ranged)" runs at Pre-Level 10,000, so that shouldn't be a problem.

chiefweasel January 25th, 2009 07:10 PM

It does error off when I try the Cntrl-r. So the script isnt working. I do need to assign a +2 for the feat I am working with (Range Weapon Mastery - PH2). The feat give a +2 to attack and +2 to damage and adds +20 to the range increment.

Even using the script from weapon focus, it would give me a +1 ont, and to attack only.

It seems that this is a huge area of development that was over looked. You should easily be able to assign a + to an attack or damage. Even in the inply adjustments, there is no way to add damage to a weapon. Just seems much more difficult then it needs to be. (Sorry for the rant)

Mathias January 25th, 2009 07:40 PM

What's your script? I know I make a number of typos when coding for HL, but I've gotten used to finding them and fixing them with experience, maybe I can help.


All times are GMT -8. The time now is 11:25 AM.

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