Member
Join Date: Aug 2013
Location: Lenexa, KS
Posts: 71
|
I wanted to create an artifact similar to the dragon orbs, but have the AC bonus scale with the users level instead of adding the dragon's full natural ac. I was trying something like:
If (hero.herofield(tLevel) >= 20 then (focus.field[tACNatural].value = 20) Elseif (hero.herofield(tLevel) >= 15 then (focus.field[tACNatural].value = 15) Elseif (hero.herofield(tLevel) >= 10 then (focus.field[tACNatural].value = 10) Elseif (hero.herofield(tLevel) >= 5 then (focus.field[tACNatural].value = 5) This doesn't work as desired. What am I missing? Any help would be great. Thanks, Kal |
#1 |
Senior Member
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975
|
Phase/Priority?
Also this doesn't seem to be all the code, as you're setting focus somewhere and we can't see to what. |
#2 |
Member
Join Date: Aug 2013
Location: Lenexa, KS
Posts: 71
|
I still am trying to use some of the original code which is where the focus comes from. I probably am using it incorrectly. What if I changed it to this?
If (hero.herofield(tLevel) >= 20 then (hero.herofield[tACNatural].value = 20) Elseif (hero.herofield(tLevel) >= 15 then (hero.herofield[tACNatural].value = 15) Elseif (hero.herofield(tLevel) >= 10 then (hero.herofield[tACNatural].value = 10) Elseif (hero.herofield(tLevel) >= 5 then (hero.herofield[tACNatural].value = 5) I am going to try this, but what do you think? Will it work? |
#3 |
Member
Join Date: Aug 2013
Location: Lenexa, KS
Posts: 71
|
I get an error "Invalid use of a reserved work in script"
|
#4 |
Senior Member
Join Date: Oct 2011
Posts: 6,793
|
The issue is that you are not closing your parenthesis in the "if/then" lines, and you are using herofield transitions incorrectly. Try:
PostLevel 10000 Code:
if (herofield[tLevel].value >= 20) then hero.childfound[ArmorClass].field[tACNatural].value = 20 elseif (herofield[tLevel].value >= 15) then hero.childfound[ArmorClass].field[tACNatural].value = 15 elseif (herofield[tLevel].value >= 10) then hero.childfound[ArmorClass].field[tACNatural].value = 10 elseif (herofield[tLevel].value >= 5) then hero.childfound[ArmorClass].field[tACNatural].value = 5 endif |
#5 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
Quote:
So if a magic item was to give +1 bonus to Natural Armor at Pre-Levels/1000 your script comes in at Post-Levels/10000 an wipes out the +1 with the above value. Is that what you want to do? If you want to stack with other bonuses to Natural Armor you need to "add" to the existing values instead: Code:
if (herofield[tLevel].value >= 20) then hero.childfound[ArmorClass].field[tACNatural].value += 20 elseif (herofield[tLevel].value >= 15) then hero.childfound[ArmorClass].field[tACNatural].value += 15 elseif (herofield[tLevel].value >= 10) then hero.childfound[ArmorClass].field[tACNatural].value += 10 elseif (herofield[tLevel].value >= 5) then hero.childfound[ArmorClass].field[tACNatural].value += 5 endif 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. |
|
#6 |
Member
Join Date: Aug 2013
Location: Lenexa, KS
Posts: 71
|
Thanks. I appreciate the assistance. I get a little lost sometimes when trying to figure out the field names.
|
#7 |
Senior Member
Join Date: Oct 2011
Posts: 6,793
|
I believe orbs of dragonkind are one of the few things which overrides rather than enhances natural armor.
|
#8 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
Shrug "could" totally be. I just wanted to be clear in what the script was doing. If so "great" if not I sometimes like to be "verbose" and make sure.
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. |
#9 |
Thread Tools | |
Display Modes | |
|
|