Senior Member
Join Date: May 2007
Location: Durham, NC
Posts: 1,747
|
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? |
#1 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
Quote:
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. |
|
#2 |
Senior Member
Join Date: May 2007
Location: Durham, NC
Posts: 1,747
|
Very cool! Thank you!
|
#3 |
|
|