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)
-   -   How do I do this? (Pathfinder) (http://forums.wolflair.com/showthread.php?t=49403)

quistar May 20th, 2014 07:22 PM

How do I do this? (Pathfinder)
 
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 <:-(}

Mathias May 20th, 2014 09:52 PM

Are your pre-reqs and exprreqs being added to the Class, or the Class Level? They belong on the Class Level.

quistar May 21st, 2014 05:43 PM

Quote:

Originally Posted by Mathias (Post 183642)
Are your pre-reqs and exprreqs being added to the Class, or the Class Level? They belong on the Class Level.

AHA! That's my problem! I'll switch them and see if it works. Thanks!

- Andrew <:-(}

quistar May 21st, 2014 05:52 PM

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 <:-(}

quistar June 2nd, 2014 08:14 PM

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]

Aaron June 3rd, 2014 09:40 AM

Quote:

Originally Posted by quistar (Post 183675)
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.

Aaron June 3rd, 2014 09:53 AM

Quote:

Originally Posted by quistar (Post 184633)
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.

quistar June 3rd, 2014 12:36 PM

Quote:

Originally Posted by Aaron (Post 184655)
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 <:-(}

quistar June 3rd, 2014 12:48 PM

Quote:

Originally Posted by Aaron (Post 184656)
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 <:-(}

Aaron June 4th, 2014 01:19 PM

Quote:

Originally Posted by quistar (Post 184676)
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]



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

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