Paste 4e Monster from a pdf: get stats and a monster card

Show off your RPG maps, campaigns, and tokens. Share your gaming experiences and stories under General Discussion and save this forum for things you've created that may help others run their own games. Use the subforums when appropriate.

Moderators: dorpond, trevor, Azhrei, Gamerdude

Post Reply
User avatar
JamesManhattan
Cave Troll
Posts: 32
Joined: Tue Sep 29, 2009 5:28 pm
Location: New York
Contact:

Paste 4e Monster from a pdf: get stats and a monster card

Post by JamesManhattan »

Here's a token that contains 4 macros. You can paste directly from a pdf and the macros will parse the text, gather all the stats, make your token stats match those stats, then create a formatted monster card that has clickable macros to roll attacks and damage.
(I'm working on one for player characters, it should be easier to copy from a character sheet since it is formatted nicer)

Demo and token here:
http://rpgconnect.org/files/MonsterImporterDemo.wmv
http://rpgconnect.org/files/MonsterImporter.wmv
http://rpgconnect.org/files/RegExParser.rptok

Pic:Image

Thanlis
Giant
Posts: 240
Joined: Tue Mar 24, 2009 3:34 pm

Re: Paste Monster from a pdf: get stats and a monster card

Post by Thanlis »

Dude, that is remarkably awesome.

Does it work for Compendium copy and paste as well? It's awesome even if it doesn't. :)
Reed (halfling sorcerer P3) // Collin (human fighter P2) // Cine (eladrin psion H2)
Sirath (deva shaman H1) // Alesk (dragonborn cleric H3) // Kevin (halfling barbarian H1)

User avatar
JamesManhattan
Cave Troll
Posts: 32
Joined: Tue Sep 29, 2009 5:28 pm
Location: New York
Contact:

Re: Paste Monster from a pdf: get stats and a monster card

Post by JamesManhattan »

Yeah, it works with the online compendium text.

Thanlis
Giant
Posts: 240
Joined: Tue Mar 24, 2009 3:34 pm

Re: Paste Monster from a pdf: get stats and a monster card

Post by Thanlis »

JamesManhattan wrote:Yeah, it works with the online compendium text.


... if there's anything I can ever do for you, ask. I'm serious. Thank you.
Reed (halfling sorcerer P3) // Collin (human fighter P2) // Cine (eladrin psion H2)
Sirath (deva shaman H1) // Alesk (dragonborn cleric H3) // Kevin (halfling barbarian H1)

User avatar
Rumble
Deity
Posts: 6235
Joined: Tue Jul 01, 2008 7:48 pm

Re: Paste Monster from a pdf: get stats and a monster card

Post by Rumble »

James, that is really genius.

I'm wondering - do you have an interest in looking at how something like this might be done to fit an existing framework (obviously, I'm thinking of mine, but DeviantNull's and Veggie's might also be worth considering)?

I'm not sure how possible (or practical) it is to parse a monster sheet into the setup that I use (it might simply be too complex to parse a power out into the relevant pieces), but something like that would be incredibly cool (which is not to say this isn't already fantastic!). And, it would allow me to RULE THE WORLD!

Or, at least, not have to spend so much time typing monsters up.

User avatar
JamesManhattan
Cave Troll
Posts: 32
Joined: Tue Sep 29, 2009 5:28 pm
Location: New York
Contact:

Re: Paste Monster from a pdf: get stats and a monster card

Post by JamesManhattan »

Take a look at the macros, they are commented. On the EditMonster macro you'll see how easy it is to pull AC from a monster. You can use those variables or change them to match your framework.

For the card; I just parse the text using regular expressions and put html tags around certain parts. If I keep going and completely tag the hell out of the card. You should be able to pull bits and pieces of whatever you want from the finished product.

The hyperlinks just call another RollTheDice macro which is pretty simple right now. You could have the variables sent to your own attack macro or customize the RollTheDice macro to account for criticals etc.

Let's put FantasyGrounds out of business!!

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

Re: Paste 4e Monster from a pdf: get stats and a monster card

Post by Azhrei »

I changed this to a Sticky and modified the original subject line to indicate that it's for 4e.

If this is generic enough to put into any 4e framework then we can move it to the Drop-In Resources forum. Otherwise those frameworks should probably have a link back to this thread (maybe the OP for the framework should have that link?).

User avatar
Rumble
Deity
Posts: 6235
Joined: Tue Jul 01, 2008 7:48 pm

Re: Paste Monster from a pdf: get stats and a monster card

Post by Rumble »

JamesManhattan wrote:Take a look at the macros, they are commented. On the EditMonster macro you'll see how easy it is to pull AC from a monster. You can use those variables or change them to match your framework.

For the card; I just parse the text using regular expressions and put html tags around certain parts. If I keep going and completely tag the hell out of the card. You should be able to pull bits and pieces of whatever you want from the finished product.

The hyperlinks just call another RollTheDice macro which is pretty simple right now. You could have the variables sent to your own attack macro or customize the RollTheDice macro to account for criticals etc.

Let's put FantasyGrounds out of business!!





Boo. YAH.

You are a scholar and a gentleman.

User avatar
Rumble
Deity
Posts: 6235
Joined: Tue Jul 01, 2008 7:48 pm

Re: Paste 4e Monster from a pdf: get stats and a monster card

Post by Rumble »

As a quick note - does this expect a particular property set (and if so, did I just miss downloading it?) I get prompted for "StatCard" when trying the process, and it doesn't appear to work.

