RPTools.net

Discussion and Support

Skip to content

It is currently Wed Sep 20, 2017 5:02 pm 




Forum rules


Discussion regarding lmarkus001's framework only. Other posts deleted without notice! :)



Reply to topic  [ 104 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7  Next

Previous topic | Next topic 

  Print view

Author Message
User avatar  Offline
Dragon
 
Joined: Sat Mar 22, 2008 6:12 pm
Posts: 292
 Post subject: Re: PF statblock importer
PostPosted: Thu Jul 15, 2010 10:29 pm 
Are you copying the stat blocks directly from the PFSRD?


Top
 Profile  
 
User avatar  Offline
Dragon
 
Joined: Sat Mar 22, 2008 6:12 pm
Posts: 292
 Post subject: Re: PF statblock importer
PostPosted: Thu Jul 15, 2010 10:38 pm 
harchunk wrote:
Are you copying the stat blocks directly from the PFSRD?


I will answer my own question...........yes
wow!!! pretty sweet I copied a gobo and it saved me about 20 mins of work.

YOU DA' MAN


Top
 Profile  
 
 Offline
Dragon
 
Joined: Sat Dec 22, 2007 5:37 pm
Posts: 357
 Post subject: Re: PF statblock importer
PostPosted: Sun Apr 24, 2011 3:44 pm 
I am using ver1.6 and it has been a HUGE timesaver. Thank you!!!!


Top
 Profile  
 
User avatar  Offline
Site Admin
 
Joined: Mon Jun 12, 2006 12:20 pm
Posts: 12102
Location: Tampa, FL
 Post subject: Re: PF statblock importer
PostPosted: Sun Apr 24, 2011 8:14 pm 
There's a 1.8 floating around; I think it's included in Neofax's "Pathfinder Framework" configuration.


Top
 Profile  
 
 Offline
Dragon
 
Joined: Sat Dec 22, 2007 5:37 pm
Posts: 357
 Post subject: Re: PF statblock importer
PostPosted: Sun Apr 24, 2011 8:24 pm 
Azhrei wrote:
There's a 1.8 floating around; I think it's included in Neofax's "Pathfinder Framework" configuration.


Thanks for the head's up!


Top
 Profile  
 
 Offline
Great Wyrm
 
Joined: Tue May 26, 2009 7:51 pm
Posts: 2060
Location: Philadelphia, PA
 Post subject: Re: PF statblock importer
PostPosted: Mon Jul 04, 2011 7:16 pm 
Can someone help me with a regular expression that will parse out multiple damage reductions and energy resistances in a statblock? Here is an example:

Code:
Defensive Abilities Bravery +0, Channel Resistance +4, Ferocity; DR 10/good, 5/slashing; Immune Undead Traits; Resist cold 15, fire 15; SR 16


What I need is a way to pull 10, good then 5, slashing and 15, cold and 15, fire.


Top
 Profile  
 
User avatar  Offline
Site Admin
 
Joined: Mon Jun 12, 2006 12:20 pm
Posts: 12102
Location: Tampa, FL
 Post subject: Re: PF statblock importer
PostPosted: Mon Jul 04, 2011 8:00 pm 
What does full resistance via DR look like? Would it be -/slashing, for example?

In these examples I'm using a double-backslash as I expect these are being put into one of the MT regex functions and they require the backslash be protected by another backslash.

Try this regex to extract the DR (the first four characters turn off case-sensitivity; you may or may not want that depending on your incoming data):

Code:
(?i)\\bDR (\\d+)/(\\S+)(,(\\d+)/(\\S+))*\\b

And this one to extract the resistances:

Code:
(?i)\\bResist (\\w+) (\\d+)(,(\\w+) (\\d+))*\\b

There are some assumptions made in the above based on the sample you posted, so if you find that they do not work for a given input just post the sample data and we can update the RE.

I haven't tested either of these, but I think they're pretty darn close. ;)


Top
 Profile  
 
 Offline
Great Wyrm
 
Joined: Tue May 26, 2009 7:51 pm
Posts: 2060
Location: Philadelphia, PA
 Post subject: Re: PF statblock importer
PostPosted: Mon Jul 04, 2011 8:15 pm 
Azhrei wrote:
What does full resistance via DR look like? Would it be -/slashing, for example?

In these examples I'm using a double-backslash as I expect these are being put into one of the MT regex functions and they require the backslash be protected by another backslash.

Try this regex to extract the DR (the first four characters turn off case-sensitivity; you may or may not want that depending on your incoming data):

Code:
(?i)\\bDR (\\d+)/(\\S+)(,(\\d+)/(\\S+))*\\b

And this one to extract the resistances:

Code:
(?i)\\bResist (\\w+) (\\d+)(,(\\w+) (\\d+))*\\b

There are some assumptions made in the above based on the sample you posted, so if you find that they do not work for a given input just post the sample data and we can update the RE.

