• 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

How do I do this? (Pathfinder)

quistar

Well-known member
I've been slowly learning how to add new rules to the Pathfinder rules module for settings like Forgotten Realms and Ravenloft, and while I've made progress, I have hit some walls and need to ask for help. Rather than try to read every single thread, I'm going to focus my efforts here.

I know that some of you have already set up full files with rules for the above, but I've already started and would rather learn how to set them up myself to better learn programming the script.

For my first question: I've entered a Prestige Class into the program, with prereqs in the Expr-reqs and Pre-reqs buttons. However, the program is not recognizing them as prereqs when I go to add a level of the pclass to a character. How do I get it to recognize the prereqs as such?

Thanks in advance, many more questions to follow.

- Andrew <:-(}
 
Are your pre-reqs and exprreqs being added to the Class, or the Class Level? They belong on the Class Level.
 
That did it once I restarted HL. Thanks!

On to my next question then...

I want the Prestige Class I'm working on to offer the Favored Enemy feature of the ranger class. That's easy, it's just a checkbox. The problem is, it won't "stack" with the Favored Enemy options from ranger by allowing Favored Enemy Upgrades. Is there a way to do this?

- Andrew <:-(}
 
Still waiting on the Favored Enemy question so here's another for the Forum to tackle.

I'm trying to add a PClass feature, gained at 1st level and increasing every odd level (10-level pclass), called "Soul of Burnished Bronze." It does the following:

At 1st level, a Herald of Dawn receives a +2 sacred bonus against a vampire's domination gaze and any other vampire or vampire spawn supernatural special attacks requiring a Will save. This bonus increases by +2 every other Herald of Dawn level thereafter.

I borrowed the Bravery class feature from the Fighter class to do this but obviously I have fixes to make on the script; there is a Timing Error among other things. These are the Eval Scripts I programmed in, Priority set to 10000 for each. Any help would be appreciated (including making the bonus a Sacred bonus). Thanks in advance!

First script: Final Phase


field[listname].text = "Soul of Burnished Bronze +" & field[xIndex].value

~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)

~ We need to take into account extra levels, so we'll calculate the bonus
~ we have based on extra levels and store that in a different field. This
~ is to handle the Band of the Stalwart Warrior from UE.
var calclevel as number
calclevel = field[xAllLev].value
field[abValue2].value = round(calclevel/2, 0, -1)

field[abValue].value += field[xCount].value

~ Now we'll show the higher of the two bonuses.
field[abValue].value = maximum(field[abValue].value, field[abValue2].value)

Second Script: Render phase.


field[abSumm].text = signed(field[abValue].value) & " vampire's domination gaze and any other vampire or vampire spawn supernatural special attacks requiring a Will save"
field[livename].text = field[thingname].text & " " & signed(field[abValue].value)
field[sbName].text = lowercase(field[thingname].text) & " " & signed(field[abValue].value)

~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)

#situational[hero.child[svWill], signed(field[abValue].value) & " vs. vampire's domination gaze and any other vampire or vampire spawn supernatural special attacks requiring a Will save",field[thingname].text]
 
That did it once I restarted HL. Thanks!

On to my next question then...

I want the Prestige Class I'm working on to offer the Favored Enemy feature of the ranger class. That's easy, it's just a checkbox. The problem is, it won't "stack" with the Favored Enemy options from ranger by allowing Favored Enemy Upgrades. Is there a way to do this?

- Andrew <:-(}

Give the PrC a class ability which checks for other classes with favored enemies. If it finds one, give it a selector to add the PrC's levels to the cFav1Level field of the chosen class.
 
Still waiting on the Favored Enemy question so here's another for the Forum to tackle.

I'm trying to add a PClass feature, gained at 1st level and increasing every odd level (10-level pclass), called "Soul of Burnished Bronze." It does the following:

At 1st level, a Herald of Dawn receives a +2 sacred bonus against a vampire's domination gaze and any other vampire or vampire spawn supernatural special attacks requiring a Will save. This bonus increases by +2 every other Herald of Dawn level thereafter.

I borrowed the Bravery class feature from the Fighter class to do this but obviously I have fixes to make on the script; there is a Timing Error among other things. These are the Eval Scripts I programmed in, Priority set to 10000 for each. Any help would be appreciated (including making the bonus a Sacred bonus). Thanks in advance!

