Lone Wolf Development Forums  

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

Notices

Reply
 
Thread Tools Display Modes
Provos
Senior Member
 
Join Date: Mar 2011
Location: USA
Posts: 171

Old February 7th, 2020, 07:37 PM
I am looking to add a bunch of adjustment to speed up my gameplay a bit. Does all bonus damage stack and not need to be typed for example Spell: Prayer has luck to hit but untyped to damage?
Prayer (not full script)
Code:
 ~ Add to our damage bonus
      hero.child[Damage].field[tDamBonus].value = maximum(hero.child[Damage].field[tDamBonus].value, 1)

      ~ Add to our attack bonus
      hero.child[Attack].field[Bonus].value = maximum(hero.child[Attack].field[BonLuck].value, 1)
But I need a bit of help on some details for the eval scripts. I am looking to add Rapid shot, Spell: Blessed Aim (moral bonus),

Knowledge Devotion (have to make this insight bonus but not sure how)
Code:
      ~ If we're not enabled, get out now
      doneif (field[pIsOn].value = 0)
    
	 ~ Add to our damage bonus
      hero.child[Damage].field[tDamBonus].value = maximum(hero.child[Damage].field[tDamBonus].value, field[pAdjust].value)
I will add the more questions as each gets answered as to keep the discussion organized.
Provos is offline   #1 Reply With Quote
Sendric
Senior Member
 
Join Date: Jul 2010
Posts: 2,813

Old February 10th, 2020, 04:40 AM
Quote:
Originally Posted by Provos View Post
I am looking to add a bunch of adjustment to speed up my gameplay a bit. Does all bonus damage stack and not need to be typed for example Spell: Prayer has luck to hit but untyped to damage?
Prayer (not full script)
Code:
 ~ Add to our damage bonus
      hero.child[Damage].field[tDamBonus].value = maximum(hero.child[Damage].field[tDamBonus].value, 1)

      ~ Add to our attack bonus
      hero.child[Attack].field[Bonus].value = maximum(hero.child[Attack].field[BonLuck].value, 1)
Not all bonuses stack (they stack as they would in pen and paper).

All the bonuses supplied by Prayer are Luck bonuses, so you should use the BonLuck field for Damage as well as Attack.

(For the record, this adjustment already exists in the community set.)

Quote:
Originally Posted by Provos View Post
But I need a bit of help on some details for the eval scripts. I am looking to add Rapid shot, Spell: Blessed Aim (moral bonus),

Knowledge Devotion (have to make this insight bonus but not sure how)
Code:
      ~ If we're not enabled, get out now
      doneif (field[pIsOn].value = 0)
    
	 ~ Add to our damage bonus
      hero.child[Damage].field[tDamBonus].value = maximum(hero.child[Damage].field[tDamBonus].value, field[pAdjust].value)
I will add the more questions as each gets answered as to keep the discussion organized.
I'm not entirely sure what the question(s) here is/are, but the field for Insight bonus is BonInsight.

To find all the fields on Damage, go to your portfolio and select the following in the menu:

Develop -> Floating Info Windows -> Show Selection Fields -> Damage
Sendric is offline   #2 Reply With Quote
Provos
Senior Member
 
Join Date: Mar 2011
Location: USA
Posts: 171

Old February 10th, 2020, 10:19 PM
I'm aware prayer exists already but in the code the damage is untyped. I know how the damage in 3.5 are supposed to stack but sometimes when having insight, luck, other bonuses on at the same time they do not add up.

Thanks for the info on the floating window info as it will hopefully help in troubleshooting.
Provos is offline   #3 Reply With Quote
Sendric
Senior Member
 
Join Date: Jul 2010
Posts: 2,813

Old February 11th, 2020, 04:30 AM
Quote:
Originally Posted by Provos View Post
I'm aware prayer exists already but in the code the damage is untyped. I know how the damage in 3.5 are supposed to stack but sometimes when having insight, luck, other bonuses on at the same time they do not add up.
Hmm...that seems like a bug then. I'll look into it. Thanks.

Fixed. For reference, the best way to provide bonuses such as this is as such:

Code:
    #applybonus[BonLuck,hero.child[Attack],1]
Also note you should only use "hero.child" with things you know will always be on the hero (such as Attack). Otherwise, use "hero.childfound". This will help reduce errors.

Last edited by Sendric; February 12th, 2020 at 04:36 AM.
Sendric is offline   #4 Reply With Quote
Provos
Senior Member
 
Join Date: Mar 2011
Location: USA
Posts: 171

Old February 19th, 2020, 04:15 AM
I updated my Knowledge Devotion script


