Spell Reference D&D 3.5/Pathfinder SRD

These are tools and utilities that make it easier to run games. This includes Lib: macro tokens dropped into MapTool to manage the game, a conversion file for CharacterTool to allow use in MapTool, or just about anything else you can think of -- except graphics with macros and anything specific to a particular campaign framework. Those are already covered by the Tilesets subforum and the Links and External Resources forum.

Moderators: dorpond, trevor, Azhrei, giliath, Gamerdude, jay, Mr.Ice

Post Reply
User avatar
aliasmask
RPTools Team
Posts: 9024
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Spell Reference D&D 3.5/Pathfinder SRD

Post by aliasmask »

Plothos, try this code update for overflow problem:
searchSpellLink

Code: Select all

[H: numArgs_ = json.length(macro.args)]
[H: assert( numArgs_ >= 1, "<b>searchSpellLink(keyword)</b><br>",0)]
[H: keyword_ = json.get(macro.args,0)]
[H: keyword_ = lower(keyword_)]
[H: keyword_ = replace(keyword_,"[^a-z]","")]
[H: returnLink = json.get(glp("cachedSpellLinks"),keyword_)]
[H: returnLink = if(returnLink == "",json.get(macro.args,0),returnLink)]
[H: macro.return = returnLink] 
I can't duplicate the problem and I haven't had that problem in my game. I noticed you're not using makeKeywordSpellList() in View Spells Text. I posted some code that will allow you to also link to the reference library and with 1.2 just mouseover the link for a short description. Here's a code update for makeKeywordSpellList() in which I applied the same changes:
makeKeywordSpellList

Code: Select all

[H: numArgs_ = json.length(macro.args)]
[H: assert( numArgs_ >= 1, "<b>searchSpellLib(keywords)</b><br>",0)]
[H: keyword_ = json.get(macro.args,0)]
[H: keyword_ = lower(keyword_)]
[H: keyword_ = replace(keyword_,"[^a-z,]","")]
[H: spellLinks_ = glp("cachedSpellLinks")]
[H: listPos = 0]
[H: returnLink = ""]
[H, foreach(keyword_,keywords_), code: {
   [H: tempLink = json.get(spellLinks_,keyword_)]
   [H, if(tempLink == ""), code: {
      [returnLink = listAppend(returnLink,listGet(json.get(macro.args,0),listPos))]
   };{
      [returnLink = listAppend(returnLink,tempLink)]
   }]
   [H: listPos = listPos +1]
}]
[H: macro.return = returnLink] 

User avatar
aliasmask
RPTools Team
Posts: 9024
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Spell Reference D&D 3.5/Pathfinder SRD

Post by aliasmask »

I just applied the change to show Known Spells, here's a screen shot (less mouse pointer):
Example
Example.jpg
Example.jpg (52.88 KiB) Viewed 7682 times

User avatar
plothos
Great Wyrm
Posts: 1890
Joined: Sat Jun 21, 2008 1:07 am

Re: Spell Reference D&D 3.5/Pathfinder SRD

Post by plothos »

Coolness. I may not be able to test if this solves our problem until Friday, as I never actually saw the errors myself, but I will reconfigure things. I've already applied the old links to Known spells. I'll be uploading 2.0.4 of both managers within a day or two.
Drop-In Utilities:
My Spell Manager for D&D3.5 and PFRPG
My Inventory Manager for D&D and PFRPG, but more generally useable than that.
My Message Manager -- My Top-Down D&D Token Images
and my Custom Initiative & Status/Spell-Effect Tracker (work in progress, but functional).

Malekith
Giant
Posts: 245
Joined: Wed Jan 07, 2009 4:36 pm
Location: Gloucester, England
Contact:

Re: Spell Reference D&D 3.5/Pathfinder SRD

Post by Malekith »

Koolies. When you've updated everything then Plothos, just email me a copy of the bare-bones file and we shall have a look-see if we get any problems with my new campaign on friday! However I feel we may have to start drilling the other two on bug reporting just for future incase we break more things that only they see! :lol:

Mal
Mal

wrathgon
Dragon
Posts: 735
Joined: Wed Feb 06, 2008 10:28 am
Location: Guildford, UK

Re: Spell Reference D&D 3.5/Pathfinder SRD

Post by wrathgon »

Hey aliasmask i am using your code and not sure how to get it to do what i want

Code: Select all

