Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Pathfinder Roleplaying Game
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
Charender
Junior Member
 
Join Date: Aug 2011
Posts: 21

Old September 9th, 2011, 12:03 PM
I am trying to mage a class ability that calculates a spell pool for existing classes, then I am using a global mechanic that bootstraps the ability onto all classes. The problem is that I am getting an odd error.
Here is my code
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<document signature="Hero Lab Data">
  <thing id="cDivPool" name="Divine Casting Pool" description="This pool controls the amount of divine power you can use in a day." compset="ClSpecial" summary="You have a pool for casting divine spells.">
    <tag group="User" tag="Tracker" name="Tracker" abbrev="Tracker"/>
    <tag group="Usage" tag="Day"/>
    <eval phase="Final" priority="10000"><![CDATA[
      ~ If we're not shown, just get out now
      doneif (tagis[Helper.ShowSpec] = 0)

      var i as number
      i = 0
      foreach pick in hero where "CasterSrc.Divine"        
        debug "name "&eachpick.field[name].text
        debug "Caster Level "&eachpick.field[cCasterLev].value
        i += eachpick.field[cCastMax].arrayvalue[1] + eachpick.field[cMemMax].arrayvalue[1]
        i += 2 * (eachpick.field[cCastMax].arrayvalue[2] + eachpick.field[cMemMax].arrayvalue[2])
        i += 3 * (eachpick.field[cCastMax].arrayvalue[3] + eachpick.field[cMemMax].arrayvalue[3])
        i += 4 * (eachpick.field[cCastMax].arrayvalue[4] + eachpick.field[cMemMax].arrayvalue[4])
        i += 5 * (eachpick.field[cCastMax].arrayvalue[5] + eachpick.field[cMemMax].arrayvalue[5])
        i += 6 * (eachpick.field[cCastMax].arrayvalue[6] + eachpick.field[cMemMax].arrayvalue[6])
        i += 7 * (eachpick.field[cCastMax].arrayvalue[7] + eachpick.field[cMemMax].arrayvalue[7])
        i += 8 * (eachpick.field[cCastMax].arrayvalue[8] + eachpick.field[cMemMax].arrayvalue[8])
        i += 9 * (eachpick.field[cCastMax].arrayvalue[9] + eachpick.field[cMemMax].arrayvalue[9])
        debug "Divine Caster "&i 
        nexteach
        
      debug "Divine Caster Total "&i]]></eval>
    </thing>
  <thing id="mMagPool" name="Magic Pools" compset="Mechanics" uniqueness="useronce">
    <usesource source="srcShatt" parent="UserParent" name="Shattered Isles"/>
    <bootstrap thing="cDivPool"></bootstrap>
    </thing>
  </document>
I am getting an error "Attempt to access field 'cTotalLev' that does not exist for thing 'mMagPool' Location: 'field calculate' script for Field 'xTotalLev' near line 16

There are no scripts attached to mMagPool, so I am not sure why I am getting this error.
Charender is offline   #1 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,214

Old September 9th, 2011, 12:41 PM
Class specials MUST be bootstrapped from a class, an archetype, or a custom ability - they need one of those specific connections in order to know which class they belong to (and class specials must belong to a specific class). Bootstrapping them from a mechanic means they try to look up the class level of the mechanic, which does not exist.

Can you make this a Racial Special, or an Ability, rather than a Class Special? If you just need the value, and don't need to display anything to the user, can you put the script on the mechanic?

So that you don't have to delete it from one tab and re-create it on another tab, you can edit the XML and change

Code:
compset="ClSpecial"
to

Code:
compset="RaceSpec"
or
Code:
compset="Ability"
then re-open this file in the editor.

If each pool is specific to a single class, so that a Cleric/Inquisitor has two separate pools, I'd recommend making an archetype for each of the classes that you need to change - all the archetypes will be nearly identical - all just bootstrapping the same class special. You just need to duplicate the first one you create and change the class it modifies.


Another potential problem:

Code:
 
foreach pick in hero where "CasterSrc.Divine"
Classes are not the only things in the character that have the CasterSrc.Divine tag, so you need to restrict your search to only looking through classes:

Code:
 
foreach pick in hero from Class where "CasterSrc.Divine"
Mathias is online now   #2 Reply With Quote
Charender
Junior Member
 
Join Date: Aug 2011
Posts: 21

Old September 9th, 2011, 01:12 PM
I can make it an ability. I do want it to show up in the characters use/day ability list.
Charender is offline   #3 Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 02:55 PM.


Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.