Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Pathfinder Roleplaying Game
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
frumple
Senior Member
 
Join Date: Nov 2011
Location: South Riding, VA
Posts: 841

Old February 1st, 2012, 04:36 AM
I am trying to add an ability that when activated adds the character's CHA modifer to attack rolls. I am having issues with the proper timing for the script.

Here is the code:
Code:
~ If we're not shown, just get out now
      doneif (tagis[Helper.ShowSpec] = 0)

~ If we're not enabled, get out now
      doneif (field[abilActive].value = 0)

var bon as number
bon = hero.child[aCHA].field[aModBonus].value

#applybonus[Bonus, hero.child[Attack], bon]
I have tried various timings (First/10000, Pre-Levels/5000, Post-Levels/5000, Post-Attributes/5000) but none seem to work.
frumple is offline   #1 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old February 1st, 2012, 06:59 AM
You shouldn't use the #applybonus macro on the Bonus field - Bonus is for bonuses that DO stack with each other. Just use addition to add to Bonus.
Mathias is online now   #2 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old February 1st, 2012, 09:23 AM
Code:
~ If we're not shown, just get out now
doneif (tagis[Helper.ShowSpec] = 0)

~ If we're not enabled, get out now
doneif (field[abilActive].value = 0)

~ Give Cha bonus to attack
hero.child[Attack].field[Bonus].value += hero.child[aCHA].field[aModBonus].value
As Mathias said the #applybonus is not a good idea in this case. Inside the macro it is doing logic that only applies the BIGGEST value to the field.

So in example:
Code:
#applybonus[Bonus, hero.child[Attack], bon]
is really saying:
Code:
~ Our Bonus is biggest of the two fields
hero.child[Attack].field[Bonus].value = maximum(hero.child[Attack].field[Bonus].value,bon)

Hero Lab Resources:
Pathfinder - d20pfsrd and Pathfinder Pack Setup
3.5 D&D (d20) - Community Server Setup
5E D&D - Community Server Setup
Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources.
Created by the community for the community
- Realm Works kickstarter backer (Alpha Wolf) and Beta tester.
- d20 HL package volunteer editor.
ShadowChemosh is offline   #3 Reply With Quote
frumple
Senior Member
 
Join Date: Nov 2011
Location: South Riding, VA
Posts: 841

Old February 1st, 2012, 10:45 AM
Ok. Thanks. However, the timing of the script still seems to be an issue. I can get the bonus in the Bonus field during Post-Attributes, but it doesn't propagate to the attack bonus.
frumple is offline   #4 Reply With Quote
frumple
Senior Member
 
Join Date: Nov 2011
Location: South Riding, VA
Posts: 841

Old February 1st, 2012, 10:59 AM
Ahh I think I see the problem. I need to add the bonus to child[attack].field[tAtk] not to Bonus
frumple is offline   #5 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old February 1st, 2012, 11:11 AM
Quote:
Originally Posted by frumple View Post
Ahh I think I see the problem. I need to add the bonus to child[attack].field[tAtk] not to Bonus
Hmm not near HL but that seems wrong some how. Have you looked at the Paladins Smite Evil Class Special? It has a way to activate and give a Cha bonus to attack rolls. Check its timing and code.

I am lazy and like just copying code that works.

Hero Lab Resources:
Pathfinder - d20pfsrd and Pathfinder Pack Setup
3.5 D&D (d20) - Community Server Setup
5E D&D - Community Server Setup
Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources.
Created by the community for the community
- Realm Works kickstarter backer (Alpha Wolf) and Beta tester.
- d20 HL package volunteer editor.
ShadowChemosh is offline   #6 Reply With Quote
frumple
Senior Member
 
Join Date: Nov 2011
Location: South Riding, VA
Posts: 841

Old February 1st, 2012, 04:04 PM
Yeah. That is how I figured it out. The Smite Good/Evil class feature is timed at Post-Attribute, but applies the bonus to tAtk.

I think the problem is that you need to be at Post-Attribute to get the attribute bonus, but the attack values are calculated before that.
frumple is offline   #7 Reply With Quote
Reply


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 11:21 AM.


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