[r,foreach(spell,learnlvl,""), CODE:{
        [h:spellinfo=replace(spell,"-[BSD]","")]    
        [h: spellNameLink = searchSpellLink(spellinfo)]    
        [r:makeKeywordSpellList(replace(spell,"-[BSD]",""))]
      [r: macroLink("Add <BR>","Learn Spell Wrap@Lib:Magic","none",passed+","+spell,token.name)]
    }]

 
I use makeKeywordSpellList to make a link to the info on the spell but i have to remove the letter at end i use to define specialist or banned or domain spells, how do i add it back in after i remove it?

User avatar
aliasmask
RPTools Team
Posts: 9024
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Spell Reference D&D 3.5/Pathfinder SRD

Post by aliasmask »

So, you want it to display the -D in the link? Because the original string isn't changed, but the output link is the book name format. So, if you pass it "bulls strength mass" it will return "Bull's Strength, Mass" as the link text but the original string is unchanged. In your example, that variable is "spell".

I suppose I could write a tweak where it will return the exact text in the request. But because the links are cached for speed, it would definitely slow the process down.

You can on your side do a string replace looking for text between ">.*?</a" and replace it with ">YOUR TEXT</a". Which I think would be faster than me building the alternate link from scratch.

The code you show doesn't make too much sense to me. You loop the spell names, transform the spell removing the the -BSD. You then make a link for that one spell. Then you output but retransform and make a new link ignoring the first part. makeKeywordSpellList and searchSpellLink are exactly the same except makeKeywordSpellList converts a list of spell names.

So, you could do:

Code: Select all

[h: spellList = replace(learnlvl,"-[BSD]","")]
[r: makeKeywordSpellList(spellList)] 
Clicking the spell names will show the reference library of the spell. Whether it's specialist, banned or domain doesn't change that part.

But you can also try it this way:

Code: Select all

