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)
-   -   Display Save Modifiers (http://forums.wolflair.com/showthread.php?t=52834)

gauldin May 1st, 2015 01:29 PM

Display Save Modifiers
 
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?

Aaron May 1st, 2015 01:34 PM

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.

gauldin May 1st, 2015 01:42 PM

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.

Aaron May 1st, 2015 01:45 PM

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.

gauldin May 1st, 2015 02:36 PM

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!

Aaron May 1st, 2015 03:38 PM

The note under the will save is applied by the #situational macro, for your future edification.

gauldin May 2nd, 2015 06:31 AM

So what was wrong with the #situational macro in the code above? (for future edification)

Aaron May 2nd, 2015 07:02 AM

Add some debugs and I think you'll find one of your doneifs is triggering an end to the script before the macro executes.

ShadowChemosh May 2nd, 2015 10:03 AM

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]


gauldin May 2nd, 2015 02:52 PM

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!


All times are GMT -8. The time now is 09:58 AM.

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