91.08 Pathfinder + D&D3.5 Framework

Discussion concerning lmarkus' campaign framework for D&D3.x and Pathfinder.

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

Forum rules
Discussion regarding lmarkus001's framework only. Other posts deleted without notice! :)
Scottbert
Kobold
Posts: 12
Joined: Sun May 03, 2009 2:34 pm

Re: 91.08 Pathfinder + D&D3.5 Framework

Post by Scottbert »

Does anyone have a 3.5 statblock importer for this framework?

User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

Re: 91.08 Pathfinder + D&D3.5 Framework

Post by JamzTheMan »

I thought it had one built in already? I know there are a LOT of macros to sift through but there should be one.

I had one many moons ago but started customizing it for Pathfinder...
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork

User avatar
aliasmask
Deity
Posts: 8579
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: 91.08 Pathfinder + D&D3.5 Framework

Post by aliasmask »

Here's the one I use: viewtopic.php?f=53&t=24994&start=30#p260873

It's tuned to import from http://www.d20pfsrd.com/ but an importer is really dependent on the source. If this doesn't work out-the-gate I'm sure only a few tweaks would be needed for 3.5 specific statblocks. Again, the source is really important to know if it works.

Elorebaen
Dragon
Posts: 364
Joined: Sat Dec 22, 2007 5:37 pm

Re: 91.08 Pathfinder + D&D3.5 Framework

Post by Elorebaen »

aliasmask wrote:
Sat Sep 22, 2018 4:40 pm
Here's the one I use: viewtopic.php?f=53&t=24994&start=30#p260873

It's tuned to import from http://www.d20pfsrd.com/ but an importer is really dependent on the source. If this doesn't work out-the-gate I'm sure only a few tweaks would be needed for 3.5 specific statblocks. Again, the source is really important to know if it works.
Thanks for the update Alias!

manny2510
Kobold
Posts: 1
Joined: Mon Aug 04, 2014 1:38 am

Re: 91.08 Pathfinder + D&D3.5 Framework

Post by manny2510 »

I've installed Mote 1.16.11 and tried to open the framework file but found myself waiting for 4 minutes before closing the window. What should I do?

User avatar
aliasmask
Deity
Posts: 8579
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: 91.08 Pathfinder + D&D3.5 Framework

Post by aliasmask »

You can contact the MOTE people on their forum. Also, their latest release is 1.17.0 and was probably updating while you waited.

naka
Kobold
Posts: 2
Joined: Sun Jan 13, 2019 12:51 pm

Re: 91.08 Pathfinder + D&D3.5 Framework

Post by naka »

aliasmask wrote:
Sat Sep 22, 2018 4:40 pm
Here's the one I use: viewtopic.php?f=53&t=24994&start=30#p260873

It's tuned to import from http://www.d20pfsrd.com/ but an importer is really dependent on the source. If this doesn't work out-the-gate I'm sure only a few tweaks would be needed for 3.5 specific statblocks. Again, the source is really important to know if it works.
How would I begin to 'tweak' the code to make it work for statblocks located here or there. I literally know nothing about java, or any language really. Any tips would be real helpful.

User avatar
aliasmask
Deity
Posts: 8579
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: 91.08 Pathfinder + D&D3.5 Framework

Post by aliasmask »

"tweaking" was really directed at people familiar with the macro code language. This macro is definitely more complex than your usual code specifically because of the use of regex which confounds many programmers on its own. But I'll give you an outline on how it works.

First you get the copied data from the user. Usually it involves just highlighting specific parts of the website, copy and then paste in to the input field. Because its using the built-in input function it will not save any CRLF (end of line characters) so it's all mashed together in one big block of text.

The next part involves doing some text clean up. We like to keep all the text in the ascii range and convert special unicode characters to their ascii equivalent. I'm sure I lost you there. Basically, if there is an angled quote from a word document we want to change it to a regular quote. Same goes for dashes, periods, fractions and other symbols used that can be converted to a standardized ascii equivalent.

