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)
-   -   Item Power that adds cha to attack and damage help (http://forums.wolflair.com/showthread.php?t=67906)

TheNewProgrammer July 18th, 2023 06:30 PM

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

Pooptickler July 19th, 2023 10:14 AM

Can't you just use the Adjustments tab to change the attack and damage to Charisma?

Mathias July 19th, 2023 10:26 AM

You have lines of code with "perform" and "+=" or "-=" - pick 1 of those, never both.

TheNewProgrammer July 19th, 2023 01:50 PM

Thanks, Mathias. i changed it to
Quote:

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

TheNewProgrammer July 19th, 2023 01:56 PM

I assume it needs to be post-attr in order for it to see the ability scores?

TheNewProgrammer July 19th, 2023 01:57 PM

yes for the attack, no for the damage

Mathias July 19th, 2023 02:26 PM

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

TheNewProgrammer July 19th, 2023 02:29 PM

thanks, i didn't realize it was ranged damage, I wanted to add it to the attack(to-hit)

Mathias July 19th, 2023 02:41 PM

The "dmr" prefix means "DaMage, Ranged"

TheNewProgrammer July 19th, 2023 02:44 PM

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:

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


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.