Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - D&D 5th Edition SRD

Notices

Reply
 
Thread Tools Display Modes
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,552

Old December 24th, 2018, 12:51 PM
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.
ShadowChemosh is online now   #11 Reply With Quote
Reply

Thread Tools
Display Modes

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 08:56 PM.


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