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)
-   -   FirstCopy tag troubles (http://forums.wolflair.com/showthread.php?t=64018)

Bob G March 8th, 2020 01:31 PM

FirstCopy tag troubles
 
Ability says: Each time the rogue selects this avoidance, she gains a +1 dodge bonus to AC when fighting defensively. So I did this:
<First/500>
Code:

~ If we're not shown, just get out now
      doneif (tagis[Helper.ShowSpec] <> 1)
~ if we've been disabled, get out now
      doneif (tagis[Helper.SpcDisable] <> 0)
~ if we're not fighting defensively, get out now
    if (hero.childfound[pstFtDefen].field[pIsOn].value <> 0) then
   
~ Set the bonus based on the number of active abilities
      field[abValue].value += field[xIndex].value
      field[livename].text = field[thingname].text & " " & field[abValue].value

~ The following should only happen once on the first copy
      doneif (tagis[Helper.FirstCopy] = 0)

~ Give a dodge bonus to Armor Class
      hero.childfound[ArmorClass].field[tACDodge].value += field[abValue].value
endif

But dodge bonus does not add. Why is this happening?

ShadowChemosh March 8th, 2020 01:45 PM

I am pretty sure CustomSpec Picks don't get Helper.FirstCopy unless you apply it yourself first. If you have the community pack installed this is easy as calling X1SetFirst.

You can see an example HERE.

Bob G March 8th, 2020 08:38 PM

Quote:

Originally Posted by ShadowChemosh (Post 286798)
I am pretty sure CustomSpec Picks don't get Helper.FirstCopy unless you apply it yourself first. If you have the community pack installed this is easy as calling X1SetFirst.

You can see an example HERE.

Wow, I have been pulling my hair out for two months trying to figure out why Helper.FirstCopy wasn't behaving like it should. I had no idea that it didn't automatically get assigned on custom abilities. "Call X1SetFirst" did the trick. Thanks for the code SC!

Bob G March 19th, 2020 01:18 PM

Still having problems
 
Quote:

Originally Posted by ShadowChemosh (Post 286798)
I am pretty sure CustomSpec Picks don't get Helper.FirstCopy unless you apply it yourself first. If you have the community pack installed this is easy as calling X1SetFirst.

You can see an example HERE.

I tried using the X1SetFirst procedure with the script below, but the value isn't stacking after the first copy.
Code:

~ Set Helper.FirstCopy for custom abilities
      call X1SetFirst
     
      var DamRed as number
      DamRed += 3

~Grant damage reduction
      #applydr[xDamRd,DamRed]

I also tried removing the call X1SetFirst line, but the result was the same. What's going on here?

Minous March 19th, 2020 06:27 PM

Why not store DamRed as an abvalue and have the other copies reference that?

Bob G June 5th, 2020 07:09 AM

Still not getting this...
 
I thought I had this figured out, but after a few months I revisited the ability, and realized it wasn't working as I hoped.

It's a custom ability that can be selected multiple times. Each time, it adds +1 dodge bonus to AC when hero is fighting defensively.

I don't receive any error messages, and the bonus adds to AC correctly, but the livename doesn't reflect the correct value after the first copy. It could be a timing issue, but I tried other phases to no avail.
<Post-Attributes 10000>
Code:

    call X1SetFirst
    field[abValue].value += 1
   
    field[livename].text &= field[thingname].text & " +" & field[abValue].value
    hero.childfound[pstFtDefen].field[abValue].value += field[abValue].value

~ if we're not the first copy, get out now
    doneif (tagis[Helper.FirstCopy] <> 1)
   
~ if we're not fighting defensively, get out now
    doneif (hero.childfound[pstFtDefen].field[pIsOn].value = 0)
    hero.childfound[ArmorClass].field[tACDodge].value += field[abValue].value

I have several custom abilities that work similarly, so if the community can assist, you will help me solve several problems. Thanks as always!

TCArknight June 8th, 2020 06:13 PM

I think normally the livename field is set late in the Final phase.

Try just pulling just this line out to something like Render/5000:

field[livename].text = field[thingname].text & " +" & field[abValue].value

Minous June 12th, 2020 05:16 PM

Yeah, odds are you would need to have the effect and live name changes at different timings

Bob G June 15th, 2020 08:26 PM

Quote:

Originally Posted by TCArknight (Post 289082)
I think normally the livename field is set late in the Final phase.

Try just pulling just this line out to something like Render/5000:

field[livename].text = field[thingname].text & " +" & field[abValue].value

Thanks for the suggestions everyone (Minous too). Unfortunately, pulling the livename line out and putting on Render/5000 didn't change the abValue of the livename after the first copy. I also discovered that the bonus to AC wasn't adding after the first copy either.

It seems so simple, yet I just can't seem to get the concept right. Talk me off the ledge, someone!

Mathias June 16th, 2020 07:47 AM

Here's how I'd write this:

Code:

  <eval index="1" phase="PreLevel" priority="1000"><![CDATA[
    ~ 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 1
      field[abValue].value += 1


    ~ 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 +1 to the focus's value
      focus.field[abValue].value += 1
      endif
    ]]></eval>
  <eval index="2" phase="PostLevel" priority="10000"><![CDATA[
    doneif (tagis[Helper.SpcDisable] <> 0)
    doneif (tagis[Helper.FirstCopy] = 0)

    ~ if we're not fighting defensively, get out now
    doneif (hero.childfound[pstFtDefen].field[pIsOn].value = 0)
 
    ~ Give a dodge bonus to Armor Class
    hero.childfound[ArmorClass].field[tACDodge].value += field[abValue].value
    ]]></eval>


And then use the automated livename generation mechanisms to set abValue as an append to the livename, and set it as signed - but that all happens in tags, not in a script.


All times are GMT -8. The time now is 03:55 AM.

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