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)
-   -   Adding a floating spell from another class (http://forums.wolflair.com/showthread.php?t=63795)

Brolthemighty February 5th, 2020 08:25 AM

Adding a floating spell from another class
Alright, so my DM has given my a ring that grants a 1/short rest spell from the Warlock class list (am not a Warlock). But I can change out which spell it is, as long as it's of a level I can cast.

I thought creating a little selector like the Bard's arcane secrets on the ring would work. I got the ring to have a selector where I chose what class, but it wouldn't pull up any spells.

I would REALLY rather not have to create a whole new configurable/tab for a single spell selection and was hoping for a better solution (although if I must, I must). Anyone able to help?

Wondrous Item: Ring of Blending
Requires: Attunement and equipped
- Alter Self CHA/long rest
- Floating Warlock Spell 1/short rest
- Spell can be of any level I can cast, and it's changeable.

Brolthemighty February 5th, 2020 08:28 AM

Details on the item on what I've done so far:

Needs Attunement
Show in Tracked Resources List
Automatic Calculation: Attr Only
Charge Calc: Charisma
Usage: /long rest
Castable Spell: Alter Self

Item Selection:
Select from: Classes
Restrict First list to: All things

Second Selection from: Spells level 1-9
Restricted to: All picks on container.

I'm not worried about building in rule-outs to check on whether it's a spell of a level castable, I'll just manually keep that in check.

Edited: Added everything I have programmed to include the Alter Self bit.

dungeonguru February 5th, 2020 12:29 PM

If you are OK with locking it down to a warlock spell only you can do the following:

Item Selection:
Select From: - None -
Custom Expression: (component.BaseSpell & sClass.cHelpWlk)
Restrict First List to: All Things

That will list all basic warlock spells (not any added from a particular patron), which is still a lot of spells.

This will get you the spells listed. I'm not sure what your end goal is, you will likely have to play with scripting to get any information from the usrChosen1 object passed on to the character sheet or parent item.

Spell selection is most easily handled by the configurable logic since a configurable does a lot of things "behind the scenes" that makes it easier when you're basically trying to dynamically bootstrap something to a hero.

Brolthemighty February 5th, 2020 12:47 PM

End goal is to have a 1/shirt rest warlock spell tied to the item. Should show up on the in-play tab so I can track its use. I appreciate the help and see how it goes!

Edit: Alright, so it looks like the little bit broke the rest of the Ring. Looks like I need to fiddle with this some more. I'm editing the OP with the entire item's abilities since it doesn't seem it'll be as easy as I thought, and all the abilities might end up getting in each other's way.

The biggest reason I wasn't using a configurable is mostly cause I didn't want to add even more tabs/confiurables to the character for just a floating spell. If I must, I must though. Just trying different avenues. I was looking at the Arcane Secrets ability coding to try and glean a way to do it.

Brolthemighty February 9th, 2020 02:24 PM

At the moment I’m just using and adjustment to add the floating warlock spell, and manually doing it. I couldn’t figure out how to have both the Alter Self added with CHA/day, and the Warlock Spell per shirt rest. Was t having any luck finding an item that had two spell likes with different charges/tracking sets.

dungeonguru February 10th, 2020 04:00 AM

This item is a tough one.

Pushing separate trackers on each spell isn't that hard if you can figure out how to access them, but it's that dynamic spell that I can't figure out how to add without a configurable. I've been trying to figure out if a gizmo might be able to do it, like how magic weapons have this gizmo that lets you choose a weapon but I've hit my limit on knowledge there.

I'm almost at the point of suggesting as a workaround creating a "spell template" spell.

What you would do is bootstrap alter self and the spell template spell to this item.

In a script that runs post attributes you could do something like:

~ set the tracker on Alter Self to CHA/LongRest
container.child[spAlteSelf].field[trkMax].value = maximum(1,#attrmod[aCHA])
perform container.child[spAlteSelf].assign[Usage.LongRest]

~ set the tracker on the spell template to 1/ShortRest
~ you could do this directly on the bootstrap if you wanted.
container.child[spNEWID].field[trkMax].value = 1
perform containter.child[spNEWID].assign[Usage.ShortRest]

Then in a second script probably in the Render timing section.

Grab all the name/description of the spell chosen in your dropdown and "overwrite" your spell template fields/tags.

container.child[spNEWID].field[livename].text = field[usrChosen1].chosen.field[livename].text
container.child[spNEWID].field[CustDesc].text = field[usrChosen1].chosen.field[CustDesc].text
and do pulltags /pushtags for any tags

It's very much a workaround though.

Brolthemighty February 10th, 2020 02:49 PM

Interesting. I’ll play around with what you’ve provided, thank you. I have a feeling the easiest thing to do is just cave and create a configurable and to just stop being so stubborn about it. Thank you.

Brolthemighty February 16th, 2020 01:07 PM

Alright, I'm either having a huge brainfart...or I'm just burnt out looking at all the coding right now. I caved and decided I was just going to use a configurable....and still couldn't figure out how to get it to work. Bleh.

Brolthemighty March 7th, 2020 08:19 PM

Bump on a sorta necro post.

Finally sitting down to try and make this a bit of a cleaner workup. What I currently have is the ring broken down to its individual parts as multiple rings. It's pretty rough. I realized that I need to go ahead and make this a full-on configurable. So now that's what I'm doing. I went over the full text of the item and such, and listed the multiple things it does that would need a tracker/selector.

Alter Self: CHa mod/long rest
Bootstrap Alter Self
Eval: Post-Att/10000/1

set the tracker on Alter Self to CHA/LongRest
container.child[spAlteSelf].field[trkMax].value = maximum(1,#attrmod[aCHA])
perform container.child[spAlteSelf].assign[Usage.LongRest]

Floating Sorcerer Cantrip
- Looking at either the Magic Initiate scrips, or the half-elf variant scripts for this.

Floating Sorcerer/Warlock Spell: 1/short rest

Going back through what was already done, it was using the various little menu options and stuff in an item...which doesn't seem to be the same in the configurable. So I'm mashing stuff together and just seeing if it works. Any help or guidance is appreciated.

For the Sorcerer Cantrip, I was looking at the coding from either Magic Initiate or from the half-elf variant. Both go about it differently.

Brolthemighty March 7th, 2020 09:40 PM

For the floating spell and the Cantrip, I think I need to split it up into two parts. The Cantrip that comes from the sorcerer spell list, and then the level 1+ spell/long rest that comes from the Sorcerer Warlock list.

Technically, using the Spell Sniper scripting, I can add a Sorcerer cantrip...although looking at it, it looks like it allows for the selecting of a level 1+ spell as well and have that be set to 1/long rest by the way of Racial spell....but I don't see where all that leads into or how to populate it. So I'm going to try and leave the script as it is and see how it goes.

Fenris447 October 21st, 2020 09: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.

dungeonguru October 21st, 2020 02: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.

ShadowChemosh October 21st, 2020 02: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. :)

~ 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])

Fenris447 October 21st, 2020 02:56 PM


Originally Posted by ShadowChemosh (Post 291502)
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. :confused:

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!

All times are GMT -8. The time now is 12:32 AM.

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