Item Power that adds cha to attack and damage help
hello,
I am making a custom sorcerer bloodline using the HLC editor. I am attempting to make a custom Item power that causes the weapon to use cha for attack and damage. I found this thread http://forums.wolflair.com/showthread.php?t=56620 and this line "perform parent.assign[DamageOpt.aCHA]" I got as far as this with my knowledge "perform parent.assign[DamageOpt.aCHA] perform parent.field[dmrBonus].value -= hero.child[aStr].field[aModBonus].value perform parent.field[dmrBonus].value += hero.child[aCha].field[aModBonus].value" This is supposed to use cha instead of strength, reduce the to hit by the str and then increase it by cha. It gives the error "syntax error in "eval" script for thing "SBWeaponEnch"(its id) on line 3 -> error in expression." does anyone know the correct syntax? also, does anyone know how to make It say cha instead of str? the end users (other than me) will complain otherwise. thanks |
Can't you just use the Adjustments tab to change the attack and damage to Charisma?
|
You have lines of code with "perform" and "+=" or "-=" - pick 1 of those, never both.
|
Thanks, Mathias. i changed it to
Quote:
|
I assume it needs to be post-attr in order for it to see the ability scores?
|
yes for the attack, no for the damage
|
You've got two things going on. First, you are applying a tag to the weapon to say "this has the option of using Charisma for damage, if charisma is better" - that line needs to be before the attribute calculations, because you are instructing the program to figure out whether charisma or strength is better, and use whichever of those is better, and the instruction needs to be in place before HL checks how it should do the automatic calculation of the damage.
Then, you have a second thing going on - you're subtracting the strength bonus from ranged damage (but not melee damage), then adding the charisma bonus (again, to ranged damage). These lines need to be after the attributes are calculated, but before the final damage on the weapon is totalled. So as far as I can tell, you're going to end up with twice the charisma bonus at the end - I'd recommend only using the tag, because by triggering the automated mechanism, you get the right handling for when you add half strength to a weapon in certain circumstances, or 1.5x strength on weapons like a T-rex's bite (I think there are some PC weapons that have that, too). |
thanks, i didn't realize it was ranged damage, I wanted to add it to the attack(to-hit)
|
The "dmr" prefix means "DaMage, Ranged"
|
using trial and error I deduce dmmBonus refers to the melee damage bonus, and from there I got atmBonus and that means that this
Quote:
Thank you |
All times are GMT -8. The time now is 05:12 PM. |
Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.