Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   HL - Pathfinder Roleplaying Game (http://forums.wolflair.com/forumdisplay.php?f=62)
-   -   Noob Question: Hide (http://forums.wolflair.com/showthread.php?t=66943)

Diaz Ex Machina April 17th, 2022 04:37 AM

Noob Question: Hide
 
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:
https://imgur.com/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.

Mathias April 17th, 2022 06:41 AM

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.

Diaz Ex Machina April 17th, 2022 06:43 AM

How do I "figure out" such thing?

Mathias April 17th, 2022 06:50 AM

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.

Diaz Ex Machina April 17th, 2022 08:35 AM

Now I get this:
https://i.imgur.com/dYBqtf1.png

ploturo April 17th, 2022 06:38 PM

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.

Diaz Ex Machina April 18th, 2022 12:55 AM

Quote:

Originally Posted by ploturo (Post 298833)
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?

Diaz Ex Machina April 18th, 2022 10:25 AM

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.?]

https://i.imgur.com/ndv9KK5.png

Mathias April 18th, 2022 11:08 AM

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?"

ploturo April 18th, 2022 03:01 PM

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.


All times are GMT -8. The time now is 11:40 AM.

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