Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Pathfinder Roleplaying Game

Notices

Reply
 
Thread Tools Display Modes
Fnordboy
Junior Member
 
Join Date: Dec 2009
Posts: 23
Send a message via ICQ to Fnordboy

Old January 4th, 2010, 08:39 AM
Just wondering on how to work around this problem:

I have a specialist wizard who owns multiple looted spellbooks...because of the price for transcribing spells into my own spellbook, I've been stuck dragging the looted ones around with me. In-game, I'm left with the following:

*tracking which spells are in my spellbook (and how many pages are left in it)
*Tracking which spells I memorize from other spellbooks (Spellcraft check)

Is there any possibility of gaining the functionality of tracking this info in-game? It seems like it should be fairly easy to do...
Fnordboy is offline   #1 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,207

Old January 4th, 2010, 09:07 AM
It would be very hard to do. All spells a character knows are actually attached to the character in general, they are not stored inside a spellbook container. I will keep this in mind for the future, for when I have a lot of time to work on the Pathfinder files.

Last edited by Mathias; January 4th, 2010 at 09:10 AM.
Mathias is online now   #2 Reply With Quote
djc664
Senior Member
 
Join Date: Aug 2009
Posts: 125

Old January 4th, 2010, 06:12 PM
Would it be possible to have a simple number field that tells you how many pages a spell takes up from the memorized ones? I.e. tracking which book it's in and how many pages are left may be manual, but how many pages each take are automatically shown...?
djc664 is offline   #3 Reply With Quote
rob
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 8,232

Old January 4th, 2010, 06:58 PM
Quote:
Originally Posted by Fnordboy View Post
*tracking which spells are in my spellbook (and how many pages are left in it)
*Tracking which spells I memorize from other spellbooks (Spellcraft check)

Is there any possibility of gaining the functionality of tracking this info in-game? It seems like it should be fairly easy to do...
The issue is that the current architecture assumes a *single* spellbook for each character. Various optimizations are made based on that assumption, so changing to a design with multiple spellbooks would entail quite a lot of re-structuring. Unfortunately, the way your character is operating with the various spellbooks is a rare practice that we didn't anticipate in the initial design of the data files. If we had, then it would be easy, but alas we did not.
rob is offline   #4 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,207

Old January 5th, 2010, 09:19 AM
Quote:
Originally Posted by djc664 View Post
Would it be possible to have a simple number field that tells you how many pages a spell takes up from the memorized ones? I.e. tracking which book it's in and how many pages are left may be manual, but how many pages each take are automatically shown...?
This will be easy, and it's a great idea.

In fact, since I won't get to this for a little while, I'll show you how to do something like it:

Go to the develop menu, and make sure that "Enable Data File Debugging" is checked.

Create a new character, add a level or two of wizard, and go to the wizard tab. Go to the spellbook and add a few spells, then on any of the spells, right click, and select "Show Debug Tags for XXX". Move the window that pops up out of the way, close the spellbook, and then memorize the same spell you're looking at. Look at the memorized copy's debug tags, too.

What's actually happening behind the scenes is that each spell in your spellbook is added to the hero, and when you memorize spells, it gives you a list of all the spells you have in your spellbook. Actually memorizing the spell creates a new copy of that spell, but some of the tags are different, which tells the program that it's a Wizard memorized spell instead of a spell in the spellbook or a Cleric memorized spell (which would be important for a multiclass character).

Okay, looking at the tags for the two spells, you'll note that the level is stored as an sLevel tag, and the spellbook copy has "Spellbook.cHelpWiz" - which identifies it as a spell in the spellbook. Those are the tags we're going to use to find the number of pages currently used. Also note the component tags, and decide which seems to be most specific to the type of thing you're looking at. In this case, it's component.BaseSpell.

