Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - D&D 5th Edition SRD
Register FAQ Community Today's Posts Search

Notices

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

Old September 5th, 2016, 08:49 AM
Quote:
Originally Posted by EightBitz View Post
Just for my own understanding, in this example, within the foreach loop, you would have to test the value of searchexpr to see if it contains "IsWeapon.wRapier", right? Because if that's not the case, I'm missing something fundamental.

Why is this better than including "IsWeapon.wRapier" in the initial search expression? such as:

searchexpr = field[usrChosen1].chosen.tagids[IsWeapon.wRapier]

I'm still very much a novice at this, so I'm not trying to argue. Just trying to understand.
Making a guess but I think its the field[usrChosen1].chosen that is throwing you. That "field" means we have a dropdown list of Picks/Things that a person selected. Sense we do not know "which" weapon was chosen (in example we assumed Rapier) but it could have just as easily been longsword or greatsword. In other words the dropdown has a choice of weapons from one to hundred.

So we need to pull a "Tag" group from the weapon chosen without knowing what the "specific" tag is. Then use that tag to find all Live Picks of that weapon on the hero which is what the foreach loop is doing. Sense the "search expression" field holds all the logic of which Picks to select we do not need to test for anything in the foreach loop.

My initial comment was to not use "thingid.?" tag group for the search expression as a Pick can only have ONE thingid.? group on itself. Where IsWeapon.? group can be assigned many times to a Pick. Which allows flexibility.

Hopefully that helps.

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   #11 Reply With Quote
EightBitz
Senior Member
 
Join Date: May 2013
Posts: 1,458

Old September 5th, 2016, 10:52 AM
Quote:
Originally Posted by ShadowChemosh View Post
Making a guess but I think its the field[usrChosen1].chosen that is throwing you. That "field" means we have a dropdown list of Picks/Things that a person selected. Sense we do not know "which" weapon was chosen (in example we assumed Rapier) but it could have just as easily been longsword or greatsword. In other words the dropdown has a choice of weapons from one to hundred.

So we need to pull a "Tag" group from the weapon chosen without knowing what the "specific" tag is. Then use that tag to find all Live Picks of that weapon on the hero which is what the foreach loop is doing. Sense the "search expression" field holds all the logic of which Picks to select we do not need to test for anything in the foreach loop.

My initial comment was to not use "thingid.?" tag group for the search expression as a Pick can only have ONE thingid.? group on itself. Where IsWeapon.? group can be assigned many times to a Pick. Which allows flexibility.

Hopefully that helps.
OK, yep. You were exactly right on the point I was missing. I had to go back and read the original post to put it all together, but I got it now. Thanks.
EightBitz is offline   #12 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 01:48 PM.


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