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, 05:44 PM
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.
chiefweasel is offline   #1 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 12,582

Old 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.
Mathias is offline   #2 Reply With Quote
chiefweasel
Senior Member
 
Join Date: Aug 2008
Location: Miamisburg, OH
Posts: 1,321

Old 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.
chiefweasel is offline   #3 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 12,582

Old 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.
Mathias is offline   #4 Reply With Quote
chiefweasel
Senior Member
 
Join Date: Aug 2008
Location: Miamisburg, OH
Posts: 1,321

Old 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?
chiefweasel is offline   #5 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 12,582

Old 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.
Mathias is offline   #6 Reply With Quote
chiefweasel
Senior Member
 
Join Date: Aug 2008
Location: Miamisburg, OH
Posts: 1,321

Old 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?
chiefweasel is offline   #7 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 12,582

Old 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.

Last edited by Mathias; January 25th, 2009 at 07:03 PM. Reason: Re-phrasing
Mathias is offline   #8 Reply With Quote
chiefweasel
Senior Member
 
Join Date: Aug 2008
Location: Miamisburg, OH
Posts: 1,321

Old 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)
chiefweasel is offline   #9 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 12,582

Old 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.
Mathias is offline   #10 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 06:02 AM.


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