You are affected by a Knowledge Devotion (Ex) ability.
Calculated effects: Insight bonus to attack and damage rolls.
Code:
      ~ If we're not enabled, get out now
      doneif (field[pIsOn].value = 0)
    
      ~ Add a Insight bonus to our attack
	#applybonus[BonInsight, hero.child[Attack], 1]

      ~ Add a bonus to our damage
	 ~ Add to our damage bonus
       hero.child[Damage].field[tDamBonus].value = maximum(hero.child[Damage].field[tDamBonus].value, field[pAdjust].value)
Provos is offline   #5 Reply With Quote
Provos
Senior Member
 
Join Date: Mar 2011
Location: USA
Posts: 171

Old February 19th, 2020, 04:21 AM
An example of the bonus error.
My cleric using a +1 Longbow (Str 3) has
+7 to hit and does 1d8+4 damage base.
He casts Divine Favor (luck bonus) +2 for his level
+9 to hit 1d8+6 damage
Uses Knowledge Devotion (insight bonus) +4 by rolling
+13 to hit and 1d8+8 damage (missing 2 damage)
Provos is offline   #6 Reply With Quote
Sendric
Senior Member
 
Join Date: Jul 2010
Posts: 2,813

Old February 19th, 2020, 05:56 AM
Quote:
Originally Posted by Provos View Post
Code:
 
	 ~ Add to our damage bonus
       hero.child[Damage].field[tDamBonus].value = maximum(hero.child[Damage].field[tDamBonus].value, field[pAdjust].value)
change to:
Code:
    #applybonus[BonInsight,hero.child[Damage],field[pAdjust].value]
Sendric is offline   #7 Reply With Quote
Provos
Senior Member
 
Join Date: Mar 2011
Location: USA
Posts: 171

Old February 19th, 2020, 07:17 AM
Thanks that seems to fix this.

I copied that code for damage from another Adjustment. That's what most of my edit for Hero Lab are find an example and duplicate.

I was looking to add Rapid Shot to the Adjustments but it looks like Kendell DM created one that was never added to the community files.

<<Post-Levels (Users) 10000>>

Code:
~ If we're not selected, get out now.
doneif (field[hIsOn1].value = 0)

~ Add extra attack and apply rapid shot penalty.
foreach pick in hero from BaseWep where "thingid.w? & wCategory.Range?"
  if (eachpick.tagis[Helper.ExtraHigh] = 0) then
    eachpick.field[wAttack].value -= 2
    perform eachpick.assign[Helper.ExtraHigh]
  endif
nexteach

Last edited by Provos; February 19th, 2020 at 08:41 AM.
Provos is offline   #8 Reply With Quote
Sendric
Senior Member
 
Join Date: Jul 2010
Posts: 2,813

Old February 19th, 2020, 08:46 AM
Quote:
Originally Posted by Provos View Post
Thanks that seems to fix this.

I copied that code for damage from another Adjustment. That's what most of my edit for Hero Lab are find an example and duplicate.
90% of my scripts are also copy and paste as I have a hard time remembering everything. The biggest thing is understanding what you're copying. This script:

Code:
hero.child[Damage].field[tDamBonus].value = maximum(hero.child[Damage].field[tDamBonus].value, field[pAdjust].value)
Means:

Set the field tDamBonus equal to itself or field[pAdjust], whichever is higher. This means if *anything* else on the character adjusts that field, you may not get the desired result.

During one of ShadowChemosh's d20 updates, he added the individual bonus fields so that it would be easier to stack bonuses. In general, that means anything scripted before that change was inherently limited and may not be the best means to accomplish what you're looking to do. Just something to keep in mind as you go along.
Sendric is offline   #9 Reply With Quote
Sendric
Senior Member
 
Join Date: Jul 2010
Posts: 2,813

Old February 19th, 2020, 08:48 AM
Quote:
Originally Posted by Provos View Post
I was looking to add Rapid Shot to the Adjustments but it looks like Kendell DM created one that was never added to the community files.

<<Post-Levels (Users) 10000>>

Code:
~ If we're not selected, get out now.
doneif (field[hIsOn1].value = 0)

~ Add extra attack and apply rapid shot penalty.
foreach pick in hero from BaseWep where "thingid.w? & wCategory.Range?"
  if (eachpick.tagis[Helper.ExtraHigh] = 0) then
    eachpick.field[wAttack].value -= 2
    perform eachpick.assign[Helper.ExtraHigh]
  endif
nexteach
I would assume the feat itself already has this which is why there would be no adjustment for it. I'll check into it to verify.

Looks like I was wrong. There's no script. I'll update the feat now.

Last edited by Sendric; February 19th, 2020 at 08:58 AM.
Sendric 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 10:34 AM.


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