Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
Assuming you setup the drop down to look at Picks and Not Things this means you do NOT need a foreach loop in this logic. This is because field[usrChosen1].chosen is pointing directly to the Skill Pick chosen on the drop down. You can use field[usrChosen1].chosen to assign tags or remove tags or even modify that Picks fields directly.
A foreach loop does the same logic again as field[usrChosen1].chosen just requiring way more CPU time. By using field[usrChosen1].chosen and a foreach loop its like using the GPS in your car and the GPS on your phone at the same time to "really really" make sure you get to the correct location. The above script can be changed to the following: Code:
~ Did the gamer choose something in first dropdown? if (field[usrChosen1].ischosen <> 0) then ~ If the chosen skill is already proficient then make it double if (field[usrChosen1].chosen.tagis[Helper.Proficient] <> 0) then perform field[usrChosen1].chosen.assign[Helper.ProfDouble] ~ Chosen skill not proficient then make it proficient else perform field[usrChosen1].chosen.assign[Helper.Proficient] endif endif ~ Did the gamer choose something 2nd dropdown? if (field[usrChosen2].ischosen <> 0) then ~ If the chosen skill is already proficient then make it double if (field[usrChosen2].chosen.tagis[Helper.Proficient] <> 0) then perform field[usrChosen2].chosen.assign[Helper.ProfDouble] ~ Chosen skill not proficient then make it proficient else perform field[usrChosen2].chosen.assign[Helper.Proficient] endif 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. |
#11 |
|
|