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)
-   -   Bootstrapping conditions (again) (http://forums.wolflair.com/showthread.php?t=64630)

Bob G August 8th, 2020 05:50 PM

Bootstrapping conditions (again)
 
I don't know if this is a commonly misunderstood topic, or if I am uncommonly dense, but I'm still having trouble with bootstrapping conditions. I have a non-unique class ability which grants a +2 bonus to saves against poisons. The fourth time it is picked, it grants immunity to poisons. Since I want to count how many times the ability has been added, I figured that the xIndex field is what I want to use as a criterion for my conditional bootstrap. So, when bootstrapping xImmPois, I added the bootstrap condition 'fieldval:xIndex >= 4', with a timing of <First/500>.

xImmPois isn't adding to the hero, and I'm pretty sure it's the bootstrap timing that is the cause. Where did I go wrong?

Mathias August 8th, 2020 09:56 PM

Look in the debug tools - one of the option is to debug field histories - what timings does xIndex change at?

Does this have to be implemented as one ability? Or can it be two of them - the second one of which requires three copies of the first?

Bob G April 30th, 2021 08:32 PM

Quote:

Originally Posted by Mathias (Post 290222)
Look in the debug tools - one of the option is to debug field histories - what timings does xIndex change at?

Does this have to be implemented as one ability? Or can it be two of them - the second one of which requires three copies of the first?

I could try to make the final effect a separate ability. I could use a tagcount, but I'm not sure which tag I would be counting. Can you point me in the general direction?

Bob G June 14th, 2021 02:40 PM

Humble bump in hopes of further assistance.

Mathias June 14th, 2021 02:52 PM

Your reply asked about tagcount, but I don't know the context - a tagcount of what?


Also, doesn't the alchemist have something very similar to this? Have you studied how that's implemented?

Bob G June 20th, 2021 05:54 PM

I had a look at the alchemist's poison resistances, and tried to implement it for my ability, but since this ability is a custom ability, xIndex and xCount aren't valid fields. Instead, I tried using abValue as the argument to swap resistance for immunity:
<Pre-levels 1000>
Code:

If we're not active, just get out now
    doneif (tagis[Helper.SpcDisable] <> 0)

    ~ see if a quickfind has been created by another copy
    perform quickfind.setfocus

    ~ if we didn't find a redirection, we're the first copy of this ability to run this script, so we'll make ourselves the FirstCopy.
    if (state.isfocus = 0) then
      perform quickadd
      perform assign[Helper.FirstCopy]
      ~Add the base value of 2
      field[abValue].value += 2

    ~ otherwise, redirect hero.child[] to the FirstCopy, and make us an upgrade
    else
      perform focus.redirect
      perform assign[Helper.SpecUp]
      perform assign[Hide.Statblock]
      ~ add +2 to the focus's value
      focus.field[abValue].value += 2
      endif

<Post-levels 10000>
Code:

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

if (field[abValue].value <= 6) then
#situational[hero.child[svAll],signed(field[abValue].value) & " bonus on all saving throws against poison.",field[thingname].text]
else
      ~ If 4 copies are active, that's immunity
      if (field[abValue].value >= 8) then
        ~ We also want to change our special type from resistance to immunity
        perform delete[SpecType.Resist]
        perform assign[SpecType.Immune]

        ~ Since we're adding the immune to poison special, this ability
        ~ doesn't need to be shown once we're an immunity
        perform assign[Helper.SpecUp]
        endif
    endif

<Render 5000>
Code:

if (field[abValue].value <= 6) then
field[livename].text = field[thingname].text & " +" & field[abValue].value
else
field[livename].text = field[thingname].text & " Immunity to poison"
endif

Everything works until the 4th time the hero selects the ability. Resistance to Poison disappears, but immunity to poison doesn't replace it.

Mathias June 21st, 2021 07:36 AM

Please be clear when you begin asking your question whether you're using user-added abilities, or class specials that are bootstrapped - all you said was "class ability", so I thought you meant class specials. The solutions in each case are very different. If this is a custom ability, then you don't need to to worry about bootstrap conditions - you just create two abilities - one of which can be taken 3 times, and another that has a prereq of 3 copies of the first, that can just bootstrap immunity without having to worry about bootstrap conditions.

hero.tagcount[HasAbility.XXXXX] >= 3

should work as the exprreq to let you verify that 3 copies have been added.


A Rogue Talent called Hold Breath is an example of something that can be taken multiple times and increases its value by 2 for each time taken.

Bob G June 23rd, 2021 10:45 AM

Thanks Mathias, I will try to be more specific in the future.

Bob G June 23rd, 2021 08:37 PM

I'm sad to report that the following prereq produced an unspecified syntax error

hero.tagcount[HasAbility.cLRgAvPoiRes] >= 3

It appears the syntax is correct, so what else could be the problem?

Bob G June 23rd, 2021 08:37 PM

Duplicate post


All times are GMT -8. The time now is 12:19 AM.

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