Once we have the statblock cleaned up and formatted we're going to look for specific things like the creature name and challenge rating. Most of the variable names in the macro code give you an indication of what it's trying to find. Then to the right is how it looks for it. Typically, you want to find a unique set of characters around what you're looking for and write your regex to pluck the needed string from the larger block of characters.

Below is an example of statblock imported without any cleanup and then encoded where characters are url encoded. ie, if you see %20 in a URL that means it's a space character. Other common ones are Tab (%09), Colon (%3A), Slash (%2F). For the MT encode, + is a space and plus is %2B.

Code: Select all

Kobold%2C+1st-Level+Warrior+Size%2FType%3A%09Small+Humanoid+%28Reptilian%29+Hit+Dice%3A%091d8+%284+hp%29+Initiative%3A%09%2B1+Speed%3A%0930+ft.+%286+squares%29+Armor+Class%3A%0915+%28%2B1+size%2C+%2B1+Dex%2C+%2B1+natural%2C+%2B2+leather%29%2C+touch+12%2C+flat-footed+14+Base+Attack%2FGrapple%3A%09%2B1%2F-4+Attack%3A%09Spear+%2B1+melee+%281d6-1%2F%C3%973%29+or+sling+%2B3+ranged+%281d3-1%29+Full+Attack%3A%09Spear+%2B1+melee+%281d6-1%2F%C3%973%29+or+sling+%2B3+ranged+%281d3-1%29+Space%2FReach%3A%095+ft.%2F5+ft.+Special+Attacks%3A%09%E2%80%94+Special+Qualities%3A%09Darkvision+60+ft.%2C+light+sensitivity+Saves%3A%09Fort+%2B2%2C+Ref+%2B1%2C+Will+-1+Abilities%3A%09Str+9%2C+Dex+13%2C+Con+10%2C+Int+10%2C+Wis+9%2C+Cha+8+Skills%3A%09Craft+%28trapmaking%29+%2B2%2C+Hide+%2B6%2C+Listen+%2B2%2C+Move+Silently+%2B2%2C+Profession+%28miner%29+%2B2%2C+Search+%2B2%2C+Spot+%2B2+Feats%3A%09Alertness+Environment%3A%09Temperate+forests+Organization%3A%09Gang+%284-9%29%2C+band+%2810-100+plus+100%25+noncombatants+plus+1+3rd-level+sergeant+per+20+adults+and+1+leader+of+4th-6th+level%29%2C+warband+%2810-24+plus+2-4+dire+weasels%29%2C+tribe+%2840-400+plus+1+3rd-level+sergeant+per+20+adults%2C+1+or+2+lieutenants+of+4th+or+5th+level%2C+1+leader+of+6th-8th+level%2C+and+5-8+dire+weasels%29+Challenge+Rating%3A%09%C2%BC+Treasure%3A%09Standard+Alignment%3A%09Usually+lawful+evil+Advancement%3A%09By+character+class+Level+Adjustment%3A%09%2B0
Compared to a normal cut/paste in to a text editor:

Code: Select all

Kobold, 1st-Level Warrior
Size/Type:	Small Humanoid (Reptilian)
Hit Dice:	1d8 (4 hp)
Initiative:	+1
Speed:	30 ft. (6 squares)
Armor Class:	15 (+1 size, +1 Dex, +1 natural, +2 leather), touch 12, flat-footed 14
Base Attack/Grapple:	+1/-4
Attack:	Spear +1 melee (1d6-1/×3) or sling +3 ranged (1d3-1)
Full Attack:	Spear +1 melee (1d6-1/×3) or sling +3 ranged (1d3-1)
Space/Reach:	5 ft./5 ft.
Special Attacks:	—
Special Qualities:	Darkvision 60 ft., light sensitivity
Saves:	Fort +2, Ref +1, Will -1
Abilities:	Str 9, Dex 13, Con 10, Int 10, Wis 9, Cha 8
Skills:	Craft (trapmaking) +2, Hide +6, Listen +2, Move Silently +2, Profession (miner) +2, Search +2, Spot +2
Feats:	Alertness
Environment:	Temperate forests
Organization:	Gang (4-9), band (10-100 plus 100% noncombatants plus 1 3rd-level sergeant per 20 adults and 1 leader of 4th-6th level), warband (10-24 plus 2-4 dire weasels), tribe (40-400 plus 1 3rd-level sergeant per 20 adults, 1 or 2 lieutenants of 4th or 5th level, 1 leader of 6th-8th level, and 5-8 dire weasels)
Challenge Rating:	¼
Treasure:	Standard
Alignment:	Usually lawful evil
Advancement:	By character class
Level Adjustment:	+0
So, if we assume the creature name is always the first thing in the statblock up until the comma (which may be incorrect) we can get the text this way. We should decode the statblock after we finish cleaning it up. It's just easier to work with once we clean it up.

Code: Select all

[H: name = getGroup(strfind("^(.*?),"),1,1)]
So, let's break up the above in to parts. The "^(.*?)," is the regex part and the guts of the search. It says, find the beginning of line (^) then save the following (everything in () is called a group). Within the group is ".*?" the . represents any character, the * says to repeat the previous to any number of characters and the ? says to not be greedy, ie once you can satisfy the search don't look anymore. These are the characters we will be saving in to the group. Then there is the , which ends the search matching. So, to summarize, find all the characters at the starting of statblock and stop when you reach a comma and this will be your name. Now, if the name has a comma in it, then this won't figure that out and we'll have to come up with another way of defining what the name is. getGroup() is just how you get the text from the strfind() function. You can read up on it in the wiki. Btw, this is a really simple use of regex and it can get pretty complicated based on what and how you're trying to find specific text. But generally speaking it's in this format: "stuff before ( what you want ) stuff after"

This is how the PF statblock importer works, but you can get data other ways where it could save your CRLF data which I think would make life easier if you were to write a parser based on the linked websites. One way is to use a textarea form submit (which has it's own eccentricities). Another would be to cut/paste it into a macro. I do that for large data processing or for testing, but not if you're going to just do one creature at a time.

naka
Kobold
Posts: 2
Joined: Sun Jan 13, 2019 12:51 pm

Re: 91.08 Pathfinder + D&D3.5 Framework

Post by naka »

Thank you for that extensive explanation.

>
The next part involves doing some text clean up.
If I am understanding correctly. This is how you handle the text cleanup, yes?

Code: Select all

[H: '<!-- Lets clean up those pesky non-ascii characters! -->']
[H: statblock = replace(statblock, "\\xD7", "x")]
[H: statblock = replace(statblock, "\\u2013", "-")]
[H: statblock = replace(statblock, "\\u2014", "-")]
[H: statblock = replace(statblock, "%E2%80%93", "-")]
[H: statblock = replace(statblock, "Ecolo gy", "Ecology")]
[H: statblock = replace(statblock, "  ", " ")]
[H: '<!-- change brackets and braces to parens to avoid stat sheet variable input error -->']
[H: statblock = replace(statblock, "[\\[\\{]","(")]
[H: statblock = replace(statblock, "[\\]\\}]",")")]
The next step would be?
>
Once we have the statblock cleaned up and formatted we're going to look for specific things like the creature name and challenge rating.

Code: Select all

[H: '<!-- Search for lines and sections of statblock individually -->']
[H: NameSearch = strfind(statblock, "(.*?)CR")]
[H: CRSearch = strfind(statblock, "(CR ?[0-9]+(/[0-9]+)?)")]
I am also unsure about how you get the data formatted on the token themselves from this point.
>

Code: Select all

Macro assumes pathfinder properties in the selected token.
Thank you for all the information you have provided again, I hope you can tell me if I am understanding anything/everything incorrectly.

User avatar
aliasmask
Deity
Posts: 8579
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: 91.08 Pathfinder + D&D3.5 Framework

Post by aliasmask »

For the most part, you are correct. After the clean up the original author did a bunch of searches to get the data, but the thing to know is that it is a 2 step process. You do the search and it returns an id to reference representing the search results. Then you use getGroup() to put the result in to a variable using the id. NameSearch and CRSearch should really be named nameId and CRid. Also, the original author didn't always use those ids further down. This could be because others, myself included, may have changed stuff and didn't remove irrelevant code which will make it a bit more complicated to understand. You can see that with NameSearch where it's not used again to get the actual name. The search code is written again further down to get the name and CR.

If you want to test some regex against some text I recommend this site: https://regexr.com/. You may run in to a \\ problem which is an escaped backslash. If a single \ doesn't work, try 2 and then 3. I personally avoid them ;) There are many ways to write code to get the same results.

Good Luck.

Elorebaen
Dragon
Posts: 364
Joined: Sat Dec 22, 2007 5:37 pm

Re: 91.08 Pathfinder + D&D3.5 Framework

Post by Elorebaen »

Just a quick note, that I am still getting a ton of use out of this awesome framework, and am eternally grateful to everyone that has worked on it :)