[h: output = ""]
[h,foreach(spell,learnlvl,""), CODE:{
   [h: spellLink = searchSpellLink(replace(spell,"-[BSD]","")]
   [h: spellLink = replace(spellLink,">.*?</a",">"+spell+"</a")]
   [h: output = json.append(output,spellLink,"  ",
      macroLink("Add <BR>","Learn Spell Wrap@Lib:Magic","none",passed+","+spell,token.name))]
}]
[r: json.toList(output,"")] 

User avatar
aliasmask
RPTools Team
Posts: 9024
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Spell Reference D&D 3.5/Pathfinder SRD

Post by aliasmask »

Here's a simple macro to put in to your Campaign Macro window to do a search for a spell and post it's link for everyone to see.

Code: Select all

[h: spellName = Enter_Spell_Name]
[r: searchSpellLink(spellName)] 
The text has to be complete so you can't cut a word short or abbreviate, but you don't have to worry about case, spacing or punctuation.

DementedWolf
Kobold
Posts: 12
Joined: Thu Dec 17, 2009 3:11 am
Location: Redding, CA
Contact:

Re: Spell Reference D&D 3.5/Pathfinder SRD

Post by DementedWolf »

Ok... I need some help. I have used Maptool very little. I can make a map and input light sources, FOW, and stuff like that. I would love to have the Spell Reference... Thing is I have no clue how to implement it and have it work. I tried using the read-me but that didn't work... So could someone maybe meet me online on Yahoo Messenger and walk me through it step by step

User avatar
aliasmask
RPTools Team
Posts: 9024
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Spell Reference D&D 3.5/Pathfinder SRD

Post by aliasmask »

Info moved to 2nd post in thread.
Last edited by aliasmask on Fri Jun 11, 2010 9:02 pm, edited 1 time in total.

DementedWolf
Kobold
Posts: 12
Joined: Thu Dec 17, 2009 3:11 am
Location: Redding, CA
Contact:

Re: Spell Reference D&D 3.5/Pathfinder SRD

Post by DementedWolf »

aliasmask wrote:[*]Click the lib token and click the onCampaignLoad button to set up the functions.
[*]Drag the "Spell Library" button under the "Campaign Window Macros" group to your Campaign Window so others can use it and for easy access.[/list]
I did everything and I even clicked the "onCampaignLoad" button under macros when right-clicking the token and it lists a bunch of stuff in the chat window. I don't understand what you mean "Drag the 'spell library' button". Where is that?

User avatar
aliasmask
RPTools Team
Posts: 9024
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Spell Reference D&D 3.5/Pathfinder SRD

Post by aliasmask »

Just an update. I'm currently working on 2.0. I'm eliminating the need to set campaign properties, caching is always on, spells can be edited, you can add new spells, no need for config because PF and 3.5 spells will have different lib tokens, spells will be able to be imported/exported, no need for table files. Potentially, 4e spells can be easily added as well as any amount of data.. (feats,powers,items,monsters) it'll just be a matter of adding a new "list" and setting the fields. It may be prudent to have different display pages, but I'm reworking the display page to be more generic in how it displays the fields.

Generally anything in the format of {"var":simpleData,"displayFields":["var",...]} can be displayed. The var names will need to be formatted in how you would like to see it displayed. When I get to the output page, I may change it as needed to be generic, but the above is my first thought in how to limit what is displayed.

I expect it to be about a week before I release, so lets say June 11th.

User avatar
Azhrei
Site Admin
Posts: 12086
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: Spell Reference D&D 3.5/Pathfinder SRD

Post by Azhrei »

aliasmask wrote:I expect it to be about a week before I release, so lets say June 11th.
Heh. Dude, you have waaaaay too much time!! :mrgreen:

Thanks -- I look forward to seeing it!

User avatar
aliasmask
RPTools Team
Posts: 9024
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Spell Reference D&D 3.5/Pathfinder SRD

Post by aliasmask »

True, but I've been working on this for awhile too. I'm just bringing all the pieces together now. My hope is to finish before the 11th with a final version. Also, converting my tables over and working out the directory structure, traversing, add/remove/update are pretty much core concepts I'm use to dealing with. The use of pointers and hidden properties makes is so much easier to tweak. The data is really easy to access just by using it's path.

For example:
  • domain - returns list of domains {"air":"{json.evaluate(domain.air)}",...}
  • domain.air - returns list of air spells {"1":"{domain.air.1}","2":"{domain.air.2}",...}
  • domain.air.3 - return list of 3rd level air domain spells ["gaseousform"]
Output (display) properties will be stored in another structure with the same path system. Technically, the above would be in lib property h.table_spelllists.domain.air.3 and the actual spell data is in h.table_spelldata.gaseousform. I'm thinking the output properties, if different from default will be stored in h.table_pagetemplate.domain.air = {"templates":"templateName",...}

In the above, I want to display only 1 level at the domain level, but 2 levels at the domain.air so it shows the level and spell names. domain.air.3 will be just one level that shows the spell list of 3rd level spells. For arcane spells, I haven't decided if I want to show levels and spell lists because of the length... probably not. So, h.table_spelllists.class.wizardsorcerer = {"Level 1":"{h.table_spelllists.class.wizardsorcerer.level1}","Level 2":"{h.table_spelllists.class.wizardsorcerer.level2}",...}
where it displays only Level 1, Level 2, ... Going to the next level will show the spell list for that level. Hmm.. maybe I'll make the templateName a list where the default is the first list item, but the other templates are shown on the page output to switch the view. All the indexes leading to the final data page are cached when created now which make browsing very fast. Only when you add/edit/delete a spell does it use any processing time.

I'm going to stop rambling and get back to work.

User avatar
aliasmask
RPTools Team
Posts: 9024
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Spell Reference D&D 3.5/Pathfinder SRD

Post by aliasmask »

Okay, I was busier this week than I expected, but I will see about putting out 1.3 today or early tomorrow. Basically, it'll have all the core changes to the data, no tables, no properties just none of the interface stuff I planned for 2.0. I ended up redoing the code like 3 times until I got something that I liked and was generic enough to use for future apps. Technically, the hard part is over. I just have to add the features to update/delete/add spells. The macros are there, just not the interface.

If anyone is interested in doing the data for 4e spells, let me know. I'll give you the details on import formats to use and I can tweak it if need be. If nothing else, I can create a parser to build the object from raw data. Basically spells are in a json object and if you put in the field data, the indexing is all done automatically. I would just need to specify the classes and domains in a list. And the only reason I need to do that is because domains and classes are mixed together when specifying spell level.

User avatar
harchunk
Giant
Posts: 116
Joined: Sat Mar 22, 2008 7:12 pm

Re: Spell Reference D&D 3.5/Pathfinder SRD

Post by harchunk »

It seems that the 'download' link is not working could you please fix.

Post Reply

Return to “Drop-In Macro Resources”