Stat Block Reader

Discussion of initiative tool.

Moderators: dorpond, Azhrei

Pfhreak
Cave Troll
Posts: 60
Joined: Mon Feb 19, 2007 12:48 pm

Post by Pfhreak »

Version .1 of Pfhreak's stat block parsing code is up.

http://www.couch-martyr.com/statblock.php

It should handle any and all outputs from Jamis's stat blocks. It only handles his right now. It relies carefully on the punctuation to format itself, so don't mess around with the input too much. (eg., don't delete any semicolons, or you'll be in a world of hurt.)

I'll be working on allowing batch processing next. I just need to figure out a regular expression that can discern where one npc starts, and another ends.

If you break it with an unaltered stat block, send me a pm with your input, your output, and how it differed from what you expected.

Also, lemme know how I can make it more better for you.

(Also, Jay, if you are interested, this code uses python regular expressions, and explode() to do most of the work. I imagine it would be real simple to port to java. :wink: )


Edit: Whee! Working on little projects that work with RPtools makes me feel important! Riding on the shoulders of giants and all that. :D

User avatar
Steel Rat
Great Wyrm
Posts: 1765
Joined: Tue Jun 13, 2006 5:55 pm
Location: Oak Harbor, WA
Contact:

Post by Steel Rat »

Looks pretty good. But how do you get the resulting XML into InitTool and/or MapTool?
Steel Rat
-----------
RPGMapShare.com - RPG Maps and Mapping objects.
Discord Server

dorpond
RPTools Team
Posts: 5534
Joined: Thu Jun 01, 2006 2:05 pm
Location: Buffalo, NY

Post by dorpond »

I would like to know how also. This will be awesome once we can import these characters with ease! :)

Pfhreak
Cave Troll
Posts: 60
Joined: Mon Feb 19, 2007 12:48 pm

Post by Pfhreak »

Documents and Settings\*Current Username*\.inittool\defaultMonsters.rpdat

contains all the xml entries for monsters. You can do one of two things with this xml. You can:

1.) Add it to the defaultMonsters list, but know that when you upgrade init tool, the default file is rewritten (ie., you lose your changes.)

or

2.) Add it to a copy of the defaultMonsters.rpdat file, say ModdedMonsters.rpdat (or whatever you like) and then point init tools to use that one in stead. To do this, go to game settings, Miscellaneous tab, and point to your new file in the Combatant Lookup box. Click reload, and ok, and you are good to go!

User avatar
Steel Rat
Great Wyrm
Posts: 1765
Joined: Tue Jun 13, 2006 5:55 pm
Location: Oak Harbor, WA
Contact:

Post by Steel Rat »

I think we're in need of a dialog to add these within Inittool.
Steel Rat
-----------
RPGMapShare.com - RPG Maps and Mapping objects.
Discord Server

Pfhreak
Cave Troll
Posts: 60
Joined: Mon Feb 19, 2007 12:48 pm

Post by Pfhreak »

Also, Init Tool doesn't like to import the specialQualities attribute. Perhaps that has something to do with the "specialQualitities" typo on the stat card?

Is there any way to add information to the 'notes' section via xml?

Edit: One last thing, can we have some fields be multiple lines on the stat card, Full Attack, Special Abilities, Special Qualities, Skills, and Feats are the most likely to need more than one line.

User avatar
jay
RPTools Team
Posts: 1767
Joined: Tue Feb 07, 2006 1:07 am
Location: Austin, Tx

Post by jay »

Steel Rat wrote:I think we're in need of a dialog to add these within Inittool.
I plan on adding a database editor to IT in the next release. I'll make sure that there is a way to add new records using the stat block. I'll also add it to the add combatant and group tool windows.

dorpond
RPTools Team
Posts: 5534
Joined: Thu Jun 01, 2006 2:05 pm
Location: Buffalo, NY

Post by dorpond »