First script: Final Phase


field[listname].text = "Soul of Burnished Bronze +" & field[xIndex].value

~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)

~ We need to take into account extra levels, so we'll calculate the bonus
~ we have based on extra levels and store that in a different field. This
~ is to handle the Band of the Stalwart Warrior from UE.
var calclevel as number
calclevel = field[xAllLev].value
field[abValue2].value = round(calclevel/2, 0, -1)

field[abValue].value += field[xCount].value

~ Now we'll show the higher of the two bonuses.
field[abValue].value = maximum(field[abValue].value, field[abValue2].value)

Second Script: Render phase.


field[abSumm].text = signed(field[abValue].value) & " vampire's domination gaze and any other vampire or vampire spawn supernatural special attacks requiring a Will save"
field[livename].text = field[thingname].text & " " & signed(field[abValue].value)
field[sbName].text = lowercase(field[thingname].text) & " " & signed(field[abValue].value)

~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)

#situational[hero.child[svWill], signed(field[abValue].value) & " vs. vampire's domination gaze and any other vampire or vampire spawn supernatural special attacks requiring a Will save",field[thingname].text]

I think you're using an old version of the Bravery ability, which might be causing some confusion. Also, the timing errors are probably from leaving the eval scripts with the same names as the ability you copied them from. Here is my ccrack at what I think you're trying, based on the current bravery version.

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

      field[abValue].value += (field[xCount].value * 2)

Render 10000
Code:
      field[listname].text = "Soul of Burnished Bronze +" & (field[xIndex].value * 2)

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

      field[abSumm].text = signed(field[abValue].value) & " to Will saves vs. vampire or vampire spawn supernatural special attacks."
      field[livename].text = field[thingname].text & " " & signed(field[abValue].value)
      field[sbName].text = lowercase(field[thingname].text) & " " & signed(field[abValue].value)

      ~ 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) & " sacred bonus vs. vs. vampire or vampire spawn supernatural special attacks",field[thingname].text]

As usual, no assurance on the code, not tested so you may have to tweak it.
 
Give the PrC a class ability which checks for other classes with favored enemies. If it finds one, give it a selector to add the PrC's levels to the cFav1Level field of the chosen class.

Sounds good, but I'm a rank amateur when it comes to writing the script. How do I do that?

Andrew <:-(}
 
I think you're using an old version of the Bravery ability, which might be causing some confusion. Also, the timing errors are probably from leaving the eval scripts with the same names as the ability you copied them from. Here is my ccrack at what I think you're trying, based on the current bravery version.

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

      field[abValue].value += (field[xCount].value * 2)

Render 10000
Code:
      field[listname].text = "Soul of Burnished Bronze +" & (field[xIndex].value * 2)

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

      field[abSumm].text = signed(field[abValue].value) & " to Will saves vs. vampire or vampire spawn supernatural special attacks."
      field[livename].text = field[thingname].text & " " & signed(field[abValue].value)
      field[sbName].text = lowercase(field[thingname].text) & " " & signed(field[abValue].value)

      ~ 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) & " sacred bonus vs. vs. vampire or vampire spawn supernatural special attacks",field[thingname].text]

As usual, no assurance on the code, not tested so you may have to tweak it.

Much appreciated! I did get an error on Line 1 for Eval Script "calc for Soul of Burnished Bronze", error in right-side expression of assignment. No idea what that means.

Thanks in advance for your patience. I'm learning to do the scripts by example and using similar scripts, but that only carries me so far without help.

- Andrew <:-(}
 
Sounds good, but I'm a rank amateur when it comes to writing the script. How do I do that?

Andrew <:-(}

Yeah, I guess this one is pretty tough for a beginner. Here is how I would start. As I said, not tested, may need to tweak.

Pre-Levels 10000
Code:
~ First check all classes on the hero for one with favored enemies
var foundone as number
var validclass as number
var i as number
var currlevel as string
var searchexpr as string

