Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   HL - D&D 5th Edition SRD (http://forums.wolflair.com/forumdisplay.php?f=89)
-   -   Selectable Damage Resistances (http://forums.wolflair.com/showthread.php?t=66472)

DeathSheep October 27th, 2021 01:43 PM

Selectable Damage Resistances
 
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!

Fenris447 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.

DeathSheep 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 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 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.

Fenris447 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.

DeathSheep 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.

Fenris447 October 28th, 2021 08:49 AM

Try taking "component.DamageType & " out. I'm assuming that dtPRIon and dtPRSonic are damage types you made?

DeathSheep October 28th, 2021 09:09 AM

Same problem if I take out "component.DamageType & ". Yes, those are new damage types I defined.

Fenris447 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"/>



All times are GMT -8. The time now is 04:46 PM.

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