Junior Member
Join Date: Jul 2023
Posts: 22
|
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 |
#1 |
Senior Member
Join Date: Nov 2015
Posts: 144
|
Can't you just use the Adjustments tab to change the attack and damage to Charisma?
|
#2 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
You have lines of code with "perform" and "+=" or "-=" - pick 1 of those, never both.
|
#3 |
Junior Member
Join Date: Jul 2023
Posts: 22
|
Thanks, Mathias. i changed it to
Quote:
|
|
#4 |
Junior Member
Join Date: Jul 2023
Posts: 22
|
I assume it needs to be post-attr in order for it to see the ability scores?
|
#5 |
Junior Member
Join Date: Jul 2023
Posts: 22
|
yes for the attack, no for the damage
|
#6 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
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). |
#7 |
Junior Member
Join Date: Jul 2023
Posts: 22
|
thanks, i didn't realize it was ranged damage, I wanted to add it to the attack(to-hit)
|
#8 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
The "dmr" prefix means "DaMage, Ranged"
|
#9 |
Junior Member
Join Date: Jul 2023
Posts: 22
|
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 |
|
#10 |
|
|