Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Pathfinder Roleplaying Game
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
TheNewProgrammer
Junior Member
 
Join Date: Jul 2023
Posts: 22

Old July 18th, 2023, 06:30 PM
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
TheNewProgrammer is offline   #1 Reply With Quote
Pooptickler
Senior Member
 
Join Date: Nov 2015
Posts: 144

Old July 19th, 2023, 10:14 AM
Can't you just use the Adjustments tab to change the attack and damage to Charisma?
Pooptickler is offline   #2 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old July 19th, 2023, 10:26 AM
You have lines of code with "perform" and "+=" or "-=" - pick 1 of those, never both.
Mathias is offline   #3 Reply With Quote
TheNewProgrammer
Junior Member
 
Join Date: Jul 2023
Posts: 22

Old 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 is offline   #4 Reply With Quote
TheNewProgrammer
Junior Member
 
Join Date: Jul 2023
Posts: 22

Old July 19th, 2023, 01:56 PM
I assume it needs to be post-attr in order for it to see the ability scores?
TheNewProgrammer is offline   #5 Reply With Quote
TheNewProgrammer
Junior Member
 
Join Date: Jul 2023
Posts: 22

Old July 19th, 2023, 01:57 PM
yes for the attack, no for the damage
TheNewProgrammer is offline   #6 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old 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).
Mathias is offline   #7 Reply With Quote
TheNewProgrammer
Junior Member
 
Join Date: Jul 2023
Posts: 22

Old 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)
TheNewProgrammer is offline   #8 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old July 19th, 2023, 02:41 PM
The "dmr" prefix means "DaMage, Ranged"
Mathias is offline   #9 Reply With Quote
TheNewProgrammer
Junior Member
 
Join Date: Jul 2023
Posts: 22

Old 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
TheNewProgrammer is offline   #10 Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 01:36 PM.


Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.