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
Fenris447
Senior Member
 
Join Date: Sep 2017
Posts: 318

Old October 21st, 2020, 10:22 AM
Apologies for the necro, but I've spent hours trying to solve this:

Brol, before you got this working as a configurable, were you able to set the charges based on the CHA mod of that Alter Self? I'm having trouble doing the same thing with an ability I'm adding for MOoT. I can't seem to figure out how to dynamically alter the trkMax of a bootstrapped SpellLike spell.

Does the container context transition work in an eval script to target a bootstrap?? I know I can find the spell on the hero, but I don't want to alter any other versions of that spell if they're present. Just the one bootstrapped by my specific ability. And weirdly, I cannot get a Foreach to work to find that bootstrapped copy of the spell. Anything I do just tells me the foreach is returning nothing. I've tried every kind of tag you can think of. thingid.____, custom tags, pre-defined custom tags, etc.

"Ooooooooh, he's tryin'!"

Last edited by Fenris447; October 21st, 2020 at 10:28 AM.
Fenris447 is offline   #11 Reply With Quote
dungeonguru
Senior Member
 
Join Date: May 2016
Posts: 590

Old October 21st, 2020, 03:18 PM
In order to narrow down a spell to a particular class you could probably look for the tags spells get from the selection portal.

Like the High Elf cantrip usually has the tag portal.RacSplLst where a wizard spell that is memorized on the Wizard Spells tab gets the tag portal.ClsSplMem3 (or at least that's what I remember).

Otherwise you might be able to look for things that don't have the Racial tags on them like Helper.RaceSpell.

You use these tags in your foreach where clause and you should be good. Just right click on spells in the UI and look at the tags and compare/contrast.
dungeonguru is offline   #12 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,727

Old October 21st, 2020, 03:27 PM
This should get you what you want as long as I understood it correctly. I wrote this without testing anything so you may have to modify it.
Code:
~ Loop through all the spells of X
foreach pick in hero from BaseSpell where "thingid.spXXXXXX"

  ~ Check to see if this spell is bootstrapped by something
  if (eachpick.isroot <> 0) then

    ~ Check the bootstrap to see if its the correct ability
    if (eachpick.root.tagis[thingid.AbilityThatBootstrappedSpell] <> 0) then
      eachpick.field[trkMax].value = maximum(1,#attrmod[aCHA])
    endif
  endif
nexteach

Hero Lab Resources:
Pathfinder - d20pfsrd and Pathfinder Pack Setup
3.5 D&D (d20) - Community Server Setup
5E D&D - Community Server Setup
Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources.
Created by the community for the community
- Realm Works kickstarter backer (Alpha Wolf) and Beta tester.
- d20 HL package volunteer editor.
ShadowChemosh is offline   #13 Reply With Quote
Fenris447
Senior Member
 
Join Date: Sep 2017
Posts: 318

Old October 21st, 2020, 03:56 PM
Quote:
Originally Posted by ShadowChemosh View Post
This should get you what you want as long as I understood it correctly. I wrote this without testing anything so you may have to modify it.
It's pretty perfect, so thanks! I was trying to use a custom tag in the foreach's tag expression. The custom tag was predifined in Tags.1st, auto-tagged to the bootstrap, and even added to the root thing. No matter what, I get an error "Invalid tag expression specified for 'foreach' statement". Different timings didn't make a difference.

I was hoping to have a code that I could just pop into multiple root things to do the same thing for their bootstrapped spells, without having to define the thingid for each every time. But this is good enough!

"Ooooooooh, he's tryin'!"
Fenris447 is offline   #14 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 03:58 PM.


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