Member
Join Date: Sep 2013
Location: Raleigh, NC
Posts: 43
|
I'm attempting to add a version of the "Daring" Rogue Talent as a Custom Ability (I only have the core PF package). The only problem I'm having is trying to get it to display the +n bonus to Will saves vs Fear. I tried copying the code from the Bravery ability, and which gave me this eval script at Render 1000:
field[livename].text = "Daring +" & field[abValue].value(I'd already computed field[abValue].value at the Post-levels stage). However, this generates the error "Attempt to access filed 'listname' that does not exist for thing 'cMGDaring'". Any pointers as to where I'm going off the rails? |
#1 |
Senior Member
Join Date: Oct 2011
Posts: 6,793
|
listname is only a field that exists on class specials, so you must exclude it from that script if you are adapting it to a custom special.
|
#2 |
Member
Join Date: Sep 2013
Location: Raleigh, NC
Posts: 43
|
Ah - didn't know that, but makes sense why it wouldn't work. Is there something equivalent for Custom Specials? When it comes to getting stuff to display on the character sheet, I'm pretty much flying blind.
|
#3 |
Senior Member
Join Date: Oct 2011
Posts: 6,793
|
Custom specials show their livename in the program, and the sbName in output statblocks. Don't remember off the top of my head which field is displayed for character sheet printouts.
|
#4 |
Member
Join Date: Sep 2013
Location: Raleigh, NC
Posts: 43
|
After some playing around, I can get it to display on the statblock and on the Abilities & Gear appendix. On the main character sheet, "Daring +3 (Ex)" shows up under Special Abilities, but there's no note under the Will Save, which is what I was going for (a la Bravery). This will have to be good enough. Thanks!
|
#5 |
Senior Member
Join Date: Oct 2011
Posts: 6,793
|
The note under the will save is applied by the #situational macro, for your future edification.
|
#6 |
Member
Join Date: Sep 2013
Location: Raleigh, NC
Posts: 43
|
So what was wrong with the #situational macro in the code above? (for future edification)
|
#7 |
Senior Member
Join Date: Oct 2011
Posts: 6,793
|
Add some debugs and I think you'll find one of your doneifs is triggering an end to the script before the macro executes.
|
#8 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
Example of adding "debug". To view then go to "Develop->Floating Info Windows->Show Debug Output".
Code:
debug "Started Script" field[livename].text = "Daring +" & field[abValue].value field[abSumm].text = signed(field[abValue].value) & " to Will save vs. Fear" debug "Before FirstCopy" ~only perform the calculations for the first copy doneif (tagis[Helper.FirstCopy] = 0) debug "After FirstCopy" debug "Before ShowSpec" ~ If we're not shown, just get out now doneif (tagis[Helper.ShowSpec] = 0) debug "After ShowSpec" debug "Before SpcDisable" doneif (tagis[Helper.SpcDisable] <> 0) debug "After SpcDisable" #situational[hero.child[svWill], signed(field[abValue].value) & " vs. fear",field[thingname].text] Hero Lab Resources: Pathfinder - d20pfsrd and Pathfinder Pack Setup 3.5 D&D (d20) - Community Server Setup 5E D&D - Community Server Setup Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources. Created by the community for the community - Realm Works kickstarter backer (Alpha Wolf) and Beta tester.- d20 HL package volunteer editor. |
#9 |
Member
Join Date: Sep 2013
Location: Raleigh, NC
Posts: 43
|
Thanks guys! That helped get it working. I think when I copy code from something else, I tend to just blindly assume whatever was there must still be good, even if the situation is different where I'm using it, so I don't do the same due diligence I would on my own code. Anyway, I always learn something from you guys, and I appreciate your patience!
|
#10 |
Thread Tools | |
Display Modes | |
|
|