• 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

Custom Feat Problems

Why do I bang my head against the wall? Because it feels so good when I stop.

I'm trying to create a feat for a special circumstance in our game. What is stumping me is how to add the Charisma bonus on top of the existing save DC for a wizard. (in other words, the DC will be 10+INT+CHA+spell level; it'll only be for enchantments, btw).

I'm sure this will come as a shock, but I'm no coder. At best, I pilfer what I can, rewrite, and insert. So, while the hard-core coders can have a big laugh at my expense, this is what I'm coming up with to do what I want:


~ If we're disabled, do nothing
doneif (tagis[Helper.FtDisable] <> 0)

~ set our focus to the selected pick
call fTargetFoc
doneif (state.isfocus = 0)

field[abValue].value += #attrbonus[aCHA]
focus.field[schDC].value += field[abValue].value

Obviously, this isn't working, otherwise I wouldn't be posting. But at least its not screwing anything else up, either.

So, for my Wizard, is there a way of add that CHA bonus?

Thanks!
 
What phase and timing is your script running at? And I assume you are having the feat choose among spell schools?
 
(in other words, the DC will be 10+INT+CHA+spell level; it'll only be for enchantments, btw).
If its just for enchantments ALWAYS then you can just go right after the Enchantment school instead of doing the focus to it. The focus and logic would be if you are allowing a drop down box of choices of different schools of magic.

I am not near HL so I don't know the correct Thing ID but the script would look like this and you would want to run in Post-Attributes/10000. This gives time for the Cha value to be calculated.
Code:
~ Increase the DC of the Enchantment by the Charisma Bonus
hero.child[Enchantment_School_ID].field[schDC].value += #attrbonus[aCHA]

@Aaron - Not to butt in. I had my post written but not submitted for awhile and didn't see you had responded.....
 
I'm sorry, but I could not respond any sooner.

I've tried the suggestions that you've posted, but I'm not having any luck. A few moments ago, I ran with your suggestions and when I tested the package, I ended up with this error:

Screen Shot 2014-03-25 at 1.57.42 PM.png

So, when I look at the eval script window...here's what I have:

Screen Shot 2014-03-25 at 1.58.01 PM.png

Soooo…what am I doing wrong? I'll bet its some minor thing, like inserting a period in the wrong place or something.

Thanks for your help!
 
I'm sorry, but I could not respond any sooner.

I've tried the suggestions that you've posted, but I'm not having any luck. A few moments ago, I ran with your suggestions and when I tested the package, I ended up with this error:


So, when I look at the eval script window...here's what I have:


Soooo…what am I doing wrong? I'll bet its some minor thing, like inserting a period in the wrong place or something.

Thanks for your help!

Where you have "[Enchantment_School_ID]," replace it with "[wsEnchant]"

I can't promise that'll fix it but that is what I see with my limited skills.
 
How do I reset the Phase? or to change it to PostAttr?

BTW, using [wsEnchant] yielded this new error:

Screen Shot 2014-03-25 at 2.32.44 PM.png
 
Last edited:
At the top of the Eval Scripts box, above where you input the scripts, is a dropdown menu next to the work Phase: This is where you would select PostAttr at, next to that is the Priority:
 
At the top of the Eval Scripts box, above where you input the scripts, is a dropdown menu next to the work Phase: This is where you would select PostAttr at, next to that is the Priority:

Wow! Never noticed that before. Thanks!

Now, if only I could get the script to work...

:)
 
Ah, I think I see it... Again, limited skills here but you have "hero.child" as the start of your script to locate the Enchantment DC... I think it should instead be "hero.childfound"
 
Why is attrbonus[aCHA] on the next line down and indented? it should be immedietly right of +=

The reason you're getting the error is because the program is going "add.... what? What? OMG I DON'T UNDERSTAND! WHAT I AM SUPPOSED TO ADD, I NEED SOMETHING TO THE RIGHT OF +=, PLEASE JUST END IT! PUT ME OUT OF MY MISERY!"

Because computers are total drama queens like that.
 
Sorry, I didn't refresh this post before I submitted to see that indeed Aaron and AndrewD2 had already given you the fix... But here it is, I just finished testing it and it is working as intended so long as it is one complete string of code.

Code:
[B]Post-attributes; priority: 10000[/B]
   hero.child[ssEnchant].field[schDC].value += #attrbonus[aCHA]
 
Last edited:
Awesome! Thanks! I had a few other things to manipulate in the process as well, but this was the part that was really giving me a headache.

All of you rock!
 
Back
Top