I haven't tested either of these, but I think they're pretty darn close. ;)


Thanks Azhrei! They both work for grabbing 2 resistances or reductions, but if there are more say 5? Would I need to do a FOREACH? Also, yes the all normally is a -/damage reduction(however it could be an em-dash).


Top
 Profile  
 
User avatar  Offline
Site Admin
 
Joined: Mon Jun 12, 2006 12:20 pm
Posts: 12102
Location: Tampa, FL
 Post subject: Re: PF statblock importer
PostPosted: Tue Jul 05, 2011 4:26 pm 
neofax wrote:
Thanks Azhrei! They both work for grabbing 2 resistances or reductions, but if there are more say 5? Would I need to do a FOREACH? Also, yes the all normally is a -/damage reduction(however it could be an em-dash).

They will work with any number with a minimum of one. Yes, you will need a loop to process additional ones. The info for the regex functions on the wiki should give some information although IIRC they were pretty sparse. I think you need to loop through the "match groups" and then within each match group there will be a number and a string.


Top
 Profile  
 
User avatar  Offline
Demigod
 
Joined: Sun Feb 25, 2007 11:53 am
Posts: 3698
Location: MD
 Post subject: Re: PF statblock importer
PostPosted: Tue Sep 25, 2012 2:06 pm 
I'm using a modified version of this importer but I've run into a problem.

Pathfinder statblocks use a "–" for a "-" ... and I've run into a problem where MT doesn't see the two being the same. So, for example, if a monster has a "–1 init", when I try to roll initiative for them I get "12–1" instead of "11".

I tried doing a simple replace (– with -) in the statblock string but MT throws an error so I must have the syntax wrong.

So, assuming my statblock string is called statBlock, how would I make the above replacement?

_________________
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."


Last edited by Full Bleed on Tue Sep 25, 2012 10:41 pm, edited 1 time in total.

Top
 Profile  
 
 Offline
Great Wyrm
 
Joined: Tue May 26, 2009 7:51 pm
Posts: 2060
Location: Philadelphia, PA
 Post subject: Re: PF statblock importer
PostPosted: Tue Sep 25, 2012 2:50 pm 
I handle this by copying all of the stablocks to notepad++ in one text file and then strip them from all of the special characters.

_________________
Image
Time-Zone information UTC -5


Top
 Profile  
 
User avatar  Offline
Demigod
 
Joined: Sun Feb 25, 2007 11:53 am
Posts: 3698
Location: MD
 Post subject: Re: PF statblock importer
PostPosted: Tue Sep 25, 2012 10:43 pm 
neofax wrote:
I handle this by copying all of the stablocks to notepad++ in one text file and then strip them from all of the special characters.


I would like to avoid doing that. I'm hoping that there is a way to use replace() in MT...

_________________
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."


Top
 Profile  
 
User avatar  Offline
Demigod
 
Joined: Mon Jun 29, 2009 9:37 am
Posts: 3108
Location: Germany
 Post subject: Re: PF statblock importer
PostPosted: Wed Sep 26, 2012 10:51 am 
Full Bleed wrote:
I'm hoping that there is a way to use replace() in MT...

Maybe this will help you? I dont know a thing about the statblock importer, so I cant guide you on hacking it. But this is the way to replace weird characters.
Code:
<!--
encoded dash sign = %E2%80%93
minus sign doesnt get encoded
-->
[h: input("sampleString")]
ENCODED = [r: sampleString = encode(sampleString)]<br>
REPLACED = [r: sampleString = replace(sampleString, "%E2%80%93", "-")]<br>
DECODED = [r: decode(sampleString)]

Having the dash sign in the macro code leads to errors here, so I used an input() in this example. It worked fine with this test-string "A – B - 1" copy-pasted into the input.

_________________
HELP: GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC.

most complete list of my maptool stuff


Top
 Profile  
 
User avatar  Offline
Demigod
 
Joined: Sun Feb 25, 2007 11:53 am
Posts: 3698
Location: MD
 Post subject: Re: PF statblock importer
PostPosted: Wed Sep 26, 2012 9:43 pm 
CoveredInFish wrote:
But this is the way to replace weird characters.


Nice work.

As always... thanks! :)

_________________
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 7856
Location: Bay Area
 Post subject: Re: PF statblock importer
PostPosted: Wed Sep 26, 2012 10:36 pm 
I was thinking any non-ascii characters are not submitted correctly through the form submit. But, I think you can add something to the java line to enable unicode characters. Otherwise, all those special characters are just passed as squares, I think.

_________________
Downloads:


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 104 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7  Next

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:

Who is online

In total there are 2 users online :: 0 registered, 0 hidden and 2 guests (based on users active over the past 5 minutes)
Most users ever online was 243 on Sun Nov 04, 2012 6:14 am

Users browsing this forum: No registered users and 2 guests





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman