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
Diaz Ex Machina
Member
 
Join Date: Feb 2017
Location: Italy
Posts: 65

Old April 19th, 2022, 06:51 AM
Quote:
Originally Posted by ploturo View Post
Here is the documentation for the "foreach ___ in ___ where ___" loops.
http://hlkitwiki.wolflair.com/index....age_Statements

In addition to the extra "Category" text which shouldn't be there, the first line of your code has a bigger problem and the for-loop's code will never run.

Code:
foreach thing in BaseLang where "!component.BaseLang"
The foreach thing in BaseLang says to check each thing derived from the BaseLang component, and the where "!component.BaseLang" part says to only run the code for things which don't have the component.BaseLang tag (which every thing derived from BaseLang will automatically have).


Trying to do this sort of thing dynamically like the original code only works in specific situations, where everything is set up in a specific way. (For example, the original code might not work as expected if any deity is tagged with multiple categories, since even if that particular thing entry is excluded by the where part of the for-each loop, it will be hidden if any other thing has one of the other same category tags.)

It also doesn't work well for a situation where there isn't an easy tag to filter in the where expression.

If you are creating your own set of datafile, I would suggest adding your own language category to the specific languages you want to keep using extthing (in the xml) or "*Extend Thing" entries in the editor to add the tag.

Code:
<extthing thing="lCommon" group="LangCat" tag="DEMcore"/>
<extthing thing="lGnome" group="LangCat" tag="DEMcore"/>
Then you can filter your loop to exclude any things with that tag, and add individual HideLang tags for each other language. (You should probably also have your script hard coded to add some specific HideLanCat tags for known categories you don't want, and then exclude those in the where expression too so that you don't have to generate individual tags for all the languages from those categories.)


If you are trying to do a setting conversion from within the script of an individual adjustment, that's significantly more difficult and would require a very thorough understanding of how the existing herolab code works.
I don't think I've understood anything of what you said. I know nothing of coding. Maybe I should give up and just hide/preclude everything I don't want to show when I use my source.

Last edited by Diaz Ex Machina; April 19th, 2022 at 06:56 AM.
Diaz Ex Machina is offline   #11 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 11:12 PM.


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