foreach pick in hero from Class
  ~We subtract 1 because arrays start at 0, so 1st level is 0 in an array.
  currlevel = eachpick.field[cTotalLev].value - 1

  ~This is awkward because the number is in an array field, so we have to "walk up" the array, checking each cell (up to the current level) for a non-zero value.
  for i = 0 to currlevel
    if (eachpick.field[cFav1Tot].arrayvalue[i] <> 0) then
      validclass = 1
      endif
    next

  if (validclass <> 0) then
    foundone += 1

    ~ We also note down which classes are valid choices, for later
    searchexpr = splice(searchexpr, tagids[Classes.?], " | ")
    endif

  ~validclass has to be reset to 0 for each new class, so we can know if this class should be choosable. Otherwise, once a valid class was found, all future classes would also be valid
  validclass = 0
  nexteach

~stop if we did not find an appropriate class
doneif (foundone = 0)

~Now define our candidate expression. It should be mostly built in the previous foreach, we just need to add a bit onto the beginning and enclose the rest in parenthesis.
field[usrCandid1].text = "component.Class & (" & searchexpr & ")"

~If we haven't chosen any class to benefit yet, stop
doneif (field[usrChosen1].ischosen = 0)

~Since we got this far, add our own class levels to the chosen class.
~Note that since we are running this script before Levels phase, we can't rely on our normal level fields.
field[usrChosen1].chosen.field[cFav1Level].value += #levelcount[WHATEVER YOUR PrC's CLASSES TAGS ARE]
 
Last edited:
Much appreciated! I did get an error on Line 1 for Eval Script "calc for Soul of Burnished Bronze", error in right-side expression of assignment. No idea what that means.

Thanks in advance for your patience. I'm learning to do the scripts by example and using similar scripts, but that only carries me so far without help.

- Andrew <:-(}

The error message tells you the problem is on line 1. What is on line 1 which might be the issue?
 
Yeah, I guess this one is pretty tough for a beginner. Here is how I would start. As I said, not tested, may need to tweak.

Yeah, the last real programming I did was in high school, a lot longer ago than I care to disclose. And that was nothing compared to this. My head spins trying to keep track of all this and I'm honestly not up to the job. :D

Tried this and got a syntax error in the 'eval' script on line 10, error in right-side expression of assignment.

No idea what this means but I hope you do. I copied and pasted your script as written above.

I know I should know better, but I apologize for being a bit of a pest. I checked the how-to guides on the forum (and will re-check them since I can learn more), but they don't cover a lot of the intricate coding detail and there's just no way I can figure it all out on my own.
 
Line 10 is
currlevel = eachpick.field[cTotalLev].value - 1

which I thought was fine. I guess try changing it to

currlevel = eachpick.field[cTotalLev].value
currlevel -= 1
 
Line 10 is
currlevel = eachpick.field[cTotalLev].value - 1

which I thought was fine. I guess try changing it to

currlevel = eachpick.field[cTotalLev].value
currlevel -= 1

Well, that fixed the error on line 10. But now line 11 is giving an error:
"use of the +=, -=, or /= assignment forms is restricted to numeric values."

But hey, that's progress!
 
I see the problem, change the line that says

var currlevel as string to
var currlevel as number

DING! We got it!

I had one more error on the tag of the pclass, but through trial and error I was able to track that down myself in the Tags. Thank you! One down, about a gazillion to go! (I'll go slowly on them!)
 
DING! We got it!

I had one more error on the tag of the pclass, but through trial and error I was able to track that down myself in the Tags. Thank you! One down, about a gazillion to go! (I'll go slowly on them!)

Or so I thought...

When I went to apply this on a character I'd created, I got an error message:

"Attempt to access field 'UsrCandid1' that does not exist for thing 'cHelpMhr'"

Same error message for 'UsrChosen1'

cHelpMhr is the Unique ID for the pclass Monster Hunter.
 
The error message you've quoted shows some capitalization errors - UsrCandid1, instead of usrCandid1 and UsrChosen1 instead of usrChosen1. Did you capitalize those when writing down the error message, or are they capitalized in your code?
 
The error message you've quoted shows some capitalization errors - UsrCandid1, instead of usrCandid1 and UsrChosen1 instead of usrChosen1. Did you capitalize those when writing down the error message, or are they capitalized in your code?

I capitalized them when typing here. They are lower case in the error message, which doesn't allow me to select and copy text so I'm transcribing. Good question.
 
Back
Top