TheLastScrub / delta-green-foundry-vtt-system-unofficial

A Foundry VTT game system for Delta Green: The RPG! This is a fan made work that is unaffiliated with Shane Ivey or Arc Dream Publishing, published under the Delta Green Community license. http://www.delta-green.com https://foundryvtt.com/
MIT License
25 stars 23 forks source link

new NPC stat block parser #113

Closed cristianmtr closed 1 day ago

cristianmtr commented 3 months ago

Would be nice to have some sort of statblock parser to easily import NPCs from adventures/books.

Example stat blocks:

STR 14 CON 12 DEX 10 INT 12 POW 13 CHA 12
HP 13 WP 13 SAN 47 BREAKING POINT 39
DISORDERS: Sleep disorder.
SKILLS: Alertness 50%, Bureaucracy 70%, Criminology 
45%, Drive 55%, Firearms 60%, First Aid 30%, 
HUMINT 40%, Melee Weapons 55%, Persuade 50%, 
Search 60%, Stealth 70%, Unarmed Combat 60%.
ATTACKS: Glock 26 pistol 60%, damage 1D10.
Unarmed 60%, damage 1D4−2.

The CoC7e module has something like that.

TheLastScrub commented 3 months ago

This actually already exists, it’s just still very much a work in progress so I haven’t made it obvious it’s there. It mostly just does some biography type stuff and skill proficiencies (not attacks, items etc.) right now.

But if you want to give it a try, you just have to call this from a script type macro:

game.deltagreen.ParseDeltaGreenStatBlock()

And then pick the actor type (NPC/Unnatural/Agent) and paste the raw text of your stat block in the dialog window that comes up.

Feel free to let me know if it does poorly against a certain stat block and I can take a look at it. I may was using it for Impossible Landscapes, copying right out of the module, so it’s geared to that a little bit and the formatting on DG stat blocks does drift a bit, so sometimes things don’t match the patterns it’s looking for.

Adding in attacks is on my todo list. It just might be tricky to capture it accurately with the rather freeform way that a DG stat block has them. Feel free to let me know if it does poorly against a certain stat block and I can take a look at it. I may was using it for Impossible Landscapes, copying right out of the module, so it’s geared to that a little bit and the formatting on DG stat blocks does drift a bit, so sometimes things don’t match the patterns it’s looking for.

Adding in attacks is on my todo list. It just might be tricky to capture it accurately with the rather freeform way that a DG stat block has them.

TheLastScrub commented 3 months ago

Note - I tried your stat block and realized my parser badly wants a name and sort of secondary line like all the stat blocks in Impossible Landscapes have. I will try to fix this, but if you want to try it as it is, you'll have better luck if you run a stat block like this in where the first two lines are the actor name and then the profession/type:

image

Which will give:

image

cristianmtr commented 3 months ago

Oh this is excellent already! Doesn't seem to catch Criminology from my statblock. However, if I remove the line breaks and make the statblock like so, it works:

STR 14 CON 12 DEX 10 INT 12 POW 13 CHA 12
HP 13 WP 13 SAN 47 BREAKING POINT 39
DISORDERS: Sleep disorder.
SKILLS: Alertness 50%, Bureaucracy 70%, Criminology 45%, Drive 55%, Firearms 60%, First Aid 30%, 
HUMINT 40%, Melee Weapons 55%, Persuade 50%, Search 60%, Stealth 70%, Unarmed Combat 60%.
ATTACKS: Glock 26 pistol 60%, damage 1D10.
Unarmed 60%, damage 1D4−2.

Attack and Disorders are not recognized. Not a big deal.

Maybe you could add all unrecognized lines as notes, so at least they're not lost?

TheLastScrub commented 3 months ago

Ahh yes my RegEx for the skills is assuming just a space in between, not a line feed. I don't think it's a big deal to allow a return in between the skill name and the % value though, so I will add that.

TheLastScrub commented 4 weeks ago

A small update to this, there should be a few fixes/improvements to the parser logic that go out with v1.4.5 (although this version is only for Foundry v12, it is not backwards compatible with v11).

Vincekettu commented 1 week ago

I am on foundry v12, in system 1.4.5 for DG and the parser does not work anymore It adds the name of the actor, and a secondary line, but keeps all stats at 10 and skills at their default value.

TheLastScrub commented 4 days ago

@Vincekettu ahh so it is... Looks like the obsoleting of ActorData.Data in favor of ActorData.system bit me there. The console warnings helped us fix that everywhere else, but since you'd only see those warnings when running the macro, we missed it for the stat parser. It is an easy fix though, the next release it should work again. Sorry about that.

TheLastScrub commented 1 day ago

One other thing I'll note, while I was fixing the issue with the data model, I took a stab at adding in the ability to parse out the amount of armor, and the attacks a stat block has. DG stat blocks are not that uniform, so it is pretty hit or miss. But might help speed things up...

Vincekettu commented 1 day ago

thank you thank you !!

Le mar. 16 juil. 2024 à 05:00, TheLastScrub @.***> a écrit :

One other thing I'll note, while I was fixing the issue with the data model, I took a stab at adding in the ability to parse out the amount of armor, and the attacks a stat block has. DG stat blocks are not that uniform, so it is pretty hit or miss. But might help speed things up...

— Reply to this email directly, view it on GitHub https://github.com/TheLastScrub/delta-green-foundry-vtt-system-unofficial/issues/113#issuecomment-2229908647, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASAARERHTBQWG3UD4AEGU6TZMSEFBAVCNFSM6AAAAABGHMD4Z2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMRZHEYDQNRUG4 . You are receiving this because you were mentioned.Message ID: <TheLastScrub/delta-green-foundry-vtt-system-unofficial/issues/113/2229908647 @github.com>