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
Frodie
Senior Member
 
Join Date: May 2007
Location: Durham, NC
Posts: 1,747

Old November 16th, 2013, 08:52 AM
I am trying to hide a class special on a new bloodline (it's a copy of the Sor -Draconic and it's abilities). The ability is the breath weapon and it appears at 9th, 17th and 20th level. I have 3 copies of the same script and it works fine, but I can only get 2 of the 3 times it appears to hide. What would be the best timing for this:

doneif (hero.childlives[rcFGCoWBWG] + hero.childlives[rcFGCoWBWQ] + hero.childlives[raFGCoWBW] <> 1)

perform hero.childfound[cFGCoWBWpn].assign[Helper.SpcDisable]
perform hero.childfound[cFGCoWBWpn].assign[Helper.Obsolete]
perform hero.childfound[cFGCoWBWpn].assign[Hide.Special]

Seems one script at first 500 and one at final 80000 works fine, but I can't get the third script timing to work. Any ideas?
Frodie 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 November 16th, 2013, 09:22 AM
Quote:
Originally Posted by Frodie View Post
I have 3 copies of the same script and it works fine, but I can only get 2 of the 3 times it appears to hide. What would be the best timing for this:
Your very question has your answer. You have three copies of a Pick so you have Three Instances of the same Pick in memory. But your script you listed only is going to go after "one" of those Instances.

You have to change the script to find all three instances. You would do this with a "foreach loop" so that you loop through each instance of the Picks in memory. The hero.childfound[] only goes after the "first" random instance in memory.

The text from the HL wiki says the following for childfound[]: "Transitions to the pick context corresponding to the first pick within the container that derives from the thing with the id specified. This transition is identical to "child[id]", except that the existence of the child pick is optional. If the child is found, the transition occurs normally. If the child does not exist, no run-time error is reported, although the transition still fails to resolve."

The foreach wiki text says: "This form of "foreach" iterates through the picks that have been added to a container, processing only those that satisfy the specified set of criteria. With this version, the "context" must specify the container, which can be any valid context transition that identifies a container (e.g. "hero" or "child[pickid].gizmo"). The code within the "foreach" block is invoked for every pick in the container that satisfies the optional tag expression. Within the "foreach" block, the current pick being iterated can be accessed via the "eachpick." script context transition."

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
Frodie
Senior Member
 
Join Date: May 2007
Location: Durham, NC
Posts: 1,747

Old November 16th, 2013, 09:53 AM
Very cool! Thank you!
Frodie is offline   #3 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 02:37 AM.


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