Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Pathfinder Roleplaying Game
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
nuku
Member
 
Join Date: Mar 2013
Posts: 62

Old February 16th, 2016, 06:57 PM
So I went directly to Magical Knack, being close to what I want.

Quote:
doneif (tagis[Helper.FtDisable] <> 0)

if (field[usrChosen1].ischosen <> 0) then
~our caster level for the chosen class is at +2, to a maximum of the number of Hit Dice we have
field[usrChosen1].chosen.field[cCasterLev].value = minimum(field[usrChosen1].chosen.field[cCasterLev].value + 2, hero.tagcount[Hero.HitDice])
endif
That's what it has, and it makes sense enough, but how do I make it boost all classes you may have that have a caster level by 1? I haven't yet tangled with for/while/etc. loops in this language, and I get to figure out what tags are involved, which promises to be super fun!

Any help appreciated. I've made great progress today, so thank you in advance.
nuku is offline   #1 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old February 17th, 2016, 11:55 AM
You will need to use a foreach loop to find all the classes and increase there caster level. If you search these forums for the word "Foreach" you will find plenty of examples.

THIS one by Aaron looks like it will be really close as it goes after Casters and the Class Helper Picks which is what stores the caster level.

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   #2 Reply With Quote
nuku
Member
 
Join Date: Mar 2013
Posts: 62

Old February 17th, 2016, 12:09 PM
Quote:
Originally Posted by ShadowChemosh View Post
You will need to use a foreach loop to find all the classes and increase there caster level. If you search these forums for the word "Foreach" you will find plenty of examples.

THIS one by Aaron looks like it will be really close as it goes after Casters and the Class Helper Picks which is what stores the caster level.
Alright, grabbed that and tried to twist it to my ends:

Quote:
~ Go through all casting classes.
foreach pick in hero from BaseClHelp where "CasterSrc.?"
~ transition through the attribute linkage, is it higher than our current
~ variable? If so, set the variable to this and set the focus to the linked
~ attribute.
if (eachpick.linkage[cCasterlev].field[aModBonus].value < hero.tagcount[Hero.HitDice]) then
perform eachpick.linkage[cCasterlev].setfocus
eachpick.linkage[cCasterlev].field[aModBonus].value = eachpick.linkage[cCasterlev].field[aModBonus].value + 1

~ Otherwise, do nothing, we'll check the next class
else
~ Nothing
endif
nexteach
Quote:
Hero Lab was forced to stop compilation after the following errors were detected:

Syntax error in 'evalrule' script for Thing 'trDiliCast' (Eval Rule '#1') on line 6
-> Non-existent linkage 'cCasterlev' used by script
nuku is offline   #3 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old February 17th, 2016, 12:12 PM
So field[usrChosen1].chosen is the same thing as eachpick. With that can you see whats wrong with your script?

Basically eachpick is pointing to a specific Pick similar to saying "hero.childfound[cHelpWiz]" to transition to the Wizard Class Helper Pick.

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   #4 Reply With Quote
nuku
Member
 
Join Date: Mar 2013
Posts: 62

Old February 17th, 2016, 12:18 PM
So I tweaked it, and got a new error that leaves me even more baffled:
Quote:
Hero Lab was forced to stop compilation after the following errors were detected:

Syntax error in 'evalrule' script for Thing 'trDiliCast' (Eval Rule '#1') on line 6
-> Reference to undeclared variable: 'eachpick'
Edit:
Quote:
~ Go through all casting classes.
foreach pick in hero from BaseClHelp where "CasterSrc.?"
~ transition through the attribute linkage, is it higher than our current
~ variable? If so, set the variable to this and set the focus to the linked
~ attribute.
if (eachpick.cCasterlev < hero.tagcount[Hero.HitDice]) then
perform eachpick.linkage[cCasterlev].setfocus
eachpick.linkage[cCasterlev].field[aModBonus].value = eachpick.linkage[cCasterlev].field[aModBonus].value + 1

~ Otherwise, do nothing, we'll check the next class
else
~ Nothing
endif
nexteach
nuku is offline   #5 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,215

Old February 17th, 2016, 12:33 PM
This one is line 6:
Code:
if (eachpick.cCasterlev < hero.tagcount[Hero.HitDice]) then
Does the original need to put anything around cCasterLev in order to tell Hero Lab what cCasterLev is and how to deal with it? Did you leave any of that out in this line of code?
Mathias is offline   #6 Reply With Quote
nuku
Member
 
Join Date: Mar 2013
Posts: 62

Old February 17th, 2016, 12:36 PM
The original didn't call cCasterlev. I don't know.
nuku is offline   #7 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,215

Old February 17th, 2016, 12:42 PM
Anything in this line from your original post that suggests how to tell Hero Lab what cCasterLev is and how to deal with it?

Code:
field[usrChosen1].chosen.field[cCasterLev].value
Mathias is offline   #8 Reply With Quote
nuku
Member
 
Join Date: Mar 2013
Posts: 62

Old February 17th, 2016, 12:48 PM
Quote:
if (eachpick.field[cCasterlev].value < hero.tagcount[Hero.HitDice]) then
Error:
Quote:
Hero Lab was forced to stop compilation after the following errors were detected:

Syntax error in 'eval' script for Thing 'trDiliCast' (Eval Script '#1') on line 6
-> Non-existent field 'cCasterlev' used by script
nuku is offline   #9 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,215

Old February 17th, 2016, 01:09 PM
Capitalization counts! Look at what you've really entered as the Id of that field, and compare it to the capitalization of that field in that first post.
Mathias is offline   #10 Reply With Quote
Reply


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 06:20 AM.


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