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
wynlyndd
Member
 
Join Date: Nov 2014
Posts: 90

Old February 16th, 2020, 03:32 PM
Okay, thinking about how to add the expanded spell list for the UA Class Variants, I tried to use ExtendThing which was less than ideal. I decided to see how other options did it.

Enter the Stone Magic Sorcerous Origin from UA. It adds a bunch of non-sorcerer spells.

So following its lead I added this code:
Code:
<document signature="Hero Lab Data">
  <thing id="cElmSpSCM" name="Elemental Spell" description="When you cast a spell that deals a type of damage from the following list, you can spend 1 sorcery point to change that damage type to one of the other listed types: acid, cold, fire, lightning, thunder. If a wild sorc, roll d20. If 5 or below, determine dmg type randomly. If affected by Tides of Chaos, always randomly determine dmg type." compset="CustomSpec" summary="Spend 1 sorc. pt.: Choose dmg type from 5 elements." uniqueness="unique">
    <usesource source="p5eSorUACVAP"/>
	<tag group="Helper" tag="Secondary" name="Secondary" abbrev="Secondary"/>
    <tag group="SpecSource" tag="cHelpSor" name="Sorcerer" abbrev="Sorcerer"/>
    <tag group="abAction" tag="Free" name="Free" abbrev="Free"/>
    <tag group="abCategory" tag="SorMetamag" name="Sorcerer Metamagic Ability" abbrev="Sorcerer Metamagic Ability"/>
    <tag group="abDuration" tag="Instant" name="Instantaneous" abbrev="inst"/>
    <tag group="abRange" tag="Personal" name="Personal" abbrev="pers"/>
	<bootstrap thing="cUAExSpLt">
      <autotag group="ClSpecWhen" tag="1"/>
    </bootstrap>
    </thing>

	<thing id="cUAExSpLt" name="Expanded Spell List" description="You must otherwise obey all the restrictions for selecting the spell, and it becomes a sorcerer spell for you.\n\n" compset="ClSpecial">
    <usesource source="p5eSorUACVAP"/>
	<eval phase="Final" priority="21000"><![CDATA[doneif (tagis[Helper.ShowSpec] = 0)
doneif (tagis[Helper.Disable] <> 0)

~these vars will hold the tag expressions for spells and cantrips

var cantrip as string
var spell as string
var known as string 
var first as string
var second as string
var third as string
var fourth as string
var sixth as string
var eigth as string
var ninth as string


~ fetch spell expressions
spell = hero.childfound[cHelpSor].field[cSpKnoExpr].text 
known = hero.childfound[cHelpSor].field[cSpellExpr].text 


~ these receive the extra spells for each circle
cantrip = " | thingid.sp5CXGEPrS "
first = " | thingid.spGrease | thingid.spProtGoEv "
second = " | thingid.spFlamBlad | thingid.spFlamSphe "
third = " | thingid.spVampTouc "
fourth = " | thingid.spFireShie "
sixth = " | thingid.spFlesSton "
eigth = " | thingid.spDemiplan "
ninth = " | thingid.spForesigh "

hero.childfound[cHelpSor].field[cCnKnoExpr].text &= cantrip
spell &= cantrip

if (#levelcount[Sorcerer] >= 1) then
  spell &= first
  known &= first
  if (#levelcount[Sorcerer] >= 3) then
    spell &= second
    known &= second
    if (#levelcount[Sorcerer] >= 5) then
      spell &= third
      known &= third
      if (#levelcount[Sorcerer] >= 7) then
        spell &= fourth
        known &= fourth
  		if (#levelcount[Sorcerer] >= 11) then
		  spell &= sixth
		  known &= sixth
        endif		  
      endif
    endif
  endif
endif
if (#levelcount[Sorcerer] >= 15) then
  spell &= eigth
  known &= eigth
  if (#levelcount[Sorcerer] >= 17) then
    spell &= ninth
	known &= ninth
	endif
endif

hero.childfound[cHelpSor].field[cSpKnoExpr].text = spell
hero.childfound[cHelpSor].field[cSpellExpr].text = known
hero.childfound[cHelpSor].field[cSplBkExpr].text = known]]></eval>
    </thing>

  </document>
Which worked! It added Grease, Flame Blade, FlameShield, VampricTouch, Fire Shield, and Flesh to Stone, Demiplane, and Foresight to the Sorcerer's spell list. And it is toggleable via Configure Hero.

There appears to be a limit to nested if statements, so that's why the last two spell levels are checked in a separate if statement.

But I think I have it!!!!

Last edited by wynlyndd; February 16th, 2020 at 04:47 PM. Reason: solved it
wynlyndd is offline   #1 Reply With Quote
wynlyndd
Member
 
Join Date: Nov 2014
Posts: 90

Old February 17th, 2020, 04:51 AM
one bit of odd behavior: If you aren't of the right level, that spell isn't going to show in the spell list, unlike all of the other spells. I may be able to fix that but I am not near my computer with Hero Lab right now.

Fixed in my second bit of code below.

Last edited by wynlyndd; February 19th, 2020 at 11:57 AM.
wynlyndd is offline   #2 Reply With Quote
wynlyndd
Member
 
Join Date: Nov 2014
Posts: 90

Old February 17th, 2020, 08:35 AM
Actually, it's even easier than that.
Code:
<?xml version="1.0" encoding="UTF-8"?>
<document signature="Hero Lab Data">
  <thing id="cElmSpSCM" name="Elemental Spell" description="When you cast a spell that deals a type of damage from the following list, you can spend 1 sorcery point to change that damage type to one of the other listed types: acid, cold, fire, lightning, thunder. If a wild sorc, roll d20. If 5 or below, determine dmg type randomly. If affected by Tides of Chaos, always randomly determine dmg type." compset="CustomSpec" summary="Spend 1 sorc. pt.: Choose dmg type from 5 elements." uniqueness="unique">
    <usesource source="p5eSorUACVAP"/>
	<tag group="Helper" tag="Secondary" name="Secondary" abbrev="Secondary"/>
    <tag group="SpecSource" tag="cHelpSor" name="Sorcerer" abbrev="Sorcerer"/>
    <tag group="abAction" tag="Free" name="Free" abbrev="Free"/>
    <tag group="abCategory" tag="SorMetamag" name="Sorcerer Metamagic Ability" abbrev="Sorcerer Metamagic Ability"/>
    <tag group="abDuration" tag="Instant" name="Instantaneous" abbrev="inst"/>
    <tag group="abRange" tag="Personal" name="Personal" abbrev="pers"/>
	<bootstrap thing="cUAExSpLt">
      <autotag group="ClSpecWhen" tag="1"/>
    </bootstrap>
    </thing>

	<thing id="cUAExSpLt" name="Expanded Spell List" description="You must otherwise obey all the restrictions for selecting the spell, and it becomes a sorcerer spell for you.\n\n" compset="ClSpecial">
    <usesource source="p5eSorUACVAP"/>
	<eval phase="Final" priority="21000"><![CDATA[doneif (tagis[Helper.ShowSpec] = 0)
doneif (tagis[Helper.Disable] <> 0)

~these vars will hold the tag expressions for spells and cantrips

var cantrip as string
var spell as string
var known as string 
var first as string
var second as string
var third as string
var fourth as string
var sixth as string
var eigth as string
var ninth as string


~ fetch spell expressions
spell = hero.childfound[cHelpSor].field[cSpKnoExpr].text 
known = hero.childfound[cHelpSor].field[cSpellExpr].text 


~ these receive the extra spells for each circle
cantrip = " | thingid.sp5CXGEPrS "
first = " | thingid.spGrease | thingid.spProtGoEv "
second = " | thingid.spFlamBlad | thingid.spFlamSphe "
third = " | thingid.spVampTouc "
fourth = " | thingid.spFireShie "
sixth = " | thingid.spFlesSton "
eigth = " | thingid.spDemiplan "
ninth = " | thingid.spForesigh "

hero.childfound[cHelpSor].field[cCnKnoExpr].text &= cantrip

spell &= first
known &= first

spell &= second
known &= second

spell &= third
known &= third

spell &= fourth
known &= fourth

spell &= sixth
known &= sixth

  spell &= eigth
  known &= eigth

 spell &= ninth
known &= ninth


hero.childfound[cHelpSor].field[cSpKnoExpr].text = spell
hero.childfound[cHelpSor].field[cSpellExpr].text = known
hero.childfound[cHelpSor].field[cSplBkExpr].text = known]]></eval>
    </thing>

  </document>
You could even run all the spells into one massive string but this is spaced out for readablity

Last edited by wynlyndd; February 17th, 2020 at 08:42 AM.
wynlyndd is offline   #3 Reply With Quote
Fenris447
Senior Member
 
Join Date: Sep 2017
Posts: 272

Old February 19th, 2020, 09:51 AM
Awesome work so far! I haven't had a chance to put it into HL and play around with it, but I think you've got this covered!

I've been messing with ways to get the variant features in. I've landed on a working solution for many of the options. Players will need to select an adjustment for their class. The adjustment calls up a configurable for that class's features. Users can select any or all of their available variant features from a list.

The problems will come in whether or not those individual abilities can do what they're supposed to, especially when they're replacing existing features. But we'll have to take those on a case-by-case basis.

The other things, like new Warlock Invocations, Fighting Styles, etc. will all be available as long as the user has selected the Class Feature Variant source. They'll just show up as new options for those features, and can be ignored if necessary.

"Ooooooooh, he's tryin'!"
Fenris447 is offline   #4 Reply With Quote
wynlyndd
Member
 
Join Date: Nov 2014
Posts: 90

Old February 19th, 2020, 10:58 AM
Quote:
Originally Posted by Fenris447 View Post
The other things, like new Warlock Invocations, Fighting Styles, etc. will all be available as long as the user has selected the Class Feature Variant source. They'll just show up as new options for those features, and can be ignored if necessary.
Yeah anything that was an enhancement, I figured to just add to the character sheet and if the DM did't allow it you should ignore.

It's when the feature replaces that I was going to try and figure out next. Was going to look into conditional bootstraps but I haven't had the time yet.
wynlyndd is offline   #5 Reply With Quote
dungeonguru
Senior Member
 
Join Date: May 2016
Posts: 576

Old February 19th, 2020, 11:02 AM
This is truly awesome coding, you've got a pretty good glimpse at playing with spells there.

I have a suggestion for the Community Pack - like Eldritch Knights are supposed to only be able to pick abjuration/evocation spells initially (at least till level 8). You could add something like the following to enforce that by modifying the code you posted:

Code:
doneif (tagis[Helper.ShowSpec] = 0)
doneif (tagis[Helper.Disable] <> 0)

~ Once we're 8th level and above we can remove the restriction on spells
~ We could probably do some counting of the sSchool tags to enforce 
~ that at most we have 4 non Abjuration/Evocation spells but 

doneif (#levelcount[Fighter] > 7)

~ Otherwise we modify the spell lists.

var spell as string
var known as string 

~ fetch spell expressions from the initial lists
spell = "((" & hero.childfound[cHelpFtr].field[cSpKnoExpr].text & ")"
known = "((" & hero.childfound[cHelpFtr].field[cSpellExpr].text & ")"

~ Narrow down to abjuration and evocation only
spell &= " & (sSchool.Abjur|sSchool.Evocation))"
known &= " & (sSchool.Abjur|sSchool.Evocation))"

~ push out the new lists
hero.childfound[cHelpFtr].field[cSpKnoExpr].text = spell
hero.childfound[cHelpFtr].field[cSpellExpr].text = known
hero.childfound[cHelpFtr].field[cSplBkExpr].text = known
dungeonguru is offline   #6 Reply With Quote
Enforcer84
Senior Member
 
Join Date: Oct 2011
Location: Corvallis
Posts: 282

Old February 19th, 2020, 02:40 PM
this is awesome work!
Enforcer84 is offline   #7 Reply With Quote
wynlyndd
Member
 
Join Date: Nov 2014
Posts: 90

Old February 19th, 2020, 04:03 PM
May I see?
Quote:
Originally Posted by Fenris447 View Post
Awesome work so far! I haven't had a chance to put it into HL and play around with it, but I think you've got this covered!

I've been messing with ways to get the variant features in. I've landed on a working solution for many of the options. Players will need to select an adjustment for their class. The adjustment calls up a configurable for that class's features. Users can select any or all of their available variant features from a list.

The problems will come in whether or not those individual abilities can do what they're supposed to, especially when they're replacing existing features. But we'll have to take those on a case-by-case basis.

The other things, like new Warlock Invocations, Fighting Styles, etc. will all be available as long as the user has selected the Class Feature Variant source. They'll just show up as new options for those features, and can be ignored if necessary.
wynlyndd is offline   #8 Reply With Quote
Fenris447
Senior Member
 
Join Date: Sep 2017
Posts: 272

Old February 20th, 2020, 08:15 AM
Here's the relevant stuff I have. It has everything that's relevant to the Bard with placeholders for each ability/feature.

Personally, I think sticking to 1 single CFV source and controlling the addition of the features through an adjustment -> configurable is the cleanest implementation. I mentally groan every time I see how bloated out our configure hero screen already is. I'm going to take a stab at adding your code in for the Bard expanded spell list.

Code:
  <thing id="p5CCFVBrd" name="Class Feature Variants - Bard" compset="InPlay">
    <usesource source="p5eCFVUACP"/>
    <bootstrap thing="cfg5CCFVBrd"></bootstrap>
    <exprreq message="Test"><![CDATA[#levelcount[Bard] >= 1]]></exprreq>
    </thing>
  <thing id="cfg5CCFVBrd" name="Bard Variant Features" compset="Configure" uniqueness="unique">
    <tag group="Helper" tag="Allow1Abil"/>
    </thing>
  <thing id="cBrd5CMgInsp" name="Magical Inspiration" description="&lt;just needs text&gt;" compset="CustomSpec" uniqueness="unique">
    <tag group="AllowRCust" tag="cfg5CCFVBrd"/>
    </thing>
  <thing id="cAll5CSplVers" name="Spell Versatility" description="&lt;just needs text&gt;" compset="CustomSpec" uniqueness="unique">
    <tag group="AllowRCust" tag="cfg5CCFVBrd"/>
    </thing>
  <thing id="cAll5CPrfVers" name="Proficiency Versatility" description="&lt;Needs programming&gt;" compset="CustomSpec" uniqueness="unique">
    <tag group="AllowRCust" tag="cfg5CCFVBrd" name="Bard Variant Features" abbrev="Bard Variant Features"/>
    </thing>
  <thing id="cBrd5CXSplLst" name="Expanded Spell List" description="&lt;Specific to the Bard, needs coding&gt;" compset="CustomSpec" uniqueness="unique">
    <tag group="AllowRCust" tag="cfg5CCFVBrd"/>
    <tag group="Helper" tag="SpecUp"/>
    </thing>

"Ooooooooh, he's tryin'!"
Fenris447 is offline   #9 Reply With Quote
wynlyndd
Member
 
Join Date: Nov 2014
Posts: 90

Old February 20th, 2020, 08:38 AM
Thanks Fenris, I'll try to use what you did for the Sorcerer.

As you can probably tell, it's what I am currently playing so I tend to scratch those itches first.

As far as combining it into a single source, that's probably the best choice and I bow to your knowledge. I was just happy I figured out how to make subheadings and selectable options in Configure Hero.
wynlyndd 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:05 PM.


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