• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Field for melee damage bonus

Bob G

Well-known member
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
 
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.
 
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?
 
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".
 
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.
 
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.
 
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).
 
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
 
Back
Top