Programmatic Way to Add Text to Spell Description
I know we can't add to the xml export used for printing, but I'm trying to figure out a way to denote ritual spells in the export. In the very short term, I've created copies of spells, replaced the original, and added *ritual* to the end of the description. In my xsl transform, I find that value, set a variable, and strip it out of the text. I do not enjoy this, and I'm reluctant to want to do it for every ritual spell. So here's the question:
Given that there is a tag on the spell that denotes if it's a ritual, is there an eval script or something else that I can use at a high level to automatically add to the end of the description text? To be clear, I am looking for a solution that is NOT to modify each individual manually, but something that would also work for any new spells that get added by default (i.e. due to the ritual tag). Thanks! |
Off the top of my head, something like:
Code:
~find every spell with the ritual tag Throw this eval script onto an adjustment, add that adjustment to the hero. |
There were some minor updates to the script, but overall, you got me there. I can see the updated description in the app. Thank you Fenris.
The only catch? The XML export does not use that description, or I'm updating the wrong thing. |
Oh I was going for updating the name of the spell. What are you using for description? My first try for that would be the CustDesc field. But I have no idea if that goes into the printing.
|
You got me close enough that I figured it out anyway. :) Even though it was no joy on the final result.
In the end, the script was: Code:
doneif (tagis[Helper.Disable] <> 0) |
There may be some differences, since I am messing around in pathfinder, but it seems like the XML custom output just uses the original descript field.
It does seem to use the livename field for the name, and adding a spell descriptor tag (like the good or evil descriptors) using sDescript.Good is added to the xml output. If 5E doesn't have spell descriptors, maybe add a new school tag for Rituals, if that gets added to output. You can limit the changes to output only by checking for state.isoutput like this: Code:
if (state.isoutput <> 0) |
Quote:
Quote:
|
Quote:
Unfortunately, I get an error when I try to set the descript field: Only derived fields can generally be modified via scripts Which upon research *could* be able to be gotten around with a "trustme", but that still throws a compilation error, so maybe not. I've tried the trustme both in and out of the loop to set each spell's descriptor. Which leads all the way down to this script: Code:
doneif (field[pIsOn].value = 0) +1 for Fenris +1 for Ploturo |
sNameMod is used in the community pack a lot, so it's not the best idea. Though you could do
eachpick.field[sNameMod].text &= "*r*" That adds to any existing sNameMod, but might be overridden if sNameMod is changed later in the timing. As for the derived fields, descript isn't a modifiable one. But you had the right answer earlier; set CustDesc to descript + whatever you wanna add on. |
Quote:
Quote:
|
All times are GMT -8. The time now is 08:51 PM. |
Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.