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
Vanye111
Junior Member
 
Join Date: Aug 2008
Posts: 21

Old June 22nd, 2017, 08:41 AM
Ok, some time ago I created a custom vanity from the PFS scenario The Confirmation, to show the bonus to skills you can get for being a friend of Janira Gavix. It doesn't add any bonus to the skill, it just shows up as text under the skill so I get a reminder that if I'm in the right spot, I can use it. I just updated HL recently, and loaded one of the characters that has it, and now I"m getting an error. I've figured out, with experiment, that I'm getting the error becaus the character in question doesn't have the skill as one that I've selected to show on the Skill tab (because I haven't invested any skill points in the skill). Is there something I can add to my custom script to prevent it from attempting to apply it to a skill I'm not using, and generating the error? I can click past it, but if I can get it to say "Oh, this character doesn't have that skill, I don't need to try and apply it", that would be better (lets not train ourselves to skip past errors, shall we?)

Thanks for any help. I've included the error and the eval scripts below.


Here is the error:
Attempt to access non-existent child pick 'skKnowEng' from script
- - -
Attempt to access non-existent child pick 'skKnowGeog' from script
- - -
Attempt to access non-existent child pick 'skKnowNobl' from script
- - -
Attempt to access non-existent child pick 'skKnowOth' from script
- - -
Attempt to access non-existent child pick 'skKnowRel' from script



Here is the Eval Script:
~ +1 bonus to your Knowledge skill checks made when in the Grand Lodge.
#situational[hero.child[skKnowArca],"+1 bonus to your Knowledge skill checks made when in the Grand Lodge.",field[name].text]
#situational[hero.child[skKnowDun],"+1 bonus to your Knowledge skill checks made when in the Grand Lodge.",field[name].text]
#situational[hero.child[skKnowEng],"+1 bonus to your Knowledge skill checks made when in the Grand Lodge.",field[name].text]
#situational[hero.child[skKnowGeog],"+1 bonus to your Knowledge skill checks made when in the Grand Lodge.",field[name].text]
#situational[hero.child[skKnowHist],"+1 bonus to your Knowledge skill checks made when in the Grand Lodge.",field[name].text]
#situational[hero.child[skKnowLoc],"+1 bonus to your Knowledge skill checks made when in the Grand Lodge.",field[name].text]
#situational[hero.child[skKnowNat],"+1 bonus to your Knowledge skill checks made when in the Grand Lodge.",field[name].text]
#situational[hero.child[skKnowNobl],"+1 bonus to your Knowledge skill checks made when in the Grand Lodge.",field[name].text]
#situational[hero.child[skKnowOth],"+1 bonus to your Knowledge skill checks made when in the Grand Lodge.",field[name].text]
#situational[hero.child[skKnowPlan],"+1 bonus to your Knowledge skill checks made when in the Grand Lodge.",field[name].text]
#situational[hero.child[skKnowRel],"+1 bonus to your Knowledge skill checks made when in the Grand Lodge.",field[name].text]
Vanye111 is offline   #1 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old June 22nd, 2017, 08:53 AM
In this thread, read post #2 - look for "child" there, and see what else it has to say about that: http://forums.wolflair.com/showthread.php?t=21663
Mathias is online now   #2 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old June 22nd, 2017, 08:58 AM
And once you've figured that out, I'd recommend going further, to "Special Transitions: Searching" (post #7), and see how you can make this a 3-line script that doesn't mind if a user adds a new knowledge skill using the editor, instead of 11 lines, that won't find any new knowledge skills.
Mathias is online now   #3 Reply With Quote
Vanye111
Junior Member
 
Join Date: Aug 2008
Posts: 21

Old June 22nd, 2017, 03:19 PM
Ok, I'm lost. I don't know anything about scripting at all, except what little I've managed to pick up here. Reading your links, it looks like this would be what I'd want to do to locate the appropriate skills:

foreach pick in hero from BaseSkill where "Helper.SkCatKnow"
#situational[hero.child[skKnowArca],"+1 bonus to your Knowledge skill checks made when in the Grand Lodge.",field[name].text]
nexteach

However, when I try it, it puts them all under Knowledge(arcana) instead of under each skill.

Last edited by Vanye111; June 22nd, 2017 at 03:26 PM. Reason: including full eval script
Vanye111 is offline   #4 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old June 22nd, 2017, 03:27 PM
Quote:
Originally Posted by Vanye111 View Post
Ok, I'm lost. I don't know anything about scripting at all, except what little I've managed to pick up here. Reading your links, it looks like this would be what I'd want to do to locate the appropriate skills:

foreach pick in hero from BaseSkill where "Helper.SkCatKnow"
nexteach

However, when I try it, it puts them all under Knowledge(arcana) instead of under each skill.
That is a 'foreach loop" meaning its finding the Knowledge Skills on your character that are present. This means you have to tell the situational script to use the Pick that its currently pointing at instead of hard-coding a specific knowledge skill.

You do this by replacing the hero.child[] with the eachpick statement instead.

Code:
~ Loop through all Knowledge skills on the character
foreach pick in hero from BaseSkill where "Helper.SkCatKnow"

   ~ Add a situational note to the knowledge skill
  #situational[eachpick,"+1 bonus to your Knowledge skill checks made when in the Grand Lodge.",field[name].text]

~ Loop to the next knowledge skill on the character
nexteach
The above logic says loop through each BaseSkill that has the tag "Helper.SkCatKnow" or loop through all the knowledge skills. Each time we find a Knowledge skill add the situational text of +1 bonus to the skill.

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   #5 Reply With Quote
Vanye111
Junior Member
 
Join Date: Aug 2008
Posts: 21

Old June 22nd, 2017, 05:17 PM
Quote:
Originally Posted by ShadowChemosh View Post
The above logic says loop through each BaseSkill that has the tag "Helper.SkCatKnow" or loop through all the knowledge skills. Each time we find a Knowledge skill add the situational text of +1 bonus to the skill.
Looking at it again, I see where I even specified the Knowledge Arcana in my situational text. Thank, folks.
Vanye111 is offline   #6 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 03:06 PM.


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