Edit: ah, it does require a property "StatCard" set up in campaign properties. For better drop-in capability (though this is superb), you could set the property invisibly so that even if it's not in the campaign, it's on the token. I would do it something like this - at the beginning of EditMonster, just change it to:

[h:setProperty("StatCard", json.get(macro.args,"TextBox"))]

The best drop-in approach I find is to "namespace" the variables, too - so "StatCard" becomes something like jmh.StatCard. That way, you are unlikely to run into property collisions with an existing campaign (for instance, if they already have a property StatCard - why they would, who knows - your macros won't wipe out their property).

Davenporttenn
Kobold
Posts: 8
Joined: Sat Jul 18, 2009 1:47 pm

Re: Paste 4e Monster from a pdf: get stats and a monster card

Post by Davenporttenn »

I am getting the Statcard error also. How did you fix it Rumble? I am using the Veggiesama framework.

Davenporttenn
Kobold
Posts: 8
Joined: Sat Jul 18, 2009 1:47 pm

Re: Paste 4e Monster from a pdf: get stats and a monster card

Post by Davenporttenn »

Rumble wrote:As a quick note - does this expect a particular property set (and if so, did I just miss downloading it?) I get prompted for "StatCard" when trying the process, and it doesn't appear to work.

Edit: ah, it does require a property "StatCard" set up in campaign properties. For better drop-in capability (though this is superb), you could set the property invisibly so that even if it's not in the campaign, it's on the token. I would do it something like this - at the beginning of EditMonster, just change it to:

[h:setProperty("StatCard", json.get(macro.args,"TextBox"))]

The best drop-in approach I find is to "namespace" the variables, too - so "StatCard" becomes something like jmh.StatCard. That way, you are unlikely to run into property collisions with an existing campaign (for instance, if they already have a property StatCard - why they would, who knows - your macros won't wipe out their property).


Where did you drop Statcard in the campaign props?

User avatar
Rumble
Deity
Posts: 6235
Joined: Tue Jul 01, 2008 7:48 pm

Re: Paste 4e Monster from a pdf: get stats and a monster card

Post by Rumble »

Davenporttenn wrote:
Rumble wrote:As a quick note - does this expect a particular property set (and if so, did I just miss downloading it?) I get prompted for "StatCard" when trying the process, and it doesn't appear to work.

Edit: ah, it does require a property "StatCard" set up in campaign properties. For better drop-in capability (though this is superb), you could set the property invisibly so that even if it's not in the campaign, it's on the token. I would do it something like this - at the beginning of EditMonster, just change it to:

[h:setProperty("StatCard", json.get(macro.args,"TextBox"))]

The best drop-in approach I find is to "namespace" the variables, too - so "StatCard" becomes something like jmh.StatCard. That way, you are unlikely to run into property collisions with an existing campaign (for instance, if they already have a property StatCard - why they would, who knows - your macros won't wipe out their property).


Where did you drop Statcard in the campaign props?


I just opened up the Campaign Properties, selected the "Basic" set, and added "StatCard" (without the quotes) to the end of the list. Then hit "Update", and you're good to go.

Davenporttenn
Kobold
Posts: 8
Joined: Sat Jul 18, 2009 1:47 pm

Re: Paste 4e Monster from a pdf: get stats and a monster card

Post by Davenporttenn »

Rumble wrote:
Davenporttenn wrote:
Rumble wrote:As a quick note - does this expect a particular property set (and if so, did I just miss downloading it?) I get prompted for "StatCard" when trying the process, and it doesn't appear to work.

Edit: ah, it does require a property "StatCard" set up in campaign properties. For better drop-in capability (though this is superb), you could set the property invisibly so that even if it's not in the campaign, it's on the token. I would do it something like this - at the beginning of EditMonster, just change it to:

[h:setProperty("StatCard", json.get(macro.args,"TextBox"))]

The best drop-in approach I find is to "namespace" the variables, too - so "StatCard" becomes something like jmh.StatCard. That way, you are unlikely to run into property collisions with an existing campaign (for instance, if they already have a property StatCard - why they would, who knows - your macros won't wipe out their property).


Where did you drop Statcard in the campaign props?


I just opened up the Campaign Properties, selected the "Basic" set, and added "StatCard" (without the quotes) to the end of the list. Then hit "Update", and you're good to go.


Cool, let me try that

Davenporttenn
Kobold
Posts: 8
Joined: Sat Jul 18, 2009 1:47 pm

Re: Paste 4e Monster from a pdf: get stats and a monster card

Post by Davenporttenn »

Hmm, I think I need someone smarter than me to tell me how to work this neat feature with the Veggiesama framework. It's pretty cool but I can't get it to work with Veggie. I think the properties are different.

User avatar
Rumble
Deity
Posts: 6235
Joined: Tue Jul 01, 2008 7:48 pm

Re: Paste 4e Monster from a pdf: get stats and a monster card

Post by Rumble »

Davenporttenn wrote:Hmm, I think I need someone smarter than me to tell me how to work this neat feature with the Veggiesama framework. It's pretty cool but I can't get it to work with Veggie. I think the properties are different.


Oh, yeah, it won't work with a framework unless it's reprogrammed to do so - the property sets all vary significantly. I was looking it over to work with my framework, but the amount of parsing required would be exceptional - I would have to not only pull out things like dice rolls, but also turn the various descriptions into power details, etc.

It could be made to work in another framework with some manipulation of property sets and so forth, but it's not necessarily straightforward.

Post Reply

Return to “User Creations”