Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
I appear to have stumbled over one of the pre-defined variables in Hero Lab, and trying to make use of it is causing some confusing errors. Replace "doneone" with "hasdoneone" and it should work.
|
#31 |
Senior Member
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975
|
Ok, well the ability to turn the additional arms from primary to secondary works, but the damage seems to only apply to one set of arms, and it seems to jump around depending on how many sets there are.
Is there a way to keep the wClaw damage the same for all instances, or do I need to do an eval script? |
#32 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
Code:
foreach pick in hero from BaseNatWep where "IsWeapon.wClaw & !Custom.SWAddArm" perform eachpick.delete[wMain.?] perform eachpick.assign[wMain.new damage value] nexteach hero.childfound[] goes to only the first one it finds - as you saw, which one is first can be rather random. The reason it works for a monk is that there is only a single wUnarmed on any character. Last edited by Mathias; October 19th, 2011 at 09:04 AM. |
#33 |
Senior Member
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975
|
Well they're all supposed to do the same damage (except for the amount of Str Mod applied). But I must have something wrong because when I add the extra arms the damage is right for those, but it goes back to 1d4 for the original attack.
|
#34 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
It sounds like you don't want to exclude the Custom.SWAddArm ones, then.
Also, how did you arrange your if...elseif...elseif...endif within the foreach...nexteach? |
#35 |
Senior Member
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975
|
Natural Attacks
Bootstraps: wClaw Tags: AbilType.Extra, SpecType.Attack Eval Script Phase: Post-Levels Priority: 5000 Code:
~only perform the rest on the first copy doneif (tagis[Helper.FirstCopy] = 0) foreach pick in hero from BaseNatWep where "IsWeapon.wClaw & !Custom.SWAddArm" ~ Get our unarmed strike pick, delete the damage tag from it, and assign ~ a new damage tag. var dice as string perform hero.child[wClaw].delete[wMain.?] if (field[xAllLev].value < 4) then perform hero.child[wClaw].assign[wMain.1d4_4] dice = "1d4" elseif (field[xAllLev].value < 8) then perform hero.child[wClaw].assign[wMain.1d6_5] dice = "1d6" elseif (field[xAllLev].value < 12) then perform hero.child[wClaw].assign[wMain.1d8_6] dice = "1d8" elseif (field[xAllLev].value < 16) then perform hero.child[wClaw].assign[wMain.2d6_104] dice = "2d6" elseif (field[xAllLev].value < 20) then perform hero.child[wClaw].assign[wMain.2d8_204] dice = "2d8" else perform hero.child[wClaw].assign[wMain.4d6_106] dice = "4d6" endif field[livename].text = "Claws" & " (" & dice & ")" ~field[livename].text = "" field[listname].text = field[livename].text nexteach Bootstrap: wClaw Tags: Helper.NatOverSec, Custom.SWAddArm Tags: SpecSource.cHelpGPa, SpecType.Attack, AbilType.Extra, Custom.SWAddArm Expr-reqs: #levelcount[GargParag] >= 6 Eval Script Code:
~only perform the rest on the first copy doneif (tagis[Helper.FirstCopy] = 0) ~ Get our unarmed strike pick, delete the damage tag from it, and assign ~ a new damage tag. var dice as string perform hero.child[wClaw].delete[wMain.?] if (field[xAllLev].value < 4) then perform hero.child[wClaw].assign[wMain.1d4_4] dice = "1d4" elseif (field[xAllLev].value < 8) then perform hero.child[wClaw].assign[wMain.1d6_5] dice = "1d6" elseif (field[xAllLev].value < 12) then perform hero.child[wClaw].assign[wMain.1d8_6] dice = "1d8" elseif (field[xAllLev].value < 16) then perform hero.child[wClaw].assign[wMain.2d6_104] dice = "2d6" elseif (field[xAllLev].value < 20) then perform hero.child[wClaw].assign[wMain.2d8_204] dice = "2d8" else perform hero.child[wClaw].assign[wMain.4d6_106] dice = "4d6" endif field[livename].text = "Claws" & " (" & dice & ")" ~field[livename].text = "" field[listname].text = field[livename].text |
#36 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
Within your foreach, you'll need to access the claw you're currently on with "eachpick", rather than "hero.child[wClaw]." - that way, you're accessing the current claw, not the first one found.
Also, by deleting " & !Custom.SWAddArms" from your first script, you should be able to delete the second script. |
#37 |
Senior Member
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975
|
Thanks, its working now. Also just caught a problem that took me about a minute to fix, but in case someone new comes about.
The script about should be: perform eachpick.assign[wMain.new damage amount] and not a delete. |
#38 |
Senior Member
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975
|
Alright, one of the abilities raises the damage of the bite up to that of the claws. I tried just adding an eval script with new damage amounts, but that doesn't seem to work at all. Is there something special I have to do to target wBite from an ability that didn't bootstrap it?
|
#39 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
Could you provide more detail about how you're trying to accomplish this - the Eval Script, perhaps?
|
#40 |
|
|