• 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

Display Save Modifiers

gauldin

Active member
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
field[abSumm].text = signed(field[abValue].value) & " to Will save vs. Fear"

~only perform the calculations for the first copy
doneif (tagis[Helper.FirstCopy] = 0)

~ If we're not shown, just get out now
doneif (tagis[Helper.ShowSpec] = 0)

doneif (tagis[Helper.SpcDisable] <> 0)


#situational[hero.child[svWill], signed(field[abValue].value) & " vs. fear",field[thingname].text]

(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?
 
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.
 
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.
 
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.
 
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!
 
The note under the will save is applied by the #situational macro, for your future edification.
 
Add some debugs and I think you'll find one of your doneifs is triggering an end to the script before the macro executes.
 
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]
 
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!
 
Back
Top