Hey Jay, can we also have a way to pick what list of combatants we are using? I really don't want to be messing with the default D20 list and I can see having several lists depending on what module I am using.

For example, let's say I made a module that I call The Fall of Icarus Valley. It would be nice to go to the Add Combatants and have a pull down that has all the campaign lists available to me. So in my case I would see your built in D20 list and my The Fall of Icarus Valley. When I pick my list, it will have all the combatants for my adventure; when I want to load some D20 creatures, I open that list and pick from there.

The reason I am bringing this up is also becasue I don't want to be adding new combatants to the default D20 list.

User avatar
jay
RPTools Team
Posts: 1767
Joined: Tue Feb 07, 2006 1:07 am
Location: Austin, Tx

Post by jay »

Pfhreak wrote:Also, Init Tool doesn't like to import the specialQualities attribute. Perhaps that has something to do with the "specialQualitities" typo on the stat card?
Oops, that's a bug. It will be fixed in the next release
Pfhreak wrote:Is there any way to add information to the 'notes' section via xml?
All of the internal fields can be set. For notes field the name to use is 'itNotes'. This post has the names used by all of the internal fields.
Pfhreak wrote:Edit: One last thing, can we have some fields be multiple lines on the stat card, Full Attack, Special Abilities, Special Qualities, Skills, and Feats are the most likely to need more than one line.
There isn't any generic way right now to tell what fields need to have multiple lines. All fields are just custom properties to the code, and while they might be used in D&D that way they aren't necessarily that way in any other game. In the next release I will set it up so that the index cards displayed can be defined by the user. That will allow for specific cards for specific games.

User avatar
Steel Rat
Great Wyrm
Posts: 1765
Joined: Tue Jun 13, 2006 5:55 pm
Location: Oak Harbor, WA
Contact:

Post by Steel Rat »

jay wrote:
Pfhreak wrote:Also, Init Tool doesn't like to import the specialQualities attribute. Perhaps that has something to do with the "specialQualitities" typo on the stat card?
Oops, that's a bug. It will be fixed in the next release
Lol! that was quite the Freudian slip. And how do we know Freud even wore a slip?
Steel Rat
-----------
RPGMapShare.com - RPG Maps and Mapping objects.
Discord Server

Michael Silverbane
Cave Troll
Posts: 44
Joined: Fri Feb 02, 2007 1:40 am
Location: Columbia, MO

Post by Michael Silverbane »

Steel Rat wrote:And WotC probably didn't post the structure of their format, so you'd have to guess based on examples.
Here is a link to the design and development article where they talk about the three different 'standard' stat blocks... i.e. the one found in the Monster Manual (and the SRD), the one found in most adventure modules, and the new one that started appearing in DMG2 (and in all subsequent WotC products).

Here is a 'stat block template' that James Jacobs posted on the Piazo forums some time ago...
James Jacobs, editor-in-chief of Dungeon, posted this on Paizo's message boards a while ago.

MONSTER NAME CR XXX
Gender race class level
AL Size type (subtype)
Source xxx
Init xxx; Senses Listen +xxx, Spot +xxx
Aura xxx
Languages xxx
----------------------
AC xxx, touch xxx, flat-footed xxx
hp xxx (xxx HD); regeneration/fast healing ; DR xxx
Immune xxx
Resist xxx; SR xxx
Fort +xxx, Ref +xxx, Will +xxx
Weakness xxx
Spd xxx ft.
Melee weapon +xxx (xxx)
Ranged weapon +xxx (xxx)
Space xxx; Reach xxx
Base Atk +xxx; Grp +xxx
----------------
Atk Options xxx
Special Atk xxx
Combat Gear xxx
Spells Prepared (CL th):
2nd—xxx, xxx
1st—xxx, xxx
Spell-Like Abilities (CL th):
1/day—xxx
--------------------
Abilities Str xxx, Dex xxx, Con xxx, Int xxx, Wis xxx, Cha xxx
SQ xxx
Feats xxx
Skills xxx
Possessions xxx


