• 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

Secondary Class Starting Spellbook

Frodie

Well-known member
I am trying to give a Secondary Class a starting spellbook. I made the item fine, but I can't seem to tag it to a secondary class and the secondary class will not show up in the drop box.

Seems getting a started spellbook has gotten very challenging then the old days of just script it in. :-)

Anyways, I got no idea how to do it now. Any ideas at what maybe I can look at?
 
Last edited:
Thanks for looking at the file. Sorry it was a bit confusing, (still a work in progress).

Anyways, I finally got a spellbook to show up on the secondary class. But I could not get the free spells to show up in the spell book

I made a class special and added this script -

First 10000

call foctoclass

doneif (state.isfocus = 0)


~ We cast wizard spells
perform focus.assign[ClsCountAs.cHelpWiz]
perform focus.assign[CSCountAs.Wizard]
perform focus.assign[Classes.Wizard]
perform focus.assign[StartSpell.cHelpWiz]
perform focus.assign[sClass.cHelpWiz]
perform focus.assign[CasterSrc.Arcane]
perform focus.assign[CasterType.MemBook]
perform focus.assign[Hero.Spellbook]
perform focus.assign[StartBook.sbStartWiz]

I also tried with a copy of the Wizard Starter Spell book with the script from the prayer book, got the same thing.
 

Attachments

  • Untitled.jpg
    Untitled.jpg
    325.5 KB · Views: 1
perform focus.assign[StartBook.sbStartWiz]

is the issue I think. That is causing the wizard starting spellbook to be added, which has the Target.cHelpWiz tag. I think you need to create a new starting spellbook with a Target tag for this secondary class.
 
Yea that is the issue, but the new spellbook will not accept the tag of the secondary class.

I get this error

Invalid tag expression specified for 'findchild'
Location: Procedure 'SpBkFocus' near line 16
- - -
Invalid tag expression specified for 'foreach' statement
Location: 'evalrule' script for Component 'Spellbook' (Eval Rule '#2') near line 11
- - -
Invalid tag expression specified for 'findchild'
Location: Procedure 'SpBkFocus' near line 16

Is this something the "extend thing" could help with?
 
Last edited:
Correct, it will not accept the target tag for a secondary class. Well, the item will take the tag, but it will get the above error when you try to get it to work for the class. On the item, there is the drop box for classes to link to the spellbook, but I can't seem to get a secondary class to show. I made a new tag within the class drop box, but still a no go. Unless the target is a listed class within that dropbox of classes it will not work. So IDK how to get on the list.

ATM, I can get the new spellbook to show up and not in red, if it's made for a wizard, but I can't get the Starting Spells to show. It's in the script above at first 1000, so maybe it's a timing issue.
 
Last edited:
I guess send me the file again. And please avoid charging ahead and changing things until I can actually look at the problem and give feedback.
 
Alright. I think I see the issue here. You're assigning the Target tag to the wrong place in this script:

Code:
  <thing id="cFGMPAWzSp" name="Arcane Wizard Spells" compset="ClSpecial">
    <usesource source="FGMP3MdFn"/>
    <tag group="ProductId" tag="FantGallry"/>
    <tag group="StartSpell" tag="cHelpWiz"/>
    <eval phase="First" priority="10000"><![CDATA[
      call foctoclass

      doneif (state.isfocus = 0)

      ~ We cast wizard spells
perform focus.assign[ClsCountAs.cHelpWiz]
perform focus.assign[CSCountAs.Wizard]
perform focus.assign[Classes.Wizard]
perform focus.assign[StartSpell.cHelpWiz]
perform focus.assign[sClass.cHelpWiz]
perform focus.assign[CasterSrc.Arcane]
perform focus.assign[CasterType.MemBook]
perform focus.assign[Hero.Spellbook]
perform focus.assign[StartBook.gFGMPArStS]
perform focus.assign[HasBook.gFGMPArStS]
perform focus.assign[Helper.StartBook]
[B]perform focus.assign[Target.csFGMPPrSp][/B]
]]></eval>

Delete the bolded line, no need for it.

Instead change the following item from this:

Code:
  <thing id="gFGMPArStS" name="Arcane Starting Spellbook" description="A spellbook has 100 pages of parchment, and each spell takes up one page per spell level (one page each for 0-level spells). A newly purchased spellbook contains no spells. A wizard character begins play with a spellbook containing the spells he knows ({i}Core Rulebook{/i} 79)." compset="Spellbook" buytemplate="BuyQtyMon" xactspecial="2" stacking="never">
    <fieldval field="gWeight" value="3"/>
    <fieldval field="gCost" value="15"/>
    <usesource source="FGMP3MdFn"/>
    <tag group="Helper" tag="StartBook" name="Starter Spellbook" abbrev="Starter Spellbook"/>
    <tag group="gType" tag="BlankSpBk" name="Spellbooks" abbrev="SpBook"/>
    <tag group="ProductId" tag="FantGallry"/>
    <tag group="Target" tag="cHelpWiz"/>
    <eval phase="First" priority="500" index="2">perform assign[Helper.StartBook]
perform assign[StartSpell.cHelpWiz]</eval>

to this:

Code:
  <thing id="gFGMPArStS" name="Arcane Starting Spellbook" description="A spellbook has 100 pages of parchment, and each spell takes up one page per spell level (one page each for 0-level spells). A newly purchased spellbook contains no spells. A wizard character begins play with a spellbook containing the spells he knows ({i}Core Rulebook{/i} 79)." compset="Spellbook" buytemplate="BuyQtyMon" xactspecial="2" stacking="never">
    <fieldval field="gWeight" value="3"/>
    <fieldval field="gCost" value="15"/>
    <usesource source="FGMP3MdFn"/>
    <tag group="Helper" tag="StartBook" name="Starter Spellbook" abbrev="Starter Spellbook"/>
    <tag group="gType" tag="BlankSpBk" name="Spellbooks" abbrev="SpBook"/>
    <tag group="ProductId" tag="FantGallry"/>
    <tag group="Target" tag="[B]csFGMPPrSp[/B]"/>
    <eval phase="First" priority="500" index="2"><![CDATA[
      ~There is a validation error which complains if our tag does not match at
      ~least one Classes tag on the hero. Normally our target tag automatically
      ~pulls a classes tag, but it can't because we're targetting a secondary
      ~class. Since this option isn't tied to any specific class, we'll just
      ~pull any/all classes tags from the hero context to ourselves. They won't
      ~do any harm in this context, so it should be fine
      perform hero.pulltags[Classes.?]
      ]]></eval>

Note that the Target tag is set directly on the book when you define it. I deleted the redundant assigns in the eval script. On testing I got a validation error related to not having the proper class, which I added a line to address (see the notes).

There, according to my tests that should work.
 
Back
Top