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
DeathSheep
Member
 
Join Date: Jun 2018
Posts: 83

Old October 27th, 2021, 01:43 PM
I am trying to create a barbarian-like ability where you can choose three damage types, and when you are raging, you have resistance to them. I think I'm on the right track in terms of coding, but when I test the power, the dropdown has a ton of stuff but not the damage types. Additionally I only see 2 dropdowns. I'm sure it is something simple like having the wrong tag name, but I don't know exactly what to use. Here is the code:

Code:
  <thing id="cBerPRDewbInst" name="Dewback&apos;s Instinct" description="Choose three damage types other than true damage. While raging, you have resistance to the chosen damage types." compset="CustomSpec" uniqueness="unique">
    <fieldval field="usrCandid1" value="component.DamageType &amp; (dType.Acid|dType.Cold|dType.Fire|dType.PRForce|dType.PRIon||dType.Lightning|dType.Necrotic|dType.Poison|dType.Psychic|dType.PRSonic) &amp; !Helper.Helper"/>
    <fieldval field="usrCandid2" value="component.DamageType &amp; (dType.Acid|dType.Cold|dType.Fire|dType.PRForce|dType.PRIon||dType.Lightning|dType.Necrotic|dType.Poison|dType.Psychic|dType.PRSonic) &amp; !Helper.Helper"/>
    <fieldval field="usrCandid3" value="component.DamageType &amp; (dType.Acid|dType.Cold|dType.Fire|dType.PRForce|dType.PRIon||dType.Lightning|dType.Necrotic|dType.Poison|dType.Psychic|dType.PRSonic) &amp; !Helper.Helper"/>
    <tag group="Helper" tag="Primary"/>
    <tag group="abCategory" tag="BersInstinct"/>
    <tag group="abRange" tag="Personal"/>
    <tag group="abDuration" tag="ConstRage"/>
    <tag group="SpecSource" tag="cHelpBrs"/>
    <tag group="Helper" tag="Helper"/>
    <tag group="Helper" tag="Free"/>
    <eval phase="First" index="3"><![CDATA[
       doneif (hero.tagis[Hero.Raging] = 0)

       doneif (tagis[Helper.Disable] <> 0)

      ~ If nothing chosen then get out now!
      doneif (field[usrChosen1].ischosen = 0)
      doneif (field[usrChosen2].ischosen = 0)
      doneif (field[usrChosen3].ischosen = 0)

       ~ Collect selected types of damage and pull the Resistance tags from them.
      perform field[usrChosen1].chosen.pulltags[DamageRes.?]
      perform field[usrChosen2].chosen.pulltags[DamageRes.?]
      perform field[usrChosen3].chosen.pulltags[DamageRes.?]

      perform forward[DamageRes.?]]]></eval>
    </thing>
Any suggestions as to what I'm missing would be appreciated!
DeathSheep is offline   #1 Reply With Quote
Fenris447
Senior Member
 
Join Date: Sep 2017
Posts: 600

Old October 27th, 2021, 01:59 PM
  1. I didn't realize there were more than chooser fields, so I'm no help with getting the third to display.
  2. For the tag expressions, I usually go with this format for damage types: thingid.dtAcid. That always works for me when everything else is working properly.
  3. I'm not familiar with the "forward" function. I usually use perform hero.pushtags[DamageRes.?] and that does the trick (depending on timing, of course).
  4. Make sure you're establishing what pool of things the tag expression is pulling from. On the editor, this is the "Restrict First List To..." box. For this, you want to pull from all things. If you were to select All Things from that drop-down, you'd see it assigns the tag "ChooseSrc1.Thing" to this feature. I would recommend trying to add that and "ChooseSrc2.Thing", etc.
  5. I don't know if it's part of your text editor or something that you're using to pull this up, but my code within the editor never uses "&amp;". I always just have "&". Again, might just be a translation thing from the editor to your post, but I'm trying to find anything else I can.

EDIT: Thinking about the third box thing; if all else fails, you can always make a second copy of this feature that just features the third box and bootstrap it to the first copy. It's less elegant, but it works.

Found an issue with or have a suggestion for the 5e Community Pack? Please post it here at our GitHub.

Feel free to stop by the Lone Wolf Development Subreddit, for discussion of any and all LWD products and community efforts!

Last edited by Fenris447; October 27th, 2021 at 02:03 PM.
Fenris447 is offline   #2 Reply With Quote
DeathSheep
Member
 
Join Date: Jun 2018
Posts: 83

Old October 27th, 2021, 02:29 PM
1. I wasn't sure if that could be done. Your workaround should do it once I get the first two working
2. Changed the formula to
Code:
    <fieldval field="usrCandid1" value="component.DamageType & (thingid.dtAcid|thingid.dtCold|thingid.dtFire|thingid.dtPRForce|thinid.dtPRIon||thingid.dtLightning|thingid.dtNecrotic|thingid.dtPoison|thingid.dtPsychic|thingid.dtPRSonic) & !Helper.Helper"/>
3. I pulled that from the code for the Bear Totem feature for barbarians...figured I could just switch out the user chosen fields. I changed it to:
Code:
    <eval phase="First" index="3"><![CDATA[
       doneif (hero.tagis[Hero.Raging] = 0)

       doneif (tagis[Helper.Disable] <> 0)

      ~ If nothing chosen then get out now!
      doneif (field[usrChosen1].ischosen = 0)
      doneif (field[usrChosen2].ischosen = 0)
      doneif (field[usrChosen3].ischosen = 0)

       ~ Collect selected types of damage and pull the Resistance tags from them.
      perform field[usrChosen1].chosen.pulltags[DamageRes.?]
      perform field[usrChosen2].chosen.pulltags[DamageRes.?]
      perform field[usrChosen3].chosen.pulltags[DamageRes.?]

      perform hero.pushtags[DamageRes.?]]]></eval>
4. Where do I find the "Restrict First List To..." box? I've been hand typing these in the editor in the Fields section. If there's an easier way, I'd love to know!
5. Yes, it's the text editor. The "amp;" doesn't show up in the Editor.

Last edited by DeathSheep; October 27th, 2021 at 02:46 PM. Reason: Fixing a tag
DeathSheep is offline   #3 Reply With Quote
DeathSheep
Member
 
Join Date: Jun 2018
Posts: 83

Old October 27th, 2021, 02:29 PM
1. I wasn't sure if that could be done. Your workaround should do it once I get the first two working
2. Changed the formula to
Code:
    <fieldval field="usrCandid1" value="component.DamageType & (thingid.dtAcid|thingid.dtCold|thingid.dtFire|thingid.dtPRForce|thinid.dtPRIon||thingid.dtLightning|thingid.dtNecrotic|thingid.dtPoison|thingid.dtPsychic|thingid.dtPRSonic) & !Helper.Helper"/>
3. I pulled that from the code for the Bear Totem feature for barbarians...figured I could just switch out the user chosen fields. I changed it to:
Code:
    <eval phase="First" index="3"><![CDATA[
       doneif (hero.tagis[Hero.Raging] = 0)

       doneif (tagis[Helper.Disable] <> 0)

      ~ If nothing chosen then get out now!
      doneif (field[usrChosen1].ischosen = 0)
      doneif (field[usrChosen2].ischosen = 0)
      doneif (field[usrChosen3].ischosen = 0)

       ~ Collect selected types of damage and pull the Resistance tags from them.
      perform field[usrChosen1].chosen.pulltags[DamageRes.?]
      perform field[usrChosen2].chosen.pulltags[DamageRes.?]
      perform field[usrChosen3].chosen.pulltags[DamageRes.?]

      perform hero.pushtags[DamageRes.?]]]></eval>
4. Where do I find the "Restrict First List To..." box? I've been hand typing these in the editor in the Fields section. If there's an easier way, I'd love to know!
5. Yes, it's the text editor. The "amp;" doesn't show up in the Editor.
DeathSheep is offline   #4 Reply With Quote
DeathSheep
Member
 
Join Date: Jun 2018
Posts: 83

Old October 27th, 2021, 02:52 PM
I see where the "Restrict First List To..." box s, but the "Select From..." box doesn't have damage types as an option.
DeathSheep is offline   #5 Reply With Quote
Fenris447
Senior Member
 
Join Date: Sep 2017
Posts: 600

Old October 27th, 2021, 07:24 PM
Yeah the "select from" is useless 4/5 times, because it has so few things. If "select from" doesn't have what you need, you define your own tag expression in the next box, like you did.

Found an issue with or have a suggestion for the 5e Community Pack? Please post it here at our GitHub.

Feel free to stop by the Lone Wolf Development Subreddit, for discussion of any and all LWD products and community efforts!
Fenris447 is offline   #6 Reply With Quote
DeathSheep
Member
 
