Disabling Spells
How would I go about disabling a spell? The new Order of Scribes has a feature that temporarily removes spells from your spellbook for 1d6 long rests. I have everything figured out for how to do this, except for two problems:
1. I have a foreach loop that should look at each spell in the hero with a particular thingid, but for some reason it's only finding copy of the spell in the spellbook, not the pick in the Wizard's prepared spells. Code:
foreach pick in hero from BaseSpell where "thingid.(spellID here)" 2. The Helper.Disable tag does nothing to spells, so it's just a placeholder in the code above. I tried Hide.Spell, but that also didn't do anything. Once I figure out my problem with the foreach, is there any tag I can add/delete or field I can change in the spell to make it clear that the Wizard can't use it until it comes back? Worst case I'll just add sNameMod that says "Forgotten" or whatever, but I'd prefer something to make it go red. |
I'd try doing it with a focus instead so its doing it on a specific spell chosen from a drop down menu. Also you need to make sure you have the right timing on the scripting. Hide.Spell will not do it. You might have to try deleting the sClass tag for the class to make it not show up in the list of spells you can prepare.
|
I already have a dropdown to actually pull the spell from the spellbook. I can directly add an sNameMod (or do whatever else I need) to the spellbook pick of the spell. The foreach I'm using is actually using a string for the expression, which is the thingid that I've pulled from the chosen (spellbook) spell.
What I need to do is also find and manipulate the copy of that spell that's in the prepared list, which is a separate pick of that spell. |
The spell in the spellbook will have a tag: Spellbook.cHelpWiz
The prepared spell will have a tag: Helper.Memorized You might want to find the one with Helper.Memorized and remove the Helper tag. That should remove it from the Prepared list. |
Any ideas why the foreach isn't working?
|
Here's and example of how I might set up the foreach.
Code:
var searchexpr as string The problem is probably with timing since both copies of the spell are picks that are assigned through different portals that probably run really close together in timing, the trick is to pick the right time. I don't know when they kick off but it might be worth digging into the timing report of a "live" character with a spellbook. I'm going to suggest another path after thinking about how the rule as written is phrased. How hard would it be to use your spell selection to "disable" to instead throw a validation error - something like: "You must not have the spell (SPELLNAME) memorized if you have it chosen in (ABILITYNAME)." Kinda like the Acolyte of Nature ability on the Nature Cleric Domain throws an error if you don't have the cantrip you choose memorized. |
I'd LOVE to have it throw an error. That would be preferable over what I'm trying to do. But I have no idea how to generate validation errors (outside of some light experience with pre-requisites). Any resources you could point me to there? I'll take a look at the Acolyte of Nature, of course.
|
Quote:
|
Quote:
Code:
foreach pick in hero from BaseSpell where "thingid.(spellID here)" |
Yeah I know it was at least finding the spellbook version of the spell, as I could see the tags were being pushed to it. The debug will need to check for more than just the id string, since they'd be the same for the same spell. I can also have the debug push me something like the memorized tag, if present, to see if I'm actually getting the memorized version.
Is there any way to determine when in the timing a pick goes live? To see when that memorized spell is actually considered present on the hero? I would have assumed it's live the moment it's picked, before the timings even start. But that must not be the case here. Because the foreach is based on the thingid, it should pull in every version of that spell on there. But it's not. |
All times are GMT -8. The time now is 08:46 AM. |
Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.