Now, on to the editor. Create a new editor file (file...new), then go to the gear tab within the editor, and press "New (Copy)", and select "Wizard's Spellbook (blank)" from that list. Give it a new unique ID (like "gSplBook", and change the name so it's distinct from the previous version (like "Spellbook, Wizard's (blank, counting)").

Press the "Eval Scripts" button near the top right, and "Click to add a new Eval Script". At the top, change the phase to "Render" (since we're only creating display information, we should run it very late in the sequence). Change the priority to 10000, because there's some other things happening very early in the Render phase that we don't want to interfere with.

Now, on to the script.

This is how to search through all the things of a type in HeroLab (or specifically, how to search through all the spells that are in a wizard's spellbook):

Code:
foreach pick in hero from BaseSpell where "Spellbook.cHelpWiz"
Now that we're finding all those spells, let's calculate how many pages each one takes:

Code:
 
pages += eachpick.tagvalue[sLevel.?]
For each pick we find, extract the numerical value of the sLevel tag on that pick, and add it to a total value.

Now to modify that for cantrips (since they take up one page):

Code:
 
pages += minimum(eachpick.tagvalue[sLevel.?], 1)
Add the minimum of that numerical value or 1 to our total.

Putting that together (this includes declaring a variable to store things in and closing the foreach):

Code:
 
var pages as number
 
foreach pick in hero from BaseSpell where "Spellbook.cHelpWiz"
  pages += minimum(eachpick.tagvalue[sLevel.?], 1)
  nexteach
So, when that ends, pages stores the total number of pages that would be required to store all the spells in your spellbook. Now let's do something with it, like change the name of the thing:

Code:
 
field[livename].text = "Spellbook, Wizard's (" & pages & " pages used)"
That will incorporate the value of the pages variable we've been accumulating into the name of the spellbook. If you want to change the name, be careful to keep quotes on both ends of any text and to use an & character between each separate thing (like a change from text to a variable, and then another & when the variable's been entered, and you want some more text).

Putting all that together for easy copying:

Code:
 
var pages as number
 
foreach pick in hero from BaseSpell where "Spellbook.cHelpWiz"
  pages += minimum(eachpick.tagvalue[sLevel.?], 1)
  nexteach
 
field[livename].text = "Spellbook, Wizard's (" & pages & " pages used)"
Admittedly, each spellbook you add to your inventory will show the same total, but it's good enough.

Now, save this item in the editor, press "Test Now!" at the top left, and then try buying this new spellbook version for your test character. Make sure it displays the number properly, and watch things change as you add or delete spells from your spellbook.
Mathias is online now   #5 Reply With Quote
Fnordboy
Junior Member
 
Join Date: Dec 2009
Posts: 23
Send a message via ICQ to Fnordboy

Old June 20th, 2010, 02:12 PM
Quote:
Originally Posted by rob View Post
The issue is that the current architecture assumes a *single* spellbook for each character. Various optimizations are made based on that assumption, so changing to a design with multiple spellbooks would entail quite a lot of re-structuring. Unfortunately, the way your character is operating with the various spellbooks is a rare practice that we didn't anticipate in the initial design of the data files. If we had, then it would be easy, but alas we did not.
Hmm. Would this be a good workaround?
1) Create a new instance of the spell in the Spellbook, which would clearly show that it wasn't from my own book (perhaps "borrowed" or something in the text)
2) Add the custom "borrowed" spell to the spellbook
3) Delete the original from the spellbook.
4) edit the "Borrowed" spell somehow so that I know to make a Spellcraft check in order to memorize it.

Can this work? How would one code it?
Fnordboy is offline   #6 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,207

Old June 21st, 2010, 08:33 AM
There's currently no way to designate spells as being from that other spellbook once added to the spellbook.
Mathias is online now   #7 Reply With Quote
Fnordboy
Junior Member
 
Join Date: Dec 2009
Posts: 23
Send a message via ICQ to Fnordboy

Old June 22nd, 2010, 02:02 AM
Quote:
Originally Posted by Mathias View Post
There's currently no way to designate spells as being from that other spellbook once added to the spellbook.

Mathias, I actually meant something else, if I understand you correctly. Lets use an example of the Fireball spell. My wizard, for some insane reason, has never learned the spell himself, but has recently claimed the spellbook of a horrid zombie-wizard, or, zombizard- if you will. Actually, let's say it's a Blizzard spell. From the Zombizard. Yeah.

In HL, I currently have the Zombizard's "Blizzard" spell added to my spellbook, but I have only a few recourses to notate that I must make a spellcraft check to memorize the spell, say, from the Background tab or what-have-you.

could I go into the HL editor, duplicate the "Blizzard" spell and create a new spell called "Zombizard's Blizzard," and add some custom expression or gizmo or widget (Blidget?) that would also tell me the Spellcraft DC necessary to memorize? Once this new-and-improved "Zombizard's Blizzard" spell has saved, add it to my original spellbook and then delete the original and oh-so-bland "Blizzard" spell?

Or am I just way too tired?



So in summation:

2 spells enter.
1 spell leaves.

Into the spellbook. MY spellbook. Not the Zombizard's. Which I can't add anyways. Not that I'd want to, since it's always covered with a sheen of hoarfrost that gets all my other parchments (or is the plural of parchment...parchment?) Erm, ok, PAPYRUS, wait- papyri?. @#$*&^*(

My SCROLLS! The horrible Zombizard's hoarfrosty spellbook makes all my other non-zombified, non-hypothermic, wizardly materials... drippy.
Fnordboy is offline   #8 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,207

Old June 22nd, 2010, 09:28 AM
Okay, that will work.

Timing: PostLevel/10000 (actually, any time after the First phase and before the Final phase will work)

Code:
 
var spelldc as number
 
~DC = 15 + spell level
spelldc = 15 + field[sLevel].value
 
field[livename].text = field[name].text & " (Prep DC " & spelldc & ")"
Mathias is online now   #9 Reply With Quote
Reply

Thread Tools
Display Modes

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 12:27 AM.


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