The general idea is the first "block" contains the stuff you need to know immediately about a monster/NPC when it first interacts with a PC. It contains stuff like Spot & Listen, languages spoken, auras it radiates, initiative, and so on.

The next block of text has all the basic combat stuff: AC, hit points, saves, etc. Feats that alter AC such as Dodge and Mobility get mentioned on that line.

The third block contains all the other combat stuff. If something has Power Attack, for example, it'll appear under the Combat Options line, because, well, it's an option during combat. Combat gear contains the items that might get used in combat, such as potions, wands, and scrolls.

The last section is all the other details you'll need. Note that feats and skills that appeared earlier in the stat block still get mentioned down here as well.
Here is a 'master template' developed, based on example stat blocks, by Altaran, Kvantum, and Jaerom Darkwind on the Wizard's Community discussion boards.
Originally Posted by Alratan
This master template is designed for use with cosmic entities, deities, and other epic characters. Due to its nature as a master template, it contains more elements than any one character will probably ever need. Extraneous sections should be removed (for example, many such creatures will not get much out of the full deity heading). See the monster stat block format for a pared down version.

By Alratan, with additional input from Kvantum and Jaerom Darkwind. For more information on the new stat block, read Design & Development: Stat Blocks.

Note that when creating a stat block for a creature, you should generally include feats and other abilities that greatly affect part of the stat block at the end of the relevant line.

Code: Select all

CHARACTER NAME
Titles
Divine Tier
Symbol description
Home Plane Home Plane
Alignment alignment
Aliases aliases
Superior divine or cosmic superior(s)
Allies divine and cosmic allies
Foes divine and cosmic enemies
Servants servitor deities/cosmic entities and notable mortal/immortal servants
Servitor Creatures creatures favored as servants
Manifestations favored manifestations
Signs of Favour common signs of favor
Worshippers common types of worshippers
Cleric Alignments (typically following one-step rule)
Speciality Priests name of divine prestige class
Holy Days (if known)
Portfolio list of portfolio elements
Domains Domains
Favored Weapon divine weapon (weapon type)

Appearance
Detailed description of entity, corresponding to the old italicised section.

History
Obvious.

Nature
Personality, motivation, goals, and so forth.

Organization
Information on cults, religions, minions, cohorts, and everything else of this nature. Name of section can be changed to be more specific.

Realm
Details on divine realm/cosmic realm/base of operations/etc. Name of section should be changed to be more specific.

Relations to other Powers
Divine and cosmic allies, enemies, and so forth.

