• 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

Need Help with Memorized spells...

RavenX

Well-known member
I am having a bit of a hard time figuring out how to keep the field for currently memorized spells on the class tab... I've used this code, but for some reason the array increments upward for every class instead of the 1 class I am trying to get it to work for.

Code:
    <eval index="6" phase="Effects" priority="6000"><![CDATA[

          foreach pick in hero from Spell where "SpellLevel.01"
            field[clMemCur].arrayvalue[0] += eachpick.field[spPrepared].value 
            nexteach

      ]]></eval>
 
Take another look at the where portion of your foreach - that needs to also include a tag that's particular to the specific class that's running this script. Without that specificity, it's finding all the spells on the character.
 
Take another look at the where portion of your foreach - that needs to also include a tag that's particular to the specific class that's running this script. Without that specificity, it's finding all the spells on the character.

So the SpellSort tag for the class it's attached to? How can I access that to include it in the "the tags" part?
 
You've used this sort of thing before, I know:

Code:
foreach pick in hero from Spell where searchexpr

Think how you could build an expression in searchexpr that includes tags that are specific to this class.
 
Yeah I have, just not for a while. This is what I came up with and after testing it is working correctly. Thanks for helping me.

Code:
          var spellclass as string
          spellclass = tagids[SpellSort.?] 
          spellclass &= " & SpellLevel.01"
 
          foreach pick in hero from Spell where spellclass
            field[clMemCur].arrayvalue[0] += eachpick.field[spPrepared].value 
            nexteach
 
Back
Top