• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Noob Question: Hide

Diaz Ex Machina

Well-known member
How can I hide/preclude all the other traits that don't come from a determined source? Like, if I have "The Shackled City" source selected I want to see only its traits, nothing else (not even - Custom Trait -).
I've tried this method, but it gives me this error:
mEdRUAB.png

Here's the code I used (Phase First, Priority 10000, Index 1):
Code:
      ~ Find all other traits
      foreach thing in Trait where "!TraitCat.ShackCity"

        ~ If no trait category then pull the thingid
        If (eachthing.tagcount[TraitCat.?] = 0) Then
          perform eachthing.pulltags[thingid.?,HideTrait]
        ~ If we have a category then pull the cateogry only
        ~ if we have not already pulled it.
        Else
          If (eachthing.intersect[TraitCat,TraitCat] = 0) then
            perform eachthing.pulltags[TraitCat.?]
          Endif
        Endif
      nexteach

      ~ Create Hide Trait Catagory tags
      perform pulltags[TraitCat.?,HideTrCat]
      ~ Push the hide trait tags to the hero
      perform hero.pushtags[HideTrCat.?]
      perform hero.pushtags[HideTrait.?]
Thank you in advance for your help and time.
 
Right now, you've got a typo in the second line of that text - debug the trait picks - figure out what the correct component Id is that you should be using to identify them as a group.
 
Develop menu, make sure Enable Data File Debugging is turned on. Then, add a trait to your test character, right-click it, and choose "Show Debug Tags for XXXXX". In the list of tags, look for the various "component" tags, and find one that will narrow the search down as much as possible.
 
The HideDeity and HideDeiCat tags were added in an update to specifically allow data file authors to control which deities are shown to the player.

Those tag groups were probably hardcoded into the denytag element of the "Deity" ChooserTable, which is something that scripts can't change on existing choosers or tables in the UI.

Unless similar tag groups were added to the denytag element of the traits table, you can't use the same method since it requires LW to have explicitly mapped the tag group on the hero to a tag group on the things that would be displayed.
 
The HideDeity and HideDeiCat tags were added in an update to specifically allow data file authors to control which deities are shown to the player.

Those tag groups were probably hardcoded into the denytag element of the "Deity" ChooserTable, which is something that scripts can't change on existing choosers or tables in the UI.

Unless similar tag groups were added to the denytag element of the traits table, you can't use the same method since it requires LW to have explicitly mapped the tag group on the hero to a tag group on the things that would be displayed.

Ok, so what do I do now?
 
Another question: I'm trying to hide all non-Core languages (all those languages outside the Core Rulebook), but I'm having a hard time with that too.
Code:
      ~ Find all non-Greyhawk languages
      foreach thing in BaseLang Category where "!component.BaseLang"

        ~ If no language category then pull the thingid
        If (eachthing.tagcount[LangCat.?] = 0) Then
          perform eachthing.pulltags[thingid.?,HideLang]
        ~ If we have a category then pull the cateogry only
        ~ if we have not already pulled it.
        Else
          If (eachthing.intersect[LangCat,LangCat] = 0) then
            perform eachthing.pulltags[LangCat.?]
          Endif
        Endif  
      nexteach

      ~ Create Hide Language Catagory tags
      perform pulltags[LangCat.?,HideLanCat]
      ~ Push the hide deity tags to the hero
      perform hero.pushtags[HideLanCat.?]
      perform hero.pushtags[HideLang.?]
ndv9KK5.png
 
In line 2, what is "Category"?


"Reference to undeclared variable" means "I don't recognize this code (because it's not something that exists) - maybe you were trying to use a variable?"
 
Here is the documentation for the "foreach ___ in ___ where ___" loops.
http://hlkitwiki.wolflair.com/index.php5?title=Other_Language_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.
 
Last edited:
Here is the documentation for the "foreach ___ in ___ where ___" loops.
http://hlkitwiki.wolflair.com/index.php5?title=Other_Language_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:
Back
Top