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
Vyzzini
Junior Member
 
Join Date: Jun 2013
Posts: 10

Old December 10th, 2014, 08:46 AM
Hi,

In the editor, is there a way to retrieve in a variable how many spells of a certain level a character has prepared?

Thanks,
Vyzzini
Vyzzini is offline   #1 Reply With Quote
Aaron
Senior Member
 
Join Date: Oct 2011
Posts: 6,793

Old December 10th, 2014, 09:29 AM
You could foreach through all spells of that level on the hero and add them up to find out. Careful though, you'll want to look at the final spell level FIELD, rather than the sLevel tag, because the tag doesn't include increases from applied MM and the like.
Aaron is offline   #2 Reply With Quote
Vyzzini
Junior Member
 
Join Date: Jun 2013
Posts: 10

Old December 10th, 2014, 10:32 AM
Hi Aaron
Thanks for your answer, could you please describe the syntax a little bit or guide me to a documentation?
Thanks,
Vyzzini
Vyzzini is offline   #3 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old December 10th, 2014, 10:48 AM
I think there's a better way to look up this information than searching for spells.

On the Develop menu, make sure you have "Enable Data File Debugging", and then add a level of a test class that can cast spells. Prepare a few spells for this class.

Then, on the Develop menu, go to "Floating Info Windows" at the bottom, and then choose "Show Selection Fields". Use the search option at the top to find the class you're testing with, and you'll see there are several options with that name - one of them will have the Id "cHelpXXX" where XXX is a three-letter abbreviation for that class, and the rest will have the Id "cXXXXXXXXXX", where the Xs are the first 9 letters of that class' name. Select the cHelp one for this class, and then click OK.

Now, that's a long list, but the information you're looking for is actually relatively close to the top. Scroll down through the list of field names until you find something that looks like that might be it. Then, you can click on the "click to view array" or "click to view matrix", and compare the numbers in there with the number of spells you've prepared for this class, to make sure you found the correct field.

Tell me what field you've found.

Also, I'll need more information about how you're using this. Are you working on a class special? Is it for a new class, or a new archetype? Or is this a feat? If it is a feat or something else that's not connected to a particular class, how is it choosing which class's spells to look up? Or do you want to know about all spells prepared for all of the character's spellcasting classes?
Mathias is offline   #4 Reply With Quote
Aaron
Senior Member
 
Join Date: Oct 2011
Posts: 6,793

Old December 10th, 2014, 10:52 AM
As usual, not tested, tweak as necessary.

Code:
~ Set up a variable to store the number of qualifying spells we find
var numfound as number

~foreach through all 2nd level spells on the hero which are not item spells or spell like abilities
foreach pick in hero from BaseSpell where "fieldval:sLevel = 2 & !Helper.ItemSpell & !Helper.SpellLike"
  numfound += 1
  nexteach

~ Then do whatever you need based on the number of spells found at that level
if (numfound >= 5) then
  DO WHATEVER
else
  DO WHATEVER ELSE
  endif
As Mathias says, some more information about why you want this information/what you intend to use it for could be helpful.

Last edited by Aaron; December 10th, 2014 at 10:55 AM.
Aaron is offline   #5 Reply With Quote
Vyzzini
Junior Member
 
Join Date: Jun 2013
Posts: 10

Old December 10th, 2014, 01:38 PM
Hi,

I'm implementing a spell-point system from a third party editor (Spellpoint Compilation from Housrule handbook).
I have created a "Spell pool item" calculating the number of spell points per day depending on the class and level in order to monitor those spell points as a tracked ressource.
The last thing I need in order to have the correct value is to remove 1 point of that "pool" for each prepared level 0 spell, the character has.

I'll try what Aaron has suggested.

Thank you again for your help,
Vyzzini
Vyzzini is offline   #6 Reply With Quote
Vyzzini
Junior Member
 
Join Date: Jun 2013
Posts: 10

Old December 10th, 2014, 02:18 PM
This seems to work:

var numfound as number
numfound=hero.child[cHelpMag].field[cMemCur].arrayvalue[0]

Thanks a lot for your help!
Vyzzini is offline   #7 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 01:06 AM.


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