Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   HL - Pathfinder Roleplaying Game (http://forums.wolflair.com/forumdisplay.php?f=62)
-   -   Field for melee damage bonus (http://forums.wolflair.com/showthread.php?t=59693)

Bob G December 3rd, 2017 04:28 PM

Field for melee damage bonus
 
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

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

Bob G December 4th, 2017 06:37 AM

Quote:

Originally Posted by ShadowChemosh (Post 259787)
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?

Aaron 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".

ShadowChemosh December 4th, 2017 10:13 AM

Quote:

Originally Posted by Bob G (Post 259807)
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.

Bob G 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.

Aaron December 4th, 2017 02:06 PM

Quote:

Originally Posted by Bob G (Post 259822)
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).

ShadowChemosh December 4th, 2017 03:20 PM

Quote:

Originally Posted by Aaron (Post 259828)
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



All times are GMT -8. The time now is 03: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.