Join Date: Jun 2018
Posts: 83

Old October 28th, 2021, 07:22 AM
First off, I REALLY appreciate your advice. I've learned a ton just reading your responses.

That said, that code doesn't seem to be working either. I'm still getting a list of random things that aren't the damage types I specified in the dropdown. I'm really baffled. Here is the code as it stands now:

Code:
  <thing id="cBerPRDewbInst" name="Dewback's Instinct" description="Choose three damage types other than true damage. While raging, you have resistance to the chosen damage types." compset="CustomSpec" uniqueness="unique">
    <fieldval field="usrCandid1" value="component.DamageType & (thingid.dtAcid|thingid.dtCold|thingid.dtFire|thingid.dtPRForce|thinid.dtPRIon||thingid.dtLightning|thingid.dtNecrotic|thingid.dtPoison|thingid.dtPsychic|thingid.dtPRSonic) & !Helper.Helper"/>
    <fieldval field="usrCandid2" value="component.DamageType & (thingid.dtAcid|thingid.dtCold|thingid.dtFire|thingid.dtPRForce|thinid.dtPRIon||thingid.dtLightning|thingid.dtNecrotic|thingid.dtPoison|thingid.dtPsychic|thingid.dtPRSonic) & !Helper.Helper"/>
    <fieldval field="usrCandid3" value="component.DamageType & (thingid.dtAcid|thingid.dtCold|thingid.dtFire|thingid.dtPRForce|thinid.dtPRIon||thingid.dtLightning|thingid.dtNecrotic|thingid.dtPoison|thingid.dtPsychic|thingid.dtPRSonic) & !Helper.Helper"/>
    <tag group="Helper" tag="Primary"/>
    <tag group="abCategory" tag="BersInstinct"/>
    <tag group="abRange" tag="Personal"/>
    <tag group="abDuration" tag="ConstRage"/>
    <tag group="SpecSource" tag="cHelpBrs"/>
    <tag group="Helper" tag="Helper"/>
    <tag group="Helper" tag="Free"/>
    <eval phase="First" index="3"><![CDATA[
       doneif (hero.tagis[Hero.Raging] = 0)

       doneif (tagis[Helper.Disable] <> 0)

      ~ If nothing chosen then get out now!
      doneif (field[usrChosen1].ischosen = 0)
      doneif (field[usrChosen2].ischosen = 0)
      doneif (field[usrChosen3].ischosen = 0)

       ~ Collect selected types of damage and pull the Resistance tags from them.
      perform field[usrChosen1].chosen.pulltags[DamageRes.?]
      perform field[usrChosen2].chosen.pulltags[DamageRes.?]
      perform field[usrChosen3].chosen.pulltags[DamageRes.?]

      perform hero.pushtags[DamageRes.?]]]></eval>
    </thing>
I tried taking the third choice out in case that was giving the compiler a nervous breakdown, but nothing changed.
DeathSheep is offline   #7 Reply With Quote
Fenris447
Senior Member
 
Join Date: Sep 2017
Posts: 600

Old October 28th, 2021, 08:49 AM
Try taking "component.DamageType & " out. I'm assuming that dtPRIon and dtPRSonic are damage types you made?

Found an issue with or have a suggestion for the 5e Community Pack? Please post it here at our GitHub.

Feel free to stop by the Lone Wolf Development Subreddit, for discussion of any and all LWD products and community efforts!
Fenris447 is offline   #8 Reply With Quote
DeathSheep
Member
 
Join Date: Jun 2018
Posts: 83

Old October 28th, 2021, 09:09 AM
Same problem if I take out "component.DamageType & ". Yes, those are new damage types I defined.
DeathSheep is offline   #9 Reply With Quote
Fenris447
Senior Member
 
Join Date: Sep 2017
Posts: 600

Old October 28th, 2021, 03:33 PM
At least in the code you posted, I don't see "ChooseSrc1.Thing". Make sure you have that:
Code:
    <tag group="ChooseSrc1" tag="Thing"/>
    <tag group="ChooseSrc2" tag="Thing"/>
    <tag group="ChooseSrc3" tag="Thing"/>

Found an issue with or have a suggestion for the 5e Community Pack? Please post it here at our GitHub.

Feel free to stop by the Lone Wolf Development Subreddit, for discussion of any and all LWD products and community efforts!
Fenris447 is offline   #10 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 04:11 AM.


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