![]() |
Senior Member
Join Date: Nov 2017
Location: Trafford, PA, USA
Posts: 226
|
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 Projects: Legendary Rogue (Legendary Games) 97.9%, Assassin (Interjection Games) 88%, Fortunate (rebuild of Luckbringer, Rite Publishing) 87.2%, Adept Godling (Super Genius Games) 73.9%, Eldritch Godling (Super Genius Games) 72.9%, Mighty Godling (Super Genius Games) 44.3%, Clever Godling (Super Genius Games) 41.2%, Legendary Cavalier (Legendary Games) 30.9% Message me for a list of completed projects. Visit my blog! https://gauntletsofblogrepower.blogspot.com/ |
![]() |
![]() |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
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. Hero Lab Resources: Pathfinder - d20pfsrd and Pathfinder Pack Setup 3.5 D&D (d20) - Community Server Setup 5E D&D - Community Server Setup Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources. Created by the community for the community - Realm Works kickstarter backer (Alpha Wolf) and Beta tester.- d20 HL package volunteer editor. |
![]() |
![]() |
Senior Member
Join Date: Nov 2017
Location: Trafford, PA, USA
Posts: 226
|
Quote:
Projects: Legendary Rogue (Legendary Games) 97.9%, Assassin (Interjection Games) 88%, Fortunate (rebuild of Luckbringer, Rite Publishing) 87.2%, Adept Godling (Super Genius Games) 73.9%, Eldritch Godling (Super Genius Games) 72.9%, Mighty Godling (Super Genius Games) 44.3%, Clever Godling (Super Genius Games) 41.2%, Legendary Cavalier (Legendary Games) 30.9% Message me for a list of completed projects. Visit my blog! https://gauntletsofblogrepower.blogspot.com/ |
|
![]() |
![]() |
Senior Member
Join Date: Nov 2017
Location: Trafford, PA, USA
Posts: 226
|
Quote:
Code:
~ Set Helper.FirstCopy for custom abilities call X1SetFirst var DamRed as number DamRed += 3 ~Grant damage reduction #applydr[xDamRd,DamRed] Projects: Legendary Rogue (Legendary Games) 97.9%, Assassin (Interjection Games) 88%, Fortunate (rebuild of Luckbringer, Rite Publishing) 87.2%, Adept Godling (Super Genius Games) 73.9%, Eldritch Godling (Super Genius Games) 72.9%, Mighty Godling (Super Genius Games) 44.3%, Clever Godling (Super Genius Games) 41.2%, Legendary Cavalier (Legendary Games) 30.9% Message me for a list of completed projects. Visit my blog! https://gauntletsofblogrepower.blogspot.com/ |
|
![]() |
![]() |
Senior Member
Join Date: May 2015
Posts: 830
|
Why not store DamRed as an abvalue and have the other copies reference that?
|
![]() |
![]() |
Senior Member
Join Date: Nov 2017
Location: Trafford, PA, USA
Posts: 226
|
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 Projects: Legendary Rogue (Legendary Games) 97.9%, Assassin (Interjection Games) 88%, Fortunate (rebuild of Luckbringer, Rite Publishing) 87.2%, Adept Godling (Super Genius Games) 73.9%, Eldritch Godling (Super Genius Games) 72.9%, Mighty Godling (Super Genius Games) 44.3%, Clever Godling (Super Genius Games) 41.2%, Legendary Cavalier (Legendary Games) 30.9% Message me for a list of completed projects. Visit my blog! https://gauntletsofblogrepower.blogspot.com/ |
![]() |
![]() |
Senior Member
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,321
|
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 Working on - |
![]() |
![]() |
Senior Member
Join Date: May 2015
Posts: 830
|
Yeah, odds are you would need to have the effect and live name changes at different timings
|
![]() |
![]() |
Senior Member
Join Date: Nov 2017
Location: Trafford, PA, USA
Posts: 226
|
Quote:
It seems so simple, yet I just can't seem to get the concept right. Talk me off the ledge, someone! Projects: Legendary Rogue (Legendary Games) 97.9%, Assassin (Interjection Games) 88%, Fortunate (rebuild of Luckbringer, Rite Publishing) 87.2%, Adept Godling (Super Genius Games) 73.9%, Eldritch Godling (Super Genius Games) 72.9%, Mighty Godling (Super Genius Games) 44.3%, Clever Godling (Super Genius Games) 41.2%, Legendary Cavalier (Legendary Games) 30.9% Message me for a list of completed projects. Visit my blog! https://gauntletsofblogrepower.blogspot.com/ |
|
![]() |
![]() |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
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. |
![]() |
![]() |
![]() |
|
|