CHARACTER NAME (CR #)
Level breakdown
AL Size Type (Subtypes)
Init +; Senses exotic senses; Listen +, Spot +
Aura auras; Languages languages
________________________________________ _____________________

AC , touch , flat-footed (breakdown)
hp (HD breakdown), fast heal , regeneration ( / ); DR
Immune immunities
Resist resistances; SR (formula)
Weakness weaknesses
Fort +, Ref +, Will +
________________________________________ _____________________

Speed ft. ( squares)
Melee
Melee + touch
Ranged
Ranged + touch
Space ft. [omit if 5 ft.]; Reach ft. [omit if 5 ft.]
Base Atk ; Grp
Atk Options
Special Actions
Combat Gear
________________________________________ _____________________

Essentia Pool ; Capacity ; Chakra Binds ; Soulmelds
Soulmelds and Essentia Investment (CL )
Feat #
Magic Item
Soulmeld (stats; bound to [chakra])
Invocations Known (CL th)
Least (at will)—
Lesser (at will)—
Major (at will)—
Dark (at will)—
Dire (at will)—
[Class] Spells Prepared/Known (CL th)
Epic (/day)—
9th (/day)—
8th (/day)—
7th (/day)—
6th (/day)—
5th (/day)—
4th (/day)—
3rd (/day)—
2nd (/day)—
1st (/day)—
0th (/day)—
Power Points/Day ; [Class] Powers Known (ML th)
Epic—
9th—
8th—
7th—
6th—
5th—
4th—
3rd—
2nd—
1st—
Spell-like Abilities (CL th)
At will—spell (DC )
3/day—spell (DC )
1/week—spell (DC )
________________________________________ _____________________

Cosmic Rank
Divine Rank
Abilities Str , Dex , Con , Int , Wis , Cha
SQ special qualities
Feats Feats
Epic Feats Epic Feats
Salient Abilities salient abilities from templates
Salient Cosmic Abilities or Template-Specific Name salient cosmic abilities
Salient Divine Abilities salient divine abilities
Skills Skill +x
Possessions combat gear, magic items, mundane items
Prayerbook
Spellbook
Epic Spells Known
Epic Powers Known
________________________________________ _____________________

Ability Title (): Ability description

Ability Title (): Ability description
________________________________________ _____________________

Strategy and Tactics
Specific information on running the creature in combat. Round-by-round tactics if desired.
The problem with the new stat block (as far as parsing it out goes) is that some stuff goes into multiple fields, depending on what it does. Plus, the format seems to still be in flux (or is simply used differently by different designers), so it changes around a bit.

In general, I prefer the original Monster Manual format, but tastes vary.

Later
silver
It's a big world out there. Go tear it up.

Pfhreak
Cave Troll
Posts: 60
Joined: Mon Feb 19, 2007 12:48 pm

Post by Pfhreak »

Michael Silverbane wrote:
Steel Rat wrote:And WotC probably didn't post the structure of their format, so you'd have to guess based on examples.
Here is a link to the design and development article where they talk about the three different 'standard' stat blocks... i.e. the one found in the Monster Manual (and the SRD), the one found in most adventure modules, and the new one that started appearing in DMG2 (and in all subsequent WotC products).

Here is a 'stat block template' that James Jacobs posted on the Piazo forums some time ago...

[SNIP]

The problem with the new stat block (as far as parsing it out goes) is that some stuff goes into multiple fields, depending on what it does. Plus, the format seems to still be in flux (or is simply used differently by different designers), so it changes around a bit.

In general, I prefer the original Monster Manual format, but tastes vary.

Later
silver
A very informative post, thanks! I'll look into processing these!

User avatar
Blakey
Dragon
Posts: 778
Joined: Fri Mar 23, 2007 11:27 am
Location: Sussex, UK.

Examples

Post by Blakey »

Here are some example NPCs from a module I'm looking at right now, exactly as they appear in the module.

<snip>

Cheers
Blakey
Last edited by Blakey on Sun May 20, 2007 3:55 am, edited 1 time in total.
The guy in the green hat.

Pfhreak
Cave Troll
Posts: 60
Joined: Mon Feb 19, 2007 12:48 pm

Post by Pfhreak »

I've almost got the "Adventure Stat Block" parsed. I've also made the code less flimsy.

Blakey, those stat blocks are not in a standard format, but they are only a few punctution marks away from being readable by my script. I'll let you know more about that once I get a finalized version .2

User avatar
Blakey
Dragon
Posts: 778
Joined: Fri Mar 23, 2007 11:27 am
Location: Sussex, UK.

Post by Blakey »

Pfhreak wrote:Blakey, those stat blocks are not in a standard format, but they are only a few punctution marks away from being readable by my script. I'll let you know more about that once I get a finalized version .2
Yeah, I know they're not standard but I think they are fairly standard for Necromancer Games who I buy virtually all my modules off. The ability to read that format stat block would save me hour upon hour in effort. You have no idea how grateful I'd be!

P.S. If you get this working, expect people to start sending you in lots of different stat block examples - that way you can make your code deal with loads of possibilities - which will make it super useful!

P.P.S Can you please copy those examples into a local file - I'd like to edit my post and get rid of them as I've realised they are copyright...
The guy in the green hat.

Post Reply

Return to “InitiativeTool”