• 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

Item Power that adds cha to attack and damage help

TheNewProgrammer

Active member
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
 
Thanks, Mathias. i changed it to
perform parent.assign[DamageOpt.aCHA]

parent.field[dmrBonus].value -= hero.child[aSTR].field[aModBonus].value

parent.field[dmrBonus].value += hero.child[aCHA].field[aModBonus].value

I no longer get an error, but the attack bonus on the weapon is still not added. I think I need to change the priority from (post-attr,100000,1) but I don't know to what
 
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).
 
using trial and error I deduce dmmBonus refers to the melee damage bonus, and from there I got atmBonus and that means that this

perform parent.assign[DamageOpt.aCHA]

parent.field[atmBonus].value -= hero.child[aSTR].field[aModBonus].value

parent.field[atmBonus].value += hero.child[aCHA].field[aModBonus].value

replaces the bonus to damage from strength to charisma, and the bonus to attack from strength to charisma.

Thank you
 
Here's how we intend for you to find that out, without trial and error - first, in the Develop menu, make sure you have "Enable Data File Debugging" turned on, and then right-click a test weapon, and choose "Show debug fields for Dagger", then find the field you're interested in, and there will also be a Name column for that field, in addition to its Id and its value.
 
Back
Top