Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Pathfinder Roleplaying Game

Notices

Reply
 
Thread Tools Display Modes
Kalladar
Member
 
Join Date: Aug 2013
Location: Lenexa, KS
Posts: 71

Old September 15th, 2015, 06:09 AM
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
Kalladar is offline   #1 Reply With Quote
AndrewD2
Senior Member
 
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975

Old September 15th, 2015, 07:39 AM
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.
AndrewD2 is offline   #2 Reply With Quote
Kalladar
Member
 
Join Date: Aug 2013
Location: Lenexa, KS
Posts: 71

Old September 15th, 2015, 09:28 AM
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?
Kalladar is offline   #3 Reply With Quote
Kalladar
Member
 
Join Date: Aug 2013
Location: Lenexa, KS
Posts: 71

Old September 15th, 2015, 09:30 AM
I get an error "Invalid use of a reserved work in script"
Kalladar is offline   #4 Reply With Quote
Aaron
Senior Member
 
Join Date: Oct 2011
Posts: 6,793

Old September 15th, 2015, 10:05 AM
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
Aaron is offline   #5 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old September 15th, 2015, 10:45 AM
Quote:
Originally Posted by Aaron View Post
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
@OP you may want to be doing a += not a =. The above script overrides the natrual armor of the creature and resets it to the above value.

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.
ShadowChemosh is offline   #6 Reply With Quote
Kalladar
Member
 
Join Date: Aug 2013
Location: Lenexa, KS
Posts: 71

Old September 15th, 2015, 01:08 PM
Thanks. I appreciate the assistance. I get a little lost sometimes when trying to figure out the field names.
Kalladar is offline   #7 Reply With Quote
Aaron
Senior Member
 
Join Date: Oct 2011
Posts: 6,793

Old September 15th, 2015, 01:33 PM
I believe orbs of dragonkind are one of the few things which overrides rather than enhances natural armor.
Aaron is offline   #8 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old September 15th, 2015, 03:05 PM
Quote:
Originally Posted by Aaron View Post
I believe orbs of dragonkind are one of the few things which overrides rather than enhances natural armor.
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.
ShadowChemosh is offline   #9 Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 09:11 AM.


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