Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Pathfinder Roleplaying Game

Notices

Reply
 
Thread Tools Display Modes
Bob G
Senior Member
 
Join Date: Nov 2017
Location: Trafford, PA, USA
Posts: 226

Old December 3rd, 2017, 04:28 PM
Hi again, trying to apply a bonus to melee damage for a custom ability, and I'm having trouble trying to point the eval script to the correct field. I currently am using:

#applybonus[BonMorale,hero.child[Damage],field[abValue].value]

But this applies the bonus to all damage, both ranged and melee. What do I need to change to make this bonus apply only to melee damage?

Thanks^6
Bob G is offline   #1 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old December 3rd, 2017, 09:07 PM
Go to the menu "Develop->Floating Info Window->Show Selection Fields". In the new window search for "Damage" and select "Damage Bonus" and press "OK".

You will then get a new window that shows every field on the Damage Pick. Do any of these other fields look like a Melee Damage.

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   #2 Reply With Quote
Bob G
Senior Member
 
Join Date: Nov 2017
Location: Trafford, PA, USA
Posts: 226

Old December 4th, 2017, 06:37 AM
Quote:
Originally Posted by ShadowChemosh View Post
Go to the menu "Develop->Floating Info Window->Show Selection Fields". In the new window search for "Damage" and select "Damage Bonus" and press "OK".

You will then get a new window that shows every field on the Damage Pick. Do any of these other fields look like a Melee Damage.
There is a bonus listed (dmmBonus), but when I plug that into the script, I get an error: "Syntax error in 'eval' script Thing 'cBLoBlaDri' (Eval script #1) on line 9 -> Non-existent thing 'dmmBonus' used by script.

The script reads: #applybonus[BonMorale,hero.child[dmmBonus],field[abValue].value]

How should I be scripting it?
Bob G is offline   #3 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old December 4th, 2017, 10:13 AM
Quote:
Originally Posted by Bob G View Post
There is a bonus listed (dmmBonus), but when I plug that into the script, I get an error: "Syntax error in 'eval' script Thing 'cBLoBlaDri' (Eval script #1) on line 9 -> Non-existent thing 'dmmBonus' used by script.

The script reads: #applybonus[BonMorale,hero.child[dmmBonus],field[abValue].value]

How should I be scripting it?
#applybonus has three Parts/sections to it:
1) FIELD name
2) Pick
3) Value

So "Damage" is the Pick which contains the "FIELDS" you saw in the Debug window.

Based on this what you want is:
Code:
~ Give a Melee Only Damage Bonus
#applybonus[dmmBonus,hero.child[Damage],field[abValue].value]
Their is a difference between a Pick, Thing, Tags and Fields and its very useful to know it as you do more in the scripts. Also useful for figuring out what each macro or function is asking for.

Take a look at Glossary of Terms for the Editor. You may find it helpful now that you have done more scripting.

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   #4 Reply With Quote
Aaron
Senior Member
 
Join Date: Oct 2011
Posts: 6,793

Old December 4th, 2017, 10:08 AM
There are 3 parameters in that macro, each seperated by a ",". The first is the field you want to apply the bonus to, the second is the pick on which that field is present, and the third is the amount of the bonus. Your 2nd parameter is listing a field instead of a pick.

If this is a morale bonus to melee damage, the field you want is not dmmBonus. "dm" stands for "damage", the third "m" is for "melee", and the last bit is the bonus type. If you look through the list of fields you should see one which is specifically morale, "dmmBonMora".
Aaron is offline   #5 Reply With Quote
Bob G
Senior Member
 
Join Date: Nov 2017
Location: Trafford, PA, USA
Posts: 226

Old December 4th, 2017, 11:52 AM
Thanks Aaron and Shadow. I think I understand the structure of macros a little better now. I used the script SC provided, it works, and it makes sense now.
Bob G is offline   #6 Reply With Quote
Aaron
Senior Member
 
Join Date: Oct 2011
Posts: 6,793

Old December 4th, 2017, 02:06 PM
Quote:
Originally Posted by Bob G View Post
Thanks Aaron and Shadow. I think I understand the structure of macros a little better now. I used the script SC provided, it works, and it makes sense now.
Is the bonus intended to be typed or untyped? It is important for stacking. If the bonus is untyped, then it is supposed to stack with all other bonuses, and dmmBonus is the correct field but you should not be using the macro (as that will stack incorrectly with others).
Aaron is offline   #7 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old December 4th, 2017, 03:20 PM
Quote:
Originally Posted by Aaron View Post
Is the bonus intended to be typed or untyped? It is important for stacking. If the bonus is untyped, then it is supposed to stack with all other bonuses, and dmmBonus is the correct field but you should not be using the macro (as that will stack incorrectly with others).
Thanks! I was going to go down this next actually. #applybonus[] should only be used for Non-stacking bonuses (ie Named Bonuses like enhancement bonuses or luck bonsues).

For bonuses that all stack Bob G you should just ADD in the bonus like so:
Code:
~ Give a untyped bonus to Melee damage
hero.child[Damage].field[dmmBonus].value += field[abValue].value

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   #8 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:03 AM.


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