SDShannonS
Giant
Posts: 242
Joined: Tue Sep 12, 2006 12:21 am
Location: San Diego, CA, US

Re: 91.08 Pathfinder + D&D3.5 Framework

Post by SDShannonS »

Is there a way to add a property from the token to one of the bonus fields in the Skills input page?

Specifics: Character has a feature that doubles Int bonuses to all Knowledge skill checks. Knowledge skill checks already add Int bonus by default but I would like to do something like add in the Misc field "IntB" to reflect that the Int bonus should be added again. I have tried IntB, [IntB], "IntB", and eval("IntB") but each time it's treated like text instead of evaluating the property.

I don't want to just put a static value representing the character's current Int bonus because the character frequently uses a feature that raises Int so the actual number varies from encounter to encounter.
"You must be the change you wish to see in the world."
- Mahatma Gandhi

"You know what the chain of command is? It's the chain I go get and beat you with until you understand who's in ruttin' command here."
- Jayne

User avatar
aliasmask
Deity
Posts: 8579
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: 91.08 Pathfinder + D&D3.5 Framework

Post by aliasmask »

The skills input requires numbers. You could edit the skills input page to evaluate a field.. I would do misc.

On the lib token, find charSkillCheck macro. Find this section of code:

Code: Select all

[H: skN = json.get(tSkill, "name")]
[H: skR = json.get(tSkill, "rank")]
[H: skRM = json.get(tSkill, "racialmod")]
[H: skSyn = json.get(tSkill, "synergy")]
[H: skFeat = json.get(tSkill, "feats")]
[H: skEq = json.get(tSkill, "equip")]
[H: skMisc = eval(string(json.get(tSkill, "misc")))]
[H: skDesc = json.get(tSkill, "desc")]
And change the skMisc line to what I have above. You should be able to put IntB in misc column.

SDShannonS
Giant
Posts: 242
Joined: Tue Sep 12, 2006 12:21 am
Location: San Diego, CA, US

Re: 91.08 Pathfinder + D&D3.5 Framework

Post by SDShannonS »

Done and done!

That works perfectly! Thank you so much, AM.
"You must be the change you wish to see in the world."
- Mahatma Gandhi

"You know what the chain of command is? It's the chain I go get and beat you with until you understand who's in ruttin' command here."
- Jayne

User avatar
karpana
Kobold
Posts: 4
Joined: Sat Aug 04, 2018 1:38 pm

Re: 91.08 Pathfinder + D&D3.5 Framework

Post by karpana »

Hi There,
Long time user of maptools, but only in a basic "show a map on a television" sort of way.
Making my first foray into using a framework for my Pathfinder games.

I wanted to know whether the links on the first post of this thread are the current most up-to-date version of the Pathfinder framework?
http://forums.rptools.net/viewtopic.php ... 35a4930e29

I'd hate to starting out with a less than current version, especialliy with the recent release of 1.5.3

Thanks in advance.

Post Reply

Return to “[D&D3.5 + Pathfinder] Campaign Macros”