Redcap's Corner
Well-known member
I'm trying to set up a magus archetype in Hero Lab. The archetype has the following ability:
"Spells: A transcendent wayfarer adds all spells of the teleportation subschool of 6th level or lower to his magus spell list at the lowest spell level available to any class. Any spell of the teleportation subschool already on the magus spell list he instead treats as one level lower than its magus level."
This is tricky, but I started basic. This seems to pull the majority of teleportation subschool spells onto the spell list:
POST-LEVELS/5000
Where it doesn't work?
1) It's pulling spells of all levels, even those above 6.
2) It's pulling the same spell onto the list multiple times at all of the different spell levels that spell is available, which I knew would happen, but I'm nevertheless in the market for a solution.
3) It seems to just be missing certain spells (teleport as a 4th level spell, vomit twin as a 4th level spell, word of recall as a 6th level spell, teleport structure, tree stride at any level, etc.).
Thoughts on solutions:
1) I'm guessing for problem 1 that either "fieldval" doesn't work in foreach statements (though I saw it recommended by a developer, which is why I tried it) or that it only likes equal signs, not "less thans". Either way, that's just trial and error and it seems like the smallest issue.
2) I decided to try setting up foreach statements for each spell level between 0 and 6, in ascending order, with each statement looking back at the spell list so far to see if a different "version" of the same spell is already on the spell list. This also helps me test the "equal sign theory" as a solution to problem #1. This is what I came up with:
POST-LEVELS/5000
But I'm getting this error message:
Syntax error in 'eval' script for Thing 'arMagTrWay' (Eval Script '#1') on line 13
-> Use of 'eachthing.' transition is only valid within a 'foreach' context that iterates over things
I can't tell why it doesn't like my "eachthing", since it IS within a "foreach thing" statement, and the exact same line of code worked in my original script up top.
3) Here, I'm stumped. The archetype is correctly pulling the tags for all the missing spells, some of them just aren't getting pushed to the magus.
As a side note, the only idea I had on how to take the magus teleportation spells and lower them by a spell level was:
POST-LEVELS/5000
Which didn't work at post-levels/5000, but I haven't investigated it much beyond that.
"Spells: A transcendent wayfarer adds all spells of the teleportation subschool of 6th level or lower to his magus spell list at the lowest spell level available to any class. Any spell of the teleportation subschool already on the magus spell list he instead treats as one level lower than its magus level."
This is tricky, but I started basic. This seems to pull the majority of teleportation subschool spells onto the spell list:
POST-LEVELS/5000
Code:
foreach thing in BaseSpell where "sSubschool.Teleport & fieldval:sLevel <= 6"
perform eachthing.pulltags[ClsAllowSp.?]
nexteach
perform linkage[varies].pushtags[ClsAllowSp.?]
Where it doesn't work?
1) It's pulling spells of all levels, even those above 6.
2) It's pulling the same spell onto the list multiple times at all of the different spell levels that spell is available, which I knew would happen, but I'm nevertheless in the market for a solution.
3) It seems to just be missing certain spells (teleport as a 4th level spell, vomit twin as a 4th level spell, word of recall as a 6th level spell, teleport structure, tree stride at any level, etc.).
Thoughts on solutions:
1) I'm guessing for problem 1 that either "fieldval" doesn't work in foreach statements (though I saw it recommended by a developer, which is why I tried it) or that it only likes equal signs, not "less thans". Either way, that's just trial and error and it seems like the smallest issue.
2) I decided to try setting up foreach statements for each spell level between 0 and 6, in ascending order, with each statement looking back at the spell list so far to see if a different "version" of the same spell is already on the spell list. This also helps me test the "equal sign theory" as a solution to problem #1. This is what I came up with:
POST-LEVELS/5000
Code:
var spellname as string
var dontadd as number
dontadd = 0
foreach thing in BaseSpell where "sSubschool.Teleport & fieldval:sLevel = 0"
spellname = eachthing.field[sSBSortNam].text
foreach pick in hero from BaseSpell
if (compare(eachpick.field[sSBSortNam].text, spellname) = 0) then
dontadd = 1
endif
nexteach
if (dontadd = 0) then
perform eachthing.pulltags[ClsAllowSp.?]
endif
dontadd = 0
nexteach
perform linkage[varies].pushtags[ClsAllowSp.?]
perform delete[ClsAllowSp.?]
foreach thing in BaseSpell where "sSubschool.Teleport & fieldval:sLevel = 1"
spellname = eachthing.field[sSBSortNam].text
foreach pick in hero from BaseSpell
if (compare(eachpick.field[sSBSortNam].text, spellname) = 0) then
dontadd = 1
endif
nexteach
if (dontadd = 0) then
perform eachthing.pulltags[ClsAllowSp.?]
endif
dontadd = 0
nexteach
perform linkage[varies].pushtags[ClsAllowSp.?]
perform delete[ClsAllowSp.?]
foreach thing in BaseSpell where "sSubschool.Teleport & fieldval:sLevel = 2"
spellname = eachthing.field[sSBSortNam].text
foreach pick in hero from BaseSpell
if (compare(eachpick.field[sSBSortNam].text, spellname) = 0) then
dontadd = 1
endif
nexteach
if (dontadd = 0) then
perform eachthing.pulltags[ClsAllowSp.?]
endif
dontadd = 0
nexteach
perform linkage[varies].pushtags[ClsAllowSp.?]
perform delete[ClsAllowSp.?]
foreach thing in BaseSpell where "sSubschool.Teleport & fieldval:sLevel = 3"
spellname = eachthing.field[sSBSortNam].text
foreach pick in hero from BaseSpell
if (compare(eachpick.field[sSBSortNam].text, spellname) = 0) then
dontadd = 1
endif
nexteach
if (dontadd = 0) then
perform eachthing.pulltags[ClsAllowSp.?]
endif
dontadd = 0
nexteach
perform linkage[varies].pushtags[ClsAllowSp.?]
perform delete[ClsAllowSp.?]
foreach thing in BaseSpell where "sSubschool.Teleport & fieldval:sLevel = 4"
spellname = eachthing.field[sSBSortNam].text
foreach pick in hero from BaseSpell
if (compare(eachpick.field[sSBSortNam].text, spellname) = 0) then
dontadd = 1
endif
nexteach
if (dontadd = 0) then
perform eachthing.pulltags[ClsAllowSp.?]
endif
dontadd = 0
nexteach
perform linkage[varies].pushtags[ClsAllowSp.?]
perform delete[ClsAllowSp.?]
foreach thing in BaseSpell where "sSubschool.Teleport & fieldval:sLevel = 5"
spellname = eachthing.field[sSBSortNam].text
foreach pick in hero from BaseSpell
if (compare(eachpick.field[sSBSortNam].text, spellname) = 0) then
dontadd = 1
endif
nexteach
if (dontadd = 0) then
perform eachthing.pulltags[ClsAllowSp.?]
endif
dontadd = 0
nexteach
perform linkage[varies].pushtags[ClsAllowSp.?]
perform delete[ClsAllowSp.?]
foreach thing in BaseSpell where "sSubschool.Teleport & fieldval:sLevel = 6"
spellname = eachthing.field[sSBSortNam].text
foreach pick in hero from BaseSpell
if (compare(eachpick.field[sSBSortNam].text, spellname) = 0) then
dontadd = 1
endif
nexteach
if (dontadd = 0) then
perform eachthing.pulltags[ClsAllowSp.?]
endif
dontadd = 0
nexteach
perform linkage[varies].pushtags[ClsAllowSp.?]
perform delete[ClsAllowSp.?]
But I'm getting this error message:
Syntax error in 'eval' script for Thing 'arMagTrWay' (Eval Script '#1') on line 13
-> Use of 'eachthing.' transition is only valid within a 'foreach' context that iterates over things
I can't tell why it doesn't like my "eachthing", since it IS within a "foreach thing" statement, and the exact same line of code worked in my original script up top.
3) Here, I'm stumped. The archetype is correctly pulling the tags for all the missing spells, some of them just aren't getting pushed to the magus.
As a side note, the only idea I had on how to take the magus teleportation spells and lower them by a spell level was:
POST-LEVELS/5000
Code:
foreach thing in BaseSpell where "sClass.Magus & sSubschool.Teleport"
eachthing.field[sLevel].value -= 1
nexteach
Which didn't work at post-levels/5000, but I haven't investigated it much beyond that.
Last edited: