• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Needs a programatic way to dynamically generate spell lists.

JadedDragoon

Active member
Basically, I'm trying to (as an archetype) implement a pathfinder version of the Paladin variant classes from the D&D3.5 Unearthed Arcana pg53 (Paladin of Freedom, Paladin of Tyranny, and Paladin of Destruction). Each has the same spell list as the core Paladin... except for about five swapped spells each. Making three new spell lists each for only a single class would be an extremely inefficient way to accomplish that.

Man, wouldn't this be a nice (if performance hungry) shortcut to programmatically generating a new spell list that is just a few spells different from an existing one?

!!!DOES NOT WORK!!!
Code:
foreach thing in BaseSpell where "sClass.cHelpPal"
    var comp as number
    comp = 0
    comp += compare(eachthing.idstring, "spProtfro1")
    comp += compare(eachthing.idstring, "spDiscLie3")
    comp += compare(eachthing.idstring, "spMagiCir3")
    comp += compare(eachthing.idstring, "spDeatWar4")
    comp += compare(eachthing.idstring, "spDispCha4")
    if (comp < 1) then
        perform eachthing.assign[sClass.cHelpPalFree]
        endif
    nexteach

perform <spProtLaw1_thing>.assign[sClass.cHelpPalFree]
perform <spMagiLaw3_thing>.assign[sClass.cHelpPalFree]
perform <spRemoCur3_thing>.assign[sClass.cHelpPalFree]
perform <spDispLaw4_thing>.assign[sClass.cHelpPalFree]
perform <spFreeMov4_thing>.assign[sClass.cHelpPalFree]
!!!DOES NOT WORK!!!

Of course, the thing context doesn't have an assign action. And spells only become picks on a hero after they have been selected... which would defeat the purpose.

Really this is exactly the kind of thing that I would expect *Extend to be able to do. It would be as simple as making extend things take a tag expression, component id, tag group, and tag id then implementing the above "foreach thing" logic with those values as input. If you could also refine the results with further with the tag expression (say to implement exceptions) it would be perfect. Then I would only need to add the 5 new spells manually to the spell list and the rest would auto-generate when the game system loads, which is pretty reasonable. As it stands I can't see much use for *Extend.

I can:
  • make a new spell thing for every spell I want to add to new spell lists.
    • Future changes to those spells in the Pathfinder base files will be ignored.
    • Requires to create one new thing for every spell changed
    • Doesn't require a bunch of flipping back and forth between tabs to find the needed thingids.
  • make a new extend thing for every spell I want to add to each spell list.
    • Future changes to those spells in the Pathfinder base files will be respected.
    • Requires to create three new things for every spell changed
    • Requires a lot of flipping back and forth between tabs to find the needed thingids.

There are how many spells out there? Yeaaah... there really has got to be a better way. But of the two, duplicating the spell things is a _lot_ less (but still far too much) work.

Are there any alternatives here?
 
Last edited:
Have you looked at the add spells to spell list adjustment?

It uses this eval script to add spells to a spell list for a class.

Code:
      ~ If we're not enabled, get out now
      doneif (field[pIsOn].value = 0)

      doneif (field[pChosen].ischosen = 0)

      perform field[pChosen].chosen.pulltags[ClsAllowSp.?]

      doneif (field[pChosen2].ischosen = 0)

      perform field[pChosen2].chosen.pushtags[ClsAllowSp.?]

This gives the class the ClsAllowSp.<insert spell id> tag which adds it to the list of class spells for that class.

Here is the opposite adjustment that I just made for myself.

Code:
      ~ If we're not enabled, get out now
      doneif (field[pIsOn].value = 0)

      doneif (field[pChosen].ischosen = 0)

      perform field[pChosen].chosen.pulltags[ClsDenySp.?]

      doneif (field[pChosen2].ischosen = 0)

      perform field[pChosen2].chosen.pushtags[ClsDenySp.?]

Likewise this adds the deny ClsDenySp.<insert spell id> tag to the class, which removes the spell from the spell list for that class.

In this case you just need to use
Code:
perform field[<insert paladin class helper ID>].chosen.pushtags[ClsAllowSp.<insert spell ID>]
perform field[<insert paladin class helper ID>].chosen.pushtags[ClsDenySp.<insert spell ID>]
for your code in the abilities.

Oh First 20000 index 1 for the timing of the eval scripts.
 
In the abilities? I think I'm missing something. I'm not sure where I'm supposed to put that script. There's no "cHelpPal" field on the archetype I'm creating. Nor is there one on a hero with the paladin class or the paladin class itself.

Please forgive my noobish-ness. I'm right in the middle of a trial-by-fire/crash-course teaching myself Hero Lab. My understanding of things is gonna be spotty in places.

EDIT: I have gone through every single core-class archetype that changes its base class' spell list trying to see how it's done there... only it's not done there. Not a single such archetype appears in the Pathfinder modules I have unlocked.
 
Last edited:
You'd put that into an eval script in an ability for the archetype, you'd use the paladin class helper as that's what the archetype is for, and thus the hero will have it on them when you apply the archetype.

Edit: "cHelpPal" would actually show in the hero tags.
 
Last edited:
hl-spellswap-script.png


Code:
Hero Lab was forced to stop compilation after the following errors were detected:

Syntax error in 'eval' script for Thing 'abELDKoDRSpells' (Eval Script 'Swap in Paladin of Freedom Spells') on line 2
  -> Non-existent field 'cHelpPal' used by script

hl-no-field.png


hl-no-field-2.png


Not to mention, the way the script is written it would be looking for a field on the ability (not the hero) as the context defaults to the pick the script runs from. So, again, I don't understand.
 
Yeah you really jumped into the deep end here. Those screen shots of the scripts are not compiling because the transitions is totally off. :(

I would recommend reading the Glossary of Terms for the Editor. Then check out Mathias four articles including the transition one.

Archetypes are designed already to modify the class they are linked to. So assuming this archetype has the linked class as Paladin. You don't even need a script to add new spells to the linked class.

Find your archetype in the editor. In the top RIGHT corner click on the "Tags" blue button. Then click on "Click to add another tag". In the new text boxes fill in the following:

Group id: ClsAllowSp
Tag ID: spBurnHan1

Then press "OK" and save your changes. Then Test Now!.

In this example your archetype will now add the Burning Hands level 1 spell to the Paladin class.

In addition I have added a example .user file to this post.

To try and help in your last screen shot. The correct script would be:
Code:
perform hero.childfound[cHelpPal].assign[ClsDenySp.spProtFro1]

If I was doing the above I would not hard-code the class id and instead go after the archetypes linked class.
Code:
perform linkage[varies].assign[ClsDenySp.spProtFro1]

linkage[varies] is a pointer that is setup to the linked class (in your case Paladin). This is setup when you set the "class to modify." option on the archetype.

Hop that helps some...
 

Attachments

"derp!" at just adding them as tags. That moment when you realize the reason you can't find the forest is cause you are only looking at the trees.

But yes, the other is some really useful info. The scripts you show are much more like what I was expecting... and the linkage bit looks like it will be super handy in the future. I appreciate it.

Jumping in at the deep end is pretty much snafu for me. And I'm okay with that. I'm actually having a blast. And I'm getting a lot done without having to ask for help. I just get... disoriented... every now and again.
 
Last edited:
Yeap. Works like a charm. So, apparently, you can add new spells via tags on the archetype... but to remove spells you need an eval script that adds a the deny tag to the linked class. Interesting.
 
Yeap. Works like a charm. So, apparently, you can add new spells via tags on the archetype... but to remove spells you need an eval script that adds a the deny tag to the linked class. Interesting.
Hmmm yeah... Looks like the pushing of the Deny tags was never added to the archetype component. Opps didn't know that. :(

Hopefully the perform linkage example came in handy then. :)
 
Back
Top