PDA

View Full Version : CreatureGen Extension: Import Stat-blocks on the fly with populated spells



Ken L
September 24th, 2016, 08:59
This contribution has been removed by the author due to a disagreement with the change to the contributor license enacted by Smiteworks.
https://www.fantasygrounds.com/forums/showthread.php?47443-The-Fantasygrounds-Content-License-change-and-how-it-affects-contributors

damned
September 24th, 2016, 13:22
Boom! That looks awesome! Nice work Ken L.

Nylanfs
September 24th, 2016, 15:24
Very nice, you might want to make a note that Paizo has used several slightly different statblocks in their books. So copying from a PDF might cause issues.

I wonder how this works with PCGen statblock output.

Zacchaeus
September 24th, 2016, 15:36
Nice work again Ken. Well done.

darrenan
September 24th, 2016, 18:22
(For those unfamiliar with GitHub, just download the repository as a zip, extract the folder 'CreatureGen-master' , rename it 'CreatureGen', re-zip just that folder (not the outer), rename the .zip extension to a .ext, and put it in your extension folder)

Is there a reason you're making everyone jump through this hoop rather than just doing it once yourself and attaching the .ext to post #1 like everyone else does? Seems like an unnecessary barrier to entry.

Ken L
September 25th, 2016, 05:27
Is there a reason you're making everyone jump through this hoop rather than just doing it once yourself and attaching the .ext to post #1 like everyone else does? Seems like an unnecessary barrier to entry.

I'd rate it a step up from mindlessly downloading when there's a visible sign that anyone can actually contribute as opposed to railing on the baker to make better bread. This also saves me the dance of constantly updating the main post with a new file and deleting the old. The spell libraries are different as that's simply a database as opposed to a repository.

Ken L
September 25th, 2016, 05:29
Very nice, you might want to make a note that Paizo has used several slightly different statblocks in their books. So copying from a PDF might cause issues.

I wonder how this works with PCGen statblock output.

If it conforms to the PRD layout, it will work.

Trenloe
September 25th, 2016, 16:23
I'd rate it a step up from mindlessly downloading when there's a visible sign that anyone can actually contribute as opposed to railing on the baker to make better bread. This also saves me the dance of constantly updating the main post with a new file and deleting the old. The spell libraries are different as that's simply a database as opposed to a repository.
I suppose it all depends on your goal here. If your goal is to provide a valuable extension that all FG users can use quickly and easily, then I think you're missing the mark a bit here - in terms of end delivery/availability of the extension. Do you intend to post to this thread when there is a new version in GitHub? Or are we expected to occasionally go there, check for updates, download, rename, change .ZIP to .EXT?

Don't get me wrong, I think you've created an amazing tool here. But why go 95% of the way and not do the last 5% that makes it easy for all FG users (those technical *and* non-technical) to download and keep up-to-date?

We're not asking the baker to bake better bread - we're just asking the baker to put the most recently baked bread (fit for general public consumption) in a nice package in the shop window, rather than everyone having to find it in a storage closet in the back somewhere. :)

Ken L
September 25th, 2016, 17:36
It's good enough, and not really a huge leap.

Self service salad bar vs getting it in a package. If that's the reason it's overlooked then I don't really care; I do this for fun, not recognition.

Trenloe
September 25th, 2016, 18:02
Fair enough.

Sasmira
September 29th, 2016, 11:38
Hello,

It's a very good extension and free !!! but ... it's only if you have a PDF in english and don't work in another language :(


S.

damned
September 29th, 2016, 12:39
Actually Sasmira - Ken L has made it available on Git Hub you can see all the code and you can reinterpret for any language.

Ken L
September 29th, 2016, 16:00
Hello,

It's a very good extension and free !!! but ... it's only if you have a PDF in english and don't work in another language :(


S.

The source pathfinder material is in English, I'm not entirely sure if paizo ever exported their modules in other languages. I know of BR and SP players that also use the English PDFs they bought from paizo.com (as intl. shipping is expensive) and use it, but run their games in their respective languages.

If you're working off a homebrew PDF written in french by someone else, or a 3pp PDF in french, then I really don't have a solution save for stripping all the accents out as currently the parser doesn't strip/replace international characters.

You could edit the stripString
https://github.com/FGKenL/CreatureGen/blob/master/cgen/lua/CreatureGen.lua#L1992

and add all the international unicode codes, the triples and doubles was a way for me to resolve the particular fantasy grounds encoding schema.

There's also the matter of specific strings I search for so there's still a bit of digging to figure out what exactly is different in the french stat block. I would like to believe that they're mainly the same however, just edit it to appear as an English statblock and you should be set unless you wish to make these changes.

Sasmira
September 29th, 2016, 16:28
nice !

When I create a campaign, I use the english statblock, because I use Hero Lab and Advanced Bestiary ! but i'm not the only one french to use FG and the aventure paths are translate in french ...

All that for say, thank you for your job and your help, I'm going to check if I can help too :D

In attachment, an example of English and French statblock

Sasmira
September 30th, 2016, 15:51
Good news, your extension work with Hero Labs statblock ! Just delete the lines before the monster name !!!

An example generated with Hero Labs Builder, if you want to try



This tremendous leviathan resembles a vast squid, yet the markings on its body are strangely unsettling to look upon.
--------------------
Kraken CR 18
XP 153,600
Male kraken (Pathfinder RPG Bestiary 184)
NE Gargantuan magical beast (aquatic)
Init +4; Senses darkvision 120 ft., low-light vision; Perception +28
--------------------
Defense
--------------------
AC 32, touch 6, flat-footed 32 (+26 natural, -4 size)
hp 290 (20d10+180)
Fort +21, Ref +12, Will +11
Defensive Abilities ink cloud; Immune cold, mind-affecting effects, poison
--------------------
Offense
--------------------
Speed 10 ft., swim 40 ft.; jet 280 ft.
Melee 2 arms +26 (2d6+10/19-20 plus grab), bite +26 (2d8+10), 8 tentacles +24 (1d8+5 plus grab)
Space 20 ft.; Reach 20 ft.
Special Attacks constrict (1d8+10), poison, rend ship, tenacious grapple
Spell-Like Abilities (CL 15th; concentration +20)
1/day—control weather, control winds (DC 20), ominate monster dominate monster (dc 24, animal only) (DC 24), resist energy
--------------------
Statistics
--------------------
Str 30, Dex 10, Con 29, Int 21, Wis 20, Cha 21
Base Atk +20; CMB +34 (+38 grapple, +36 trip); CMD 44 (can't be tripped)
Feats Bleeding Critical, Blind-fight, Cleave, Combat Expertise, Critical Focus, Improved Critical (arm), Improved Initiative, Improved Trip, Multiattack, Power Attack
Skills Acrobatics +0 (-8 to jump), Intimidate +25, Knowledge (geography) +25, Knowledge (nature) +25, Perception +28, Stealth +11, Swim +41, Use Magic Device +25
Languages Aquan, Common
--------------------
Ecology
--------------------
Environment any ocean
Organization solitary
Treasure triple
--------------------
Special Abilities
--------------------
Bleeding Critical Critical Hits deal 2d6 bleed damage.
Blind-Fight Re-roll misses because of concealment, other benefits.
Cleave If you hit a foe, attack an adjacent target at the same attack bonus but take -2 AC.
Combat Expertise +/-6 Bonus to AC in exchange for an equal penalty to attack.
Critical Focus +4 to confirm critical hits.
Darkvision (120 feet) You can see in the dark (black and white only).
Grab: Arm (Gargantuan) (Ex) You can start a grapple as a free action if you hit with the designated weapon.
Grab: Tentacle (Gargantuan) (Ex) You can start a grapple as a free action if you hit with the designated weapon.
Immunity to Cold You are immune to cold damage.
Immunity to Mind-Affecting effects You are immune to Mind-Affecting effects.
Immunity to Poison You are immune to poison.
Improved Trip You don't provoke attacks of opportunity when tripping.
Ink Cloud (20' radius, 1/minute) (Ex) Emit an ink cloud, which provides total concealment.
Jet (280 ft.) Move in a straight line at 280, with no attacks of opportunity.
Low-Light Vision See twice as far as a human in dim light, distinguishing color and detail.
Poison: Ink cloud - contact (+nausea, DC 29) (Ex) Poison—Injury; save Fort DC 29; freq 1/rd for 10 rds; effect 1 Str; cure 2 cons saves.
Power Attack -6/+12 You can subtract from your attack roll to add to your damage.
Rend Ship (Ex) As a full-round action, a kraken can attempt to use four of its tentacles to grapple a ship of its size or smaller. It makes a CMB check opposed by the ship's captain's Profession (sailor) check, but the kraken gets a cumulative +4 bonus on the check
Swim (40 feet) You have a Swim speed.
Tenacious Grapple (Ex) A kraken does not gain the grappled condition if it grapples a foe with its arms or tentacles.

Hero Lab and the Hero Lab logo are Registered Trademarks of LWD Technology, Inc. Free download at https://www.wolflair.com
Pathfinder® and associated marks and logos are trademarks of Paizo Inc.®, and are used under license.

jboyd4650
October 1st, 2016, 14:22
Great extension, but, i am trying to use it, and i have problems with the weapon attack blocks.
when I generate I get these (from the logs)
[1] parseAttacks (melee)dagger –1 (1d3 –1/19–20) or pitchfork–1 (1d6–1)
[looks good]
but then,
[3] dropIter (dropping iteratives) : dagger 150 (1d3 150/19–20)
[3] dropIter (dropping iteratives) : pitchfork150 (1d6150)
and this is what it ends with on the npc sheet

anyone know what i need to do to fix this?

Thanks,
jboyd

Ken L
October 1st, 2016, 20:38
Great extension, but, i am trying to use it, and i have problems with the weapon attack blocks.
when I generate I get these (from the logs)
[1] parseAttacks (melee)dagger –1 (1d3 –1/19–20) or pitchfork–1 (1d6–1)
[looks good]
but then,
[3] dropIter (dropping iteratives) : dagger 150 (1d3 150/19–20)
[3] dropIter (dropping iteratives) : pitchfork150 (1d6150)
and this is what it ends with on the npc sheet

anyone know what i need to do to fix this?

Thanks,
jboyd

That looks like a bug in dropIter which you found. Can you post the complete stat block in a code block so I can look at it. That way it'll preserve any strange unicode I might have missed if it's related to that.

jboyd4650
October 2nd, 2016, 10:00
Sorry this is late, i had RL intrude on my day off :)
Hope this is what you wanted, it seems there is a problem with the negative numbers, and dashes.


Yargin Balko CR 1
Male human expert 2
LE Medium humanoid
Init +1; Senses Listen –1, Spot –1
DEFENSE
AC 13, touch 11, flat-footed 12
(+2 armor, +1 Dexterity)
hp 9 (2d6+2)
Fort +1, Ref +1, Will +2
OFFENSE
Spd 30 ft.
Melee dagger +1 (1d4/19–20)
Ranged acid splash +2 touch (1d3 acid) or
alchemical item +2 touch (varies)
TACTICS
During Combat Yargin prefers to use his wand of
acid splash in combat, but since he needs to roll
a 13 to activate it with a Use Magic Device check,
it’s prone to failing him—each time it does, he
erupts into a loud burst of profanity, shaking the
wand in frustration. Once he fails the third time
to use the wand, he gives up and switches
to thrown vials of acid and tanglefoot
bags. He’s deathly afraid of melee
combat, and fights with his dagger
only if cornered.
Morale Once he’s used up his alchemical
items and his wand has failed him three
times (or as soon as he takes any melee damage at
all) Yargin shrieks in panic and attempts to flee to Gaedren’s side
to warn him. That he might inadvertently lead Gaedren’s enemies
right to him doesn’t cross his mind in his panicked state.
STATISTICS
Str 10, Dex 12, Con 13, Int 11, Wis 9, Cha 8
Base Atk +1; Grp +1
Feats Point Blank Shot, Skill Focus (Use Magic Device)
Skills Appraise +5, Craft (alchemy) +5, Disable Device +5, Forgery
+5, Knowledge (arcana) +5, Search +5, Spellcraft +7, Use Magic
Device +7
Languages Common, Gnome
Combat Gear wand of acid splash (28 charges), acid (3), tanglefoot
bag (2), thunderstone; Other Gear leather armor, dagger, light
crossbow with 10 bolts, garnet amulet worth 100 gp, key to
cabinet in area A7


Thanks,
James

Ken L
October 2nd, 2016, 13:17
The attack lines look different, is it the same stat block? Negative numbers work fine from what I've tested, so I suspect it's some unicode character that appears as a 'minus' sign.

Sasmira
October 2nd, 2016, 13:57
I see in english PDF that they use two differents negative marks like "-" or "–"

jboyd4650
October 2nd, 2016, 13:58
you are correct. They appear to be a dash of some sort, longer than the minus sign. If i change them before i generate, it comes out fine.

Sasmira
October 2nd, 2016, 14:09
sorry if my english sucks :(

jboyd4650
October 2nd, 2016, 15:06
You are fine. I posted just after you, and hadn't seen your post...but, we both saw the same thing. :)

kalmarjan
October 2nd, 2016, 17:24
This looks like an awesome extension... I can't wait to check it out.

Ken L
October 2nd, 2016, 23:45
@jboyd4650

The attack line in the statblock you posted earlier is positive and uses a d4 rather than a d3, did the attack line come from the same stat block? I just want to see the statblock that caused this so I can fish out the unicode right quick.

jboyd4650
October 3rd, 2016, 04:15
here is the stat block as copied from my source (pdf)


Yargin Balko CR 1
Male human expert 2
LE Medium humanoid
Init +1; Senses Listen –1, Spot –1
DEFENSE
AC 13, touch 11, flat-footed 12
(+2 armor, +1 Dexterity)
hp 9 (2d6+2)
Fort +1, Ref +1, Will +2
OFFENSE
Spd 30 ft.
Melee dagger +1 (1d4/19–20)
Ranged acid splash +2 touch (1d3 acid) or
alchemical item +2 touch (varies)
TACTICS
During Combat Yargin prefers to use his wand of
acid splash in combat, but since he needs to roll
a 13 to activate it with a Use Magic Device check,
it’s prone to failing him—each time it does, he
erupts into a loud burst of profanity, shaking the
wand in frustration. Once he fails the third time
to use the wand, he gives up and switches
to thrown vials of acid and tanglefoot
bags. He’s deathly afraid of melee
combat, and fights with his dagger
only if cornered.
Morale Once he’s used up his alchemical
items and his wand has failed him three
times (or as soon as he takes any melee damage at
all) Yargin shrieks in panic and attempts to flee to Gaedren’s side
to warn him. That he might inadvertently lead Gaedren’s enemies
right to him doesn’t cross his mind in his panicked state.
STATISTICS
Str 10, Dex 12, Con 13, Int 11, Wis 9, Cha 8
Base Atk +1; Grp +1
Feats Point Blank Shot, Skill Focus (Use Magic Device)
Skills Appraise +5, Craft (alchemy) +5, Disable Device +5, Forgery
+5, Knowledge (arcana) +5, Search +5, Spellcraft +7, Use Magic
Device +7
Languages Common, Gnome
Combat Gear wand of acid splash (28 charges), acid (3), tanglefoot
bag (2), thunderstone; Other Gear leather armor, dagger, light
crossbow with 10 bolts, garnet amulet worth 100 gp, key to
cabinet in area A7

it is also, what i drop into the CGen

i hope it helps, i have had quite a few work (with negative numbers, and dashes) so it may be the format of the type in the text. It is a minor thing when you get most of the stat block right, and usable.

Ken L
October 3rd, 2016, 04:31
here is the stat block as copied from my source (pdf)


Yargin Balko CR 1
Male human expert 2
LE Medium humanoid
Init +1; Senses Listen –1, Spot –1
DEFENSE
AC 13, touch 11, flat-footed 12
(+2 armor, +1 Dexterity)
hp 9 (2d6+2)
Fort +1, Ref +1, Will +2
OFFENSE
Spd 30 ft.
Melee dagger +1 (1d4/19–20)
Ranged acid splash +2 touch (1d3 acid) or
alchemical item +2 touch (varies)
TACTICS
During Combat Yargin prefers to use his wand of
acid splash in combat, but since he needs to roll
a 13 to activate it with a Use Magic Device check,
it’s prone to failing him—each time it does, he
erupts into a loud burst of profanity, shaking the
wand in frustration. Once he fails the third time
to use the wand, he gives up and switches
to thrown vials of acid and tanglefoot
bags. He’s deathly afraid of melee
combat, and fights with his dagger
only if cornered.
Morale Once he’s used up his alchemical
items and his wand has failed him three
times (or as soon as he takes any melee damage at
all) Yargin shrieks in panic and attempts to flee to Gaedren’s side
to warn him. That he might inadvertently lead Gaedren’s enemies
right to him doesn’t cross his mind in his panicked state.
STATISTICS
Str 10, Dex 12, Con 13, Int 11, Wis 9, Cha 8
Base Atk +1; Grp +1
Feats Point Blank Shot, Skill Focus (Use Magic Device)
Skills Appraise +5, Craft (alchemy) +5, Disable Device +5, Forgery
+5, Knowledge (arcana) +5, Search +5, Spellcraft +7, Use Magic
Device +7
Languages Common, Gnome
Combat Gear wand of acid splash (28 charges), acid (3), tanglefoot
bag (2), thunderstone; Other Gear leather armor, dagger, light
crossbow with 10 bolts, garnet amulet worth 100 gp, key to
cabinet in area A7

it is also, what i drop into the CGen

i hope it helps, i have had quite a few work (with negative numbers, and dashes) so it may be the format of the type in the text. It is a minor thing when you get most of the stat block right, and usable.

That's weird, when I dropped that in, it parsed perfectly fine:

attack


dagger +1 (1d4/19-20) or acid splash +2 touch (1d3 acid) or alchemical item +2 touch (varies)

full attack


dagger +1 (1d4/19-20) or acid splash +2 touch (1d3 acid) or alchemical item +2 touch (varies)


log:


[1] parseAttacks (melee)dagger +1 (1d4/19-20)
[1] parseAttacks (ranged)acid splash +2 touch (1d3 acid) or alchemical item +2 touch (varies)
[3] dropIter (dropping iteratives) : dagger +1 (1d4/19-20)
[3] dropIter (dropping iteratives) : acid splash +2 touch (1d3 acid)
[3] dropIter (dropping iteratives) : alchemical item +2 touch (varies)



I feel like I'm missing something here, can someone else check that block (after aligning)?

KevenSimmons
October 23rd, 2016, 13:45
So I think I have followed the instructions (twice) and the CreatureGen is not showing as an extension on the FG Launcher page. Any suggestions for troubleshooting? I've checked to be sure it is in the correct folder. Tried both Win10 native zip, and 7-zip to created the ext file in case the compression format was an issue. Not sure what to check next.

damned
October 23rd, 2016, 14:07
make sure you are only rezipping the following

.gitignore
\cgen
CONTRIBUITORS
extension.xml
LICENSE
README.md

and rename .zip as .ext

KevenSimmons
October 23rd, 2016, 17:16
Someone also suggested copying the extension over as an uncompressed folder, which seems to have done the trick. I'll fiddle around some more to see if I can get it to work as an .ext file too.

KevenSimmons
October 24th, 2016, 00:04
Doing some playing around and after multiple attempts, with different stat blocks I am not getting the spells parsed out. The spell class entries are there, but no spells. I even tried copying the same "Drow Matron" stat block from the Paizo PRD that was used in the demo and it doesn't parse the spells, so there must be something about my environment that is throwing the parser off.

damned
October 24th, 2016, 00:12
Have you read this point?


CGen is built to sync with my spell library such that when loaded, it will populate spell details if it can find a match. Note that it will do this for both spells as well as for spell-like abilities which may not be a spell (elemental wall, heavenly fire, other class spell-like abilities). So getting a warning on failure to locate a corresponding spell-like ability is normal. For any spell it is unable to populate, it will leave blank, but still allocate its uses per day for tracking purposes.

You need Ken Ls spell library and it will need to be activated/open for the spells to be found.

KevenSimmons
October 24th, 2016, 00:16
yes, I have it and it is loaded: log file confirms: "[0] GENERAL: Spell library: "PFRPG Archive Spells" detected as loaded and available".

As I understand it, even if the spell library is not loaded, or if the spell cannot be found, I should expect to see a 'blank' or placeholder entry for the spell in the generated NPC object, correct? As it is, the spell classes are pretty much empty.

damned
October 24th, 2016, 00:39
I just set it up and tested 3 monster imports - they appear to have done the same - everything else looks correct - it puts in the right type of spell caster but it didnt populate my spells for me either.

damned
October 24th, 2016, 01:22
My log file finishes something like this:

[0] GENERAL: Spell library: "PFRPG Archive Spells" detected as loaded and available
[3] caster ->> Cleric Spells Prepared
[3] SLA caster ->> Domain Spell-Like Abilities

KevenSimmons
October 24th, 2016, 11:12
@jboyd4650

The attack line in the statblock you posted earlier is positive and uses a d4 rather than a d3, did the attack line come from the same stat block? I just want to see the statblock that caused this so I can fish out the unicode right quick.

Maybe this will provide a clue to the character that some sources are using as a minus-sign. These entries are supposed to be "-1" on the skill checks. After parsing they are converted in FG to be: & # 150 (with no spaces between & # when I post it here without the spaces, the forums interpret it as character code and display a dash symbol :)
Listen & # 150;1, Spot & # 150;1

KevenSimmons
October 26th, 2016, 12:18
I've been digging into the code a little trying to figure out where the spell parsing is going awry. I've found in the popSpells function there is a loop that appears to be cycling through spell levels ("0","1st","2nd",...) with a series of if/elseif statements: line 321: "for k2,v2 in pairs(creature.spells[casterType]) do"
When I drop a debug output to show the values of k2,v2 in all iterations of the loop and parse the Drow Matron stat block, there are only two iterations of the loop, with k2,v2 values of:
"casterlevel","15"
"concentration","22"

So it looks like the spell data isn't making it into the iterating table. More digging to do.

PS: This is beautiful code to look at. Well done Ken !

Ken L
October 26th, 2016, 20:46
I'll take a look at it later tonight.

It's an HTML entity. I'm not entirely sure how FG translates entites and unicode into iso-8859-1 encoding (or so I believe, I'm basing this off the XML).

damned
October 27th, 2016, 03:55
I'll take a look at it later tonight.

It's an HTML entity. I'm not entirely sure how FG translates entites and unicode into iso-8859-1 encoding (or so I believe, I'm basing this off the XML).

FG only sees/understands one version of the - symbol and there are at least 3 that it doesnt like.

KevenSimmons
October 27th, 2016, 18:41
With regards to the dash, negative sign issue I was having, I added this line to the "stripString" function which fixed it for me. The actual code does not have the spaces between & and # symbols - they've been added here so the forum does not interpret them as character escape codes )

data = data:gsub('& # 150;','-');

corwynn
October 27th, 2016, 22:18
FWIW I just (before I have to run out) slapped CreatureGen into my extensions folder and had the same issue: I needed to have the uncompressed folder and not a zip renamed to ext for it to be read by FG.

If it matters, my OS is Win10 Pro x64 and I use 7zip (zipping files, not 7zipping or anything) for compression.

I can diagnose more later if there's anything else which is of interest, but I'm going to go grab my kids. :)

vodokar
October 27th, 2016, 22:30
Wow. I don't play Pathfinder, but, nonetheless, I have to take a moment to applaud what you've done here. Very impressive.

KevenSimmons
October 27th, 2016, 23:26
So, I have found the problem I am having with the spell parser. It is a combination of the parsing algorithm and the character set. The parser is programmed to recognize the start of a spell list by looking for two dashes as the divider between the spell level description (e.g. "8th") and the spell list, for example: 8th -- fire storm (DC 25), unholy aura D (DC 25)

The issue I have is that the copy-paste of the source material is resulting in a single, long dash character as the separator: 8th—fire storm (DC 25), unholy aura D (DC 25). The parser does not recognize the character and therefore does not parse the spells. I fixed this by adding a line of code in the "stripString" function that replaces occurrences of the long-dash character with the two single dashes that the parser wants to see:

data = data:gsub('& #151;','--');

Note that there is no space between the & and # in the actual code. I had to put a space in here to prevent the forum from interpreting it as a character code.

damned
October 27th, 2016, 23:32
FWIW I just (before I have to run out) slapped CreatureGen into my extensions folder and had the same issue: I needed to have the uncompressed folder and not a zip renamed to ext for it to be read by FG.

If it matters, my OS is Win10 Pro x64 and I use 7zip (zipping files, not 7zipping or anything) for compression.

I can diagnose more later if there's anything else which is of interest, but I'm going to go grab my kids. :)

make sure you are only rezipping the following

.gitignore
\cgen
CONTRIBUITORS
extension.xml
LICENSE
README.md

and rename .zip as .ext

Ken L
October 28th, 2016, 00:22
So, I have found the problem I am having with the spell parser. It is a combination of the parsing algorithm and the character set. The parser is programmed to recognize the start of a spell list by looking for two dashes as the divider between the spell level description (e.g. "8th") and the spell list, for example: 8th -- fire storm (DC 25), unholy aura D (DC 25)

The issue I have is that the copy-paste of the source material is resulting in a single, long dash character as the separator: 8th—fire storm (DC 25), unholy aura D (DC 25). The parser does not recognize the character and therefore does not parse the spells. I fixed this by adding a line of code in the "stripString" function that replaces occurrences of the long-dash character with the two single dashes that the parser wants to see:

data = data:gsub('& #151;','--');

Note that there is no space between the & and # in the actual code. I had to put a space in here to prevent the forum from interpreting it as a character code.

Good catch on that unicode. When I copy/paste the same stat-block, I get unicode u2014 (which is handled) as opposed to the entity so it never appeared my testing. I've committed your change and added you to the CONTRIBUITORS file for the bug find.

I was occupied IRL so i couldn't look at it earlier, I'm glad that reading through the LUA was helpful. I tend to write self-documenting code so others can read it, comes from doing a bunch of FOSS.

Those who want the update can re-download the extension from git hub.


PS: Regarding the folder shenanigans, once you download from git hub, you get a zip with a folder CreatureGen-master inside. Extract that folder, then re-zip just that folder such that when you browse in the zip you see the CONTRIBUTORS and LICENSE file at the root, and rename that new zip creaturegen.ext. I could simply package it and constantly update the main topic but I feel like the few hoops that need to be jumped once help shake the download and forget mindset. Also you could just leave the uncompressed folder (which I do) if you want to edit the script and mod the extension. In that event /reload ruleset and /console as a hotbar item is a neat way to quickly iterate on additions.

corwynn
October 28th, 2016, 00:50
Yes, I read that, damned. :) I have done so and it is not recognized by FG.

So, reboot, new download of the file, and it's now being recognized as a zip renamed to ext.

I suspect it was one of those "windows has gone crazy" moments. *shrug*

KevenSimmons
November 2nd, 2016, 01:58
Has anyone tested this extension yet with FG v3.2 that was just released?

Ken L
November 2nd, 2016, 04:19
Has anyone tested this extension yet with FG v3.2 that was just released?

Still works.

There's an elusive bug I've noticed that when you have connected clients, it will fail to parse some unicode sometimes compared to when there are no connected clients. I haven't isolated it but if anyone can drop me a log of this occurring or isolate it, we can stamp this out.

This comes up when I'm running a game and want to ad-hoc import a few creatures.

KevenSimmons
November 4th, 2016, 01:42
Really stupid question... but after updating to 3.2 - how do you get the CreatureGen window to open. The button is no longer on the NPC window and I'm not having any luck finding it.

ddavison
November 4th, 2016, 04:28
I just now came across this and I wanted to applaud you for the solution. I put together the statblock parser for the Advanced Bestiary as a kind of after thought and had some intentions of going back to it to add the spells and clean up a bit more of the areas where it failed. Embedded solutions are definitely a better for end users. One thing you might consider is to peek at the 5E ruleset and the spell look ups there. Those look across all open modules for the first matching spell name. The challenge with many of these parsers is that the stat blocks don't always conform 100% to the standard. Additionally, there are character issues where it looks great in print but they are actually slightly different characters being used.

I've made a note to come back and take a look at the code and approach you used to see if there is something else I can contribute to your cause.

Either way, we are always happy to welcome coders to the community here at FG, especially when they contribute great tools for the community to use.

Ken L
November 4th, 2016, 06:05
Really stupid question... but after updating to 3.2 - how do you get the CreatureGen window to open. The button is no longer on the NPC window and I'm not having any luck finding it.

CreatureGen overrides the NPC list, so if you have any other extensions that also alter the NPC list, try disabling them. This is one of the reasons I was looking at a possible widget implementation. On my end, it still appears on the npc list. Also check if the extension is loaded for obvious sanity reasons.

to check if it is indeed being overriden use the command


/openwindow cgen_window


to directly open the window, just know that since the database path is referenced locally from where the window is launched; it won't function properly if launched in this way; but is a good way to check if the extension is even loaded.

@ddavison
I share what I develop when it helps others, there's a number of smaller things I've made that are only specific to my handful of circumstances. As it stands, CGen's xml window is really looking for some love and I feel pretty guilty for not putting a bit more effort into appearances. I'll get to it eventually one of these months.

KevenSimmons
November 4th, 2016, 09:57
No luck. I have a test campaign with only the CGen extension activated, and the button does not appear (screen capture attached). I can manually /openwindow, but as you said it does not function after opening.

16052

Ken L
November 4th, 2016, 10:19
https://i.imgur.com/AQ0csrj.gif

I'm also running 3.2... I have no idea now...

damned
November 4th, 2016, 13:46
Your movie file shows 3.1.6? I take it thats one you recorded earlier?

KevenSimmons
November 4th, 2016, 14:08
Your launcher says 3.2.0, but if you look at the ruleset versions that are loaded in the chat window, they are still 3.1.6 or 3.1.2. My ruleset versions that are loading are all 3.2.0.

My first guess is that the redesigned NPC window has a new name in v3.2.0 ruleset, and thus the extension isn't adding the button to the new window. The 'npclist' windowclass is still defined, and I can open it with a /windowopen command, but that isn't what is opened from the sidebar button in the new ruleset (screen capture)

16062

damned
November 4th, 2016, 14:16
KenL if you have unpacked rulesets in your ruleset folder (common if you are doing extensions) Fantasy Grounds will use these instead of the newly downloaded pak files. Id rename those unpacked folders (example CoreRPG-3.1.6) and then unpack new ones if you need to keep working on those rulesets.

Zeus
November 4th, 2016, 15:07
KenL - Doug mentioned this yesterday and whilst I have yet to use the extension I have watched the videos and have to say a very well done. Writing parsers for FG can be quite time consuming but I am sure everyone here in the community will join me in thanking you for the contribution.
As the author of PAR5E and a long time FG contributor and developer I very well understand the complexities of parsing content into FG so feel free to reach out to us at if we can be of any help.

Ken L
November 5th, 2016, 00:48
Parsers are really elementary logic any teenager can write. It's just rote and boring compared to more complex and mentally stimulating constructs.

Regarding my GIF; I just remembered that I did indeed edit the 3.5 ruleset to a custom version, therefore It uses my custom configuration over the updated 3.5 ruleset.

I'll take a look at 3.2; but for the future I'm likely to move to a widget or some kind to avoid this problem all together; but if I have to constantly mod for the new version even then, I'll do so on my own time as opposed to whenever FG updates.

Ken L
November 5th, 2016, 02:52
Alight, I played easter egg hunt for the new npc list within core rules and couldn't find it for ~1hr in 3.2.

Can a developer chime in on this location? It would have been a simple swap of references but I see a number of things have been flipped around that require more than grep -rn. Else I'll likely leave it broken as is.

ddavison
November 5th, 2016, 03:02
I haven't looked at the extension code yet, but you can look for the masterindex window from CoreRPG.

wndNPCs = Interface.openWindow("masterindex","npc");
wndNPCs.setRecordType("npc");

Ken L
November 5th, 2016, 03:14
I simply launched off the npclist windowclass. That was replaced by something that's not immediately obvious:


3.1.6 campaign_npcs.xml


<windowclass name="npclist">
<frame>campaignlistwithtabs</frame>

...
...

</windowclass>


I can't seem to find an equivalent windowclass here:
https://pastebin.com/h9Q5rSXb

I've already looked at record_npc encounter, randomencounter, which reference an npc list, but aren't referring to 'the' npc list.

Ken L
November 5th, 2016, 04:38
So everything is now grouped under the masterindex; this will raise a few issues, i'm surprised advanced bestiary isn't having issues as well given it launches similarly. Also the data node bindings are different so record population is failing. I'll look at it later.

Ken L
November 5th, 2016, 05:05
Pushed out a new update, it should work again. There's a quick hacky fix that just places it on the masterindex window so it'll show up as a button on npc/story/item tabs etc...

I'm wary of injecting any script for the masterindex to be context sensitive to display the button only when the NPC section of the master index is shown given how that may change. Some time down the line i'll figure something out unless there are any ideas floating around. I'm all open to pull requests.

DMReckless
November 5th, 2016, 05:21
-removed=

ddavison
November 5th, 2016, 15:04
So everything is now grouped under the masterindex; this will raise a few issues, i'm surprised advanced bestiary isn't having issues as well given it launches similarly. Also the data node bindings are different so record population is failing. I'll look at it later.

Yes, Advanced Bestiary broke as well when 3.2 launched. I had to similarly switch it over to use the masterlist.

KevenSimmons
November 5th, 2016, 16:20
Yay! Thanks Ken. This is one of the most (if not *the most*) useful extension I've found as a GM. I've only had it two weeks and already I can't imagine myself using FG without it - so your efforts are very much appreciated.

Also, FYI, I have come across another couple of string substitutions that came up when pasting from various sources (PDF files, web pages, etc.) One is used as a dash symbol, and the other was used as a multiplier symbol in a weapon crit range (e.g. halberd +5 (1d10+3/×3). I've added the following code to function stripString to accommodate. As before, spaces are added here so the forum doesn't interpret as character codes.

data = data:gsub('& #150;','-');
data = data:gsub('& #215;','x');

Ken L
November 5th, 2016, 16:29
I attempted to place it in npc_header, but I don't have a full grasp on how the windowing structure works in FG so I gave up after 30m of fan-dangling and scouring the documentation as well as looking for examples.

@KevenSimmons: Thanks for the catch. I'll probably also add all html entities for the common unicode just incase. For myself it seems to use the /u#### format; but every clipboard is different so it makes sense I never caught it. There's also left double paren and right double paren as well as other strange things.

Moon Wizard
November 6th, 2016, 05:02
You can use:
LibraryData.addIndexButton("npc", "button_creaturegen");

And:
<template name="button_creaturegen">
<button_text_sm>
<anchored to="buttonanchor" width="70">
<top />
<left anchor="right" relation="relative" offset="5" />
</anchored>
<state textres="npc_button_creaturegen" />
<script>
function onButtonPress()
Interface.openWindow("creaturegen_windowclass", "creategen_datanode (if any)");
end
</script>
</button_text_sm>
</template>

I've used this template for several different similar additions throughout the SavageWorlds settings.

Regards,
JPG

Ken L
November 6th, 2016, 10:30
I'm not exactly clear what the LibraryData object is. I'm vaguely aware that you're adding a template here but without context I'm unaware of specifics. If I had limitless time I perhaps can dig more but I tend to do these things at the end of day and oddly enough in my morning hours (pending grogginess).

Moon Wizard
November 7th, 2016, 06:21
The LibraryData script manages the "record types" that are recognized by the various campaign lists, including what to show in the campaign lists themselves.

The addIndexButton just assigns a template to be instantiated when the campaign list is instantiated. It is used to add template buttons like the "Forge", "Folder" and "Store" buttons you see in the campaign lists.

Regards,
JPG

Ken L
November 7th, 2016, 08:26
Is there a way to run this on load? That way I can assure that upon extension load, it can run this 'setup' scriptlet to attach it to the npc record type when it is loaded by the master index.

damned
November 7th, 2016, 08:43
You can call the script in your extension.xml and it will run when it loads the extension - eg at load time.

Moon Wizard
November 7th, 2016, 08:43
Yes, just add it to any onInit function on any global script.

Regards,
JPG

Ken L
November 7th, 2016, 11:06
38 <script>
39 function onInit()
40 LibraryData.addIndexButton("npc","cgen_button_launch");
41 end
42 </script>


Within my extension.xml after my includes.

I'll look at it some time Wednesday; you can peek around the git hub in cgen/xml/windows/cgen_window.xml for where I should insert this; I haven't pushed any of these preliminary changes so it's currently at the masterindex hack. I'll be out and about the next two days to stop an angry orange man from duping more people.

Callum
November 7th, 2016, 12:16
I'll be out and about the next two days to stop an angry orange man from duping more people.

I hope you don't mean me! (I know you don't mean me - and I fully support your efforts!)

Moon Wizard
November 7th, 2016, 17:52
All global scripts have to be named, so that one is probably not running.

Regards,
JPG

swest
November 8th, 2016, 03:18
Greetings Ken L,

I've downloaded, and am practicing with CGen. I have tried parsing a number of SRD entries, and they work quite well. However, my first attempt at trying a .pdf is failing miserably.


So, with that in mind, I have a question that is simple to ask, but might require the exchange of additional information. You tell me.

I pulled the text for "The Skinsaw Man" out of the Skinsaw Murders chapter of Rise of the Runelords, Anniversary Edition, Page 107. I have done various manipulations on it (based on your video guidance), and it parses. However, I can't seem to get the Offense block to parse correctly.

Let me know if you don't have the .pdf, and I'll post the relevant content (hopefully, an extract is covered under the Fair Use act).

Anyway, my question is this: What must be done to that example .pdf input, to have it correctly parse that NPC?

I have, pretty much, tried everything I can think of, and it never really gets the Attack section correct. I'm hoping, if you have the .pdf, that you can just show me what must be done to make that one work.

Thanks.

- s.west

Trenloe
November 8th, 2016, 03:20
Let me know if you don't have the .pdf, and I'll post the relevant content (hopefully, an extract is covered under the Fair Use act).
The OGL (that Paizo releases all of it's Pathfinder products under) allows distribution of the game stats (statblocks, spells, feats, etc.). So you're good to post the NPC statblock here.

DMReckless
November 8th, 2016, 04:16
Swest,
I copied from the pdf and found the following alterations necessary:
a) added in /+7 to war razor and changed the m-dash in between the 19 and 20 to a regular dash
b) changed "and" to "plus" under the bite damage (the parser prefers plus x plus y to plus x and y)
c) deleted the line break after the first "plus" for bite

The attacks parsed properly after those changes

DMReckless
November 8th, 2016, 04:23
Ken,
Don't know if it would be possible in future versions to include the most commonly used metamagic (extended, quickened, maximized, empowered) to the spell parsing? Right now my work-around has been to modify the statblock to move the metamagic to parenthesis after the spell name. It's been working, and the issue/error reporting has kept me from missing any, but if the code could be done, that'd been cool, too.

Ken L
November 8th, 2016, 10:21
The and/or bit in attacks is mainly a consistency the prd follows in terms of their use in damage blocks. I was thinking about adding that context sensitivity.

The the issue raised is unicode related. I dream of utf-8 support, in the mean time my unicode patch will be incoming in a day or two when I can spare a breath.

Regarding spell metas, I have logic in there I disabled that processes metas. The thing is some spell names have a meta like name such as shadow conjuration. I have an idea for filtering that but I never got to it. IT still misses 'create greater undead' as when it recreates the name and spell strebgth, it uses 'create undead greater' which is a miss match in my library.

Also VOTE if you're in the U. S.
Today is the day!

swest
November 8th, 2016, 22:43
Swest,
I copied from the pdf and found the following alterations necessary:
a) added in /+7 to war razor and changed the m-dash in between the 19 and 20 to a regular dash
b) changed "and" to "plus" under the bite damage (the parser prefers plus x plus y to plus x and y)
c) deleted the line break after the first "plus" for bite

The attacks parsed properly after those changes

I got the 'm-dash' figured out. But the other things you mentioned I was ignorant of.

[edit] I guess I don't get the "added in /+7 to war razor". Could you show me before/after? Thanks.

Thanks.

- s.west

DMReckless
November 9th, 2016, 00:37
the war razor attack is just listed in the statblock as +12. I changed it to +12/+7 so he gets both attacks on a full attack.

Ken L
November 15th, 2016, 03:08
- Redacted -

Ken L
November 15th, 2016, 15:45
Update: 1.1
- Fix for unicode minus and multiply sign (Thanks KevenSimmons)
- Fix for NPC button (Thanks Moon, ddavid)

Bit late, but last week was a rollercoaster..

Ken L
November 15th, 2016, 18:37
Update 1.2
- Fixed spontaneous casters spells per level which was incorrect prior, also they were treated as prepared casters prior to this.

KevenSimmons
November 25th, 2016, 15:45
I've come across another character code that needed converting. This time it is the character being used as an apostrophe in the source material - in this specific instance the text is - alchemist's fire -
The character code for the apostrophe in the source material is: & #146

I added the appropriate substitution statement to the stripString function which fixed the issue for initial conversion, but the code that subsequently generates the "Attack" entry from the "Full Attack" string doesn't seem to like the apostrophe. (see image attached)

16604

Here's the source copied from the CGen window in FG: https://pastebin.com/FkkYANHw

And the log file is attached

Ken L
November 26th, 2016, 20:06
I'll take a look.

I'm actually glad it's only unicode issues here as opposed to something more wacky.

I actually do know of one bug where if the base statistics section contains 'spells known' it'll freak out a bit on spell population, I haven't found the time to grind that one out yet.

Ken L
January 17th, 2017, 19:32
Hey Keven, I know I've been neglecting this for ages (a lot of.... crazy things have happened), but can you copy-paste me the full log at level 5 for this particular stat-block that contained the offending text? FG has issues with post length so drop it in paste bin (https://pastebin.com/) so I can see what's up.

KevenSimmons
January 21st, 2017, 20:06
Hey Keven, I know I've been neglecting this for ages (a lot of.... crazy things have happened), but can you copy-paste me the full log at level 5 for this particular stat-block that contained the offending text? FG has issues with post length so drop it in paste bin (https://pastebin.com/) so I can see what's up.
I've updated my original post with this info

Ken L
January 31st, 2017, 01:05
Had a few things up the pipeline, but I got around to putting out the fixes. Something tells me that there may be errors for attack lines that don't contain a +# or -#. I've checked the likely contenders such as swarms / grenade launchers but just putting it out there.

Update 1.21
- Fixed: Character code issue (Thanks KevenSimmons)
- Fixed: DropIter only delimiting on alpha numeric names (Thanks KevenSimons).

See Github for the newest update.

Bidmaron
January 31st, 2017, 03:56
Why isn't this on the official list of extensions? Is it 3.2 compatible now?

Trenloe
January 31st, 2017, 04:41
Why isn't this on the official list of extensions?
It is.

Bidmaron
January 31st, 2017, 15:16
Man am I going blind? Sorry trenloe!

dantedoom
February 12th, 2017, 20:41
Is it working on 3.2.3 ?? Cant seen to intall correctly i suppose...

Ken L
February 13th, 2017, 01:18
It works, if the zipping process is too complicated, you can just download the zip from github, and drop the folder inside the zip in your extensions directory.

dantedoom
February 18th, 2017, 02:51
It works, if the zipping process is too complicated, you can just download the zip from github, and drop the folder inside the zip in your extensions directory.

I tried that but got the error:

Extension: Creaturegen-master
Error: Unable to load ruleset file (cgen/xml/windows/cgen_window.xml)
:confused:


EDIT:
The error was that this extension dows not work with Advanced Bestiary (that does something similiar).

Ken L
February 18th, 2017, 22:22
Yea, they don't play well together as they essentially perform the same function at different magnitudes and scope. I don't have the advanced bestiary so I don't know where they conflict outside of claiming the same real-estate on the NPC widow list for their launch areas.

the AB extension is a bare importer with some factory elements to apply templates iirc, mine is a bit more tailored so pick specific details. If you want a 3pp solution try trenloe's importer via library but it'll only work on windows.

dellanx
February 21st, 2017, 23:07
Put CreatureGen.ext into extension folder created in by zip instructions and GitHub. Not working, FG does not recognize the extension.

damned
February 21st, 2017, 23:14
Put CreatureGen.ext into extension folder created in by zip instructions and GitHub. Not working, FG does not recognize the extension.

It means you are zipping it wrong.
Just put the unpacked folder in there instead.
Simpler and less likely to make a mistake.

dellanx
February 21st, 2017, 23:35
damned Thanks that worked!

gagsmith
February 27th, 2017, 21:49
This is simply put, an amazing tool that will save me time and headaches. Thank you!

KhybersGhost
February 28th, 2017, 06:07
With the latest updates to FG and the new look to the in game windows I can't seem to get this to work anymore.

Allmight
February 28th, 2017, 11:41
With the latest updates to FG and the new look to the in game windows I can't seem to get this to work anymore.

New look to windows? Still look the same in 3.3.0. They only made small adjustments to the character sheet, nothing that should affect the creature gen.

Just tried to import a statblock, and still works fine for me.

Ken L
February 28th, 2017, 21:00
With the latest updates to FG and the new look to the in game windows I can't seem to get this to work anymore.

If you're using an older version, from months ago, I released an update to handle the 3.3 change. Download the latest version of Cgen and try that.

KhybersGhost
March 1st, 2017, 21:08
Thanks! Didn't see the update. Works great. Really appreciate all the work you've put into this invaluable tool!

Gariot
March 5th, 2017, 06:24
Testet it with the Monster Advancer (https://www.d20pfsrd.com/bestiary/tools/monster-advancer/) from d20pfsrd. Works like a charm :) Little bit adjusting of course because of spacing and stuff but its working, brilliant. Thank you for your work <3

Talen
March 13th, 2017, 21:48
Ken and Damned,

I realize this is almost a certainty to be user error, but I'm having a similar issue described earlier installing the extension.

I am using Win 10 and have downloaded the zip, extracted, zipped and changed the filename extension as described in post 2, subsequently ensuring that I only rezipped the files

.gitignore
\cgen
CONTRIBUITORS
extension.xml
LICENSE
README.md

and rename .zip as .ext

When that failed, I took the unzipped folder and placed directly in my extension directory.....I still cant seem to fine the CreatureGen extension to select.
I cant for the life of me figure out where Im falling down on something that appears so simple! Any other suggestions before I say mean things to my dog? Maybe an unpacking utility other than the built in Windows file explore utility?

Bidmaron
March 14th, 2017, 01:01
...
I am using Win 10 and have downloaded the zip, extracted, zipped and changed the filename extension as described in post 2, subsequently ensuring that I only rezipped the files
....


The red is probably where you went wrong. When you look at the zipped folder using windows, you should see several files inside the zip, but my guess is that you instead see a folder inside the zip file and inside that folder are the files that should be one layer up.

To properly zip files using most (retarded) zip programs, what you have to do is select all the files in the package and then zip those using the windows right-click zipper (don't use other zip programs).

Once you do that, verify there is only one layer of files in the zip and then rename the zip with 'ext' in place of zip, place the ext into your extensions folder, and you will be in business.

Talen
March 14th, 2017, 01:44
The red is probably where you went wrong. When you look at the zipped folder using windows, you should see several files inside the zip, but my guess is that you instead see a folder inside the zip file and inside that folder are the files that should be one layer up.

To properly zip files using most (retarded) zip programs, what you have to do is select all the files in the package and then zip those using the windows right-click zipper (don't use other zip programs).

Once you do that, verify there is only one layer of files in the zip and then rename the zip with 'ext' in place of zip, place the ext into your extensions folder, and you will be in business.


Thanks for taking the time to respond - but pretty sure Im doing what you describe ...here is the screen shot of the zip file (before I rename with the ext extension, showing what is including in the packed file - all at the root level.

damned
March 14th, 2017, 01:51
Talen if it looks something like:
\extensions\creaturegen\files
or
\extensions\creaturegen.ext

Make sure its the correct \extensions folder that FG is looking for...
and make sure you are loading this for Pathfinder of course!

Talen
March 14th, 2017, 02:02
Thanks Damned - all my other extensions are showing as a clickable option - just not this one.....

Bidmaron
March 14th, 2017, 02:08
That certainly looks correct.

Once you produced the .ext zipped file, you placed it inside the extensions folder, and you ensured you were in the proper folder by either opening it from the FG launch screen or from the Windows Fantasy Grounds launch option to open the fantasy grounds data folder?

Talen
March 14th, 2017, 02:14
Just to make sure I wasnt crazy (well as far as this is concerned) I used the directory link from the FG launch screen and placed the ext there. Same result. Also tried with the uncompressed folder - same result.

Bidmaron
March 14th, 2017, 04:22
OK, can you please post a screenshot of your FG data folder and another of your extensions folder contents (with the ext file in there)?

This is weird. It's not like you are a newb here or anything.

damned
March 14th, 2017, 07:46
Ok I deleted mine and did it again just in case there was an error in the downloaded files but it all works.
Just in case - the Extension Name lists as Creature Gen and when you load the campaign it will just show the one line+logo

Talen
March 14th, 2017, 14:16
I started a new campaign and everything works as expected - thanks for trouble shooting....I guess my old campaign file may be corrupted - but all is well now. Thanks for trouble shooting with me!

Ken L
March 15th, 2017, 06:30
Was your old campaign PF or 3.5? it might have been something other than PF.

Talen
March 16th, 2017, 00:50
It was 3.5....I hadn't given any thought and had just assumed 3.5 and PFRPG were interchangeable.

CorzatTheGray
April 22nd, 2017, 03:23
Is this not working with FG 3.3?

I know it [3.3] was just pushed recently and I haven't had to use it [CGen] lately, but now I'm back in data entry mode and would like to use it, but it's not showing in my list of extensions even though the .ext is in the correct folder.

Any help appreciated.

damned
April 22nd, 2017, 03:55
Welcome CorzatTheGray
It shows for me with PFRPG and 3.3.0

CorzatTheGray
April 22nd, 2017, 03:59
You are correct... repacked the ext file and got it working...

I get where OP is coming from to leave the code out there for all to see and contribute on github...

But the added steps do leave [a lot of] room for error.

But, glad I figured it out!

Love this little bit of code! Definitely makes it easier to get those NPCs entered in.

edit: Also, thanks for the warm reception and I'm glad to finally have a voice out here... I've just been lurking for months...

darthgator
April 22nd, 2017, 16:35
Fixed

Erin Righ
April 25th, 2017, 06:44
Ken, I would like you to know that I have erected a statue of you in my City's Park and am petitioning to have your birthday declared a civic holiday, This extension is exactly what I needed for my custom creatures

nickabbey
April 29th, 2017, 00:04
Just dropping a note to mention that I don't bother with the zipping and renaming to .ext. I just clone the repo inside of my fg_data/extensions folder. I don't think there has been an update since I first installed, but when is released it's as easy as git fetch and git pull. FG picks it up just fine and it works without issue. If that sounds like gibberish, then just ignore the suggestion. Git is not worth learning/installing if this is all you will ever do with it. Just go with the originally documented procedure to download/re-zip/rename.

Mentalic
April 30th, 2017, 21:37
I don't know what I am doing wrong but I can't get this to work. I extracted with winrar. Pulled out the master folder. Zipped it. Renamed it. Placed it in the correct folder. It doesn't show up.

I tried with 7zip and Winrar. It doesn't seem to work.

EDIT:
Nevermind, I got it to work by just not zipping it up

Ken L
April 30th, 2017, 21:59
I feel like I should include the text 'some assembly required'. But i've always been known as a disruptor; heck if I wasn't there would be entire company departments believing windows mobile was the future.

Ken L
June 12th, 2017, 07:53
Update 1.5: Various fixes
- Fixed: CR now does fractions correctly, 1/2, 1/4, 1/8 CR values usually took the tail digit as the CR (ie: 1/2 became CR 2).
- Added: Description and Ecological information by popular demand. It'll assume that this description is on line 1, if the name is instead on line 1, it'll assume there is no description.
https://i.imgur.com/4KFbNj0.png

Get the freshest update from github.

Faelwen
June 13th, 2017, 12:19
Hi there!

First, I'd like to express my deepest gratitude. In Roll20, your scripts saved me hours, nay, days of prep. Although we never had the opportunity to interact with one another, I was a little sad to see you leave. Recently, while preparing my newest campaign, I tried to improve on your CGen scripts and got increasingly frustrated with the framework of Roll20 (not to mention the fact that they break them with every update). I'm not exactly sure how, but I somehow stumbled accidentally on this very forum page and was pleasantly surprised to find where you've been and what you were up to... believe it or not, this was actually a deciding factor in me joining Fantasy Grounds about a month ago.

Now that I've said all that, I'd like to make a suggestion. Your extension automatically populates the spells, which is absolutely fantastic. However, it doesn't populate the spell actions that go along with the spells. I understand that you didn't add this functionality because it is context sensitive, however it turns out they are actually not too difficult to add automatically.

For example, here are a few approaches :

1) Once you've created and populated the spell node in the NPC, just add a single line of code to call the 3.5 Ruleset spell parser (SpellManager.parseSpell(spellNode)). It will parse the spell info to try to guess what spell actions are needed and automatically add them to the spell node. From my humble and short experience fiddling around with it, it seems to work as intended about perhaps 90% of the time.

2) Some spell libraries contain spell actions (e.g. Farnaby's spell library). You could scan these libraries and if a match is found, copy the actions along with the rest of the spell data.

Actually you can even do a combination of these possibilities. For example :
- Scan Farnaby's library, if spell is found, copy the spell actions.
- If spell isn't found. Scan your own library and if a match is found, call the 3.5 parser to generate the spell actions.

Anyway, keep up the good work!

Nylanfs
June 13th, 2017, 12:29
Welcome to the forums and FG community!

Ken L
June 13th, 2017, 20:13
... I tried to improve on your CGen scripts and got increasingly frustrated with the framework of Roll20 (not to mention the fact that they break them with every update).....

....

1) Once you've created and populated the spell node in the NPC, just add a single line of code to call the 3.5 Ruleset spell parser (SpellManager.parseSpell(spellNode)). It will parse the spell info to try to guess what spell actions are needed and automatically add them to the spell node. From my humble and short experience fiddling around with it, it seems to work as intended about perhaps 90% of the time.

2) Some spell libraries contain spell actions (e.g. Farnaby's spell library). You could scan these libraries and if a match is found, copy the actions along with the rest of the spell data.

Actually you can even do a combination of these possibilities. For example :
- Scan Farnaby's library, if spell is found, copy the spell actions.
- If spell isn't found. Scan your own library and if a match is found, call the 3.5 parser to generate the spell actions.

....

No problem Faelwen, glad you found it useful. My main issue with r20 was that I was effectively renting my ability to use my own stuff; when they rolled out one-click and effectively marketed freely contributed items to get others to subscribe is when I bailed. It would be different if their Pro level had other core features and API was a tack on, but their API was the reason to even get 'Pro'. I have no qualms with their plus/free tiers. There was also the tightly controlled community CoC, you couln't say much other than 'Roll20 is the awesome!' as if you got too critical they'd shut it down. That's not to say FG is some kind of shining beacon as it has major issues and lacked some key features during the transition; but it has others that r20 doesn't and requires a different state of mind when it comes to preparation. At least I get straight answers from the devs as opposed to getting nothing then stealthy 8 months later they address that exact problem; but I do tend to complain a ton about software I buy given my FOSS roots, especially if I can't tinker it.

Regarding the issues that you brought up:

1.) The SpellManager is interesting as I never dug deep into the rulesets outside of what I needed; i just knew that it tended to be wrong at times so I didn't want to force anything incorrect. I'll probably update the extension come this Friday with that addition with a disclaimer.

2.) I'm not fond of harvesting anything from anyone else's libraries. I may scrape websites and credit them, but within the same platform that's bad etiquette; also Farnaby's only goes up to level 4 iirc and there's been a raft of new spells that aren't covered so it'll be a strange mix.

and thanks for the kind words!

Nylanfs
June 13th, 2017, 21:23
I've found the community here more friendly than on Roll20's forums.

Any company that doesn't allow discussion of short comings, or comparisons to competitors is suspect in my view.

Ken L
June 19th, 2017, 05:38
Update 1.55 Spell Action Parsing
- Fixed type parsing as I used size increments for my hits (small,medium,large etc..) and if the description had those keywords it'd put that in the type field. A simple hack makes it bypass the first line for this check
- Fixed Spell Like abilities did not parse week/month/year powers so if you parsed Marids you'd notice they didn't have wish! now they do. Also I got rid of that ugly redundant code I hacked together ages ago.
- Fixed Ecological information not showing up correctly as it was looking in the wrong place, that information tends to be after SPECIAL ABILITIES rather than following ecological if SPECIAL ABILITIES are present.
- Added Spell Actions parsing thanks to a heads up by Faelwen, and also the developer who made the SpellManager. NOTE: that the spell actions for spell like abilities will probably be wrong at times as I use spell levels to group uses of day/month/year. It may use that level group for a parsed calculation.

Check the GitHub for the latest updates.

Ken L
June 19th, 2017, 05:41
Also, I can't seem to edit my main post given the character limit length.

LordEntrails
June 19th, 2017, 19:44
Also, I can't seem to edit my main post given the character limit length.
I've run into this. Sometime you will find better luck using the Advanced Edit option, or try changing the url between http and https.

But, both of those are only temporary work arounds. What you may want to do is move most of the first post into an attachment (what I had to do on the Module Creation Best Practices thread).

Ken L
July 26th, 2017, 18:41
Update 1.56: Bug fix
- Fixed Ecological information from not showing up in some cases as several escape characters were not handled widening what could be excluded from the ecological information block.

Check the github for the freshest update.

Erin Righ
August 3rd, 2017, 02:13
This extension works great!

Ken L
September 1st, 2017, 20:10
A little birdy told me that I had resistances wrong for the longest time.

I had been sticking 'Resistances' rather than the FG auto-effect 'Resist' so resistances were never working in the CT!

Update 1.60 Bug Fix
- Fixed: Resistances should now take effect correctly in the CT
- Fixed: 'Special Abilities' would show up in the ecological extra information section sometimes, this is no longer the case.

Check the github for the latest update

KevenSimmons
September 22nd, 2017, 00:21
Has anyone verified that the extension still works with v 3.3.2 ?

Ken L
September 22nd, 2017, 00:31
It appears to work, It's pretty isolated, the only tie it has to the rule-set that might get con-fuddled by updates is the function used to add a button to the NPC list.

KevenSimmons
September 25th, 2017, 18:45
I'm not quite sure when it happened, but I've noticed that the iterative attacks are no longer being removed when the "attack" field is being populated. Here's a sample output from the log window and screen capture of the results

[1] parseAttacks (melee)elven curve blade +10/+5 (1d10+3/18-20)
[1] parseAttacks (ranged)+1 composite longbow +12/+7 (1d8+3/x3)
[0] GENERAL: elven
[0] GENERAL: elven curve blade +10/+5 (1d10+3/18-20)1 5 19 21 +10 +10
[3] dropIter (dropping iteratives) : elven curve blade +10/+5 (1d10+3/18-20)
[0] GENERAL: composite
[0] GENERAL: +1 composite longbow +12/+7 (1d8+3/x3)4 12 22 24 +12 +12
[3] dropIter (dropping iteratives) : +1 composite longbow +12/+7 (1d8+3/x3)


20719

Ken L
September 29th, 2017, 03:24
Can you post the statblock?

KevenSimmons
September 29th, 2017, 04:14
Slightly different statblock from my original post - but exhibits the same behavior

I've tried stat blocks from a couple different sources, and even manually retyped the weapon attacks in the CreatureGen input window in case the copy-paste was bringing in delimiter characters that weren't being recognized - all did the same thing. Very odd. I've recently updated the CreatureGen extension, and of course the new FG version last week so I don't know for sure when the behavior started. My next test will be to see what happens if I use a previous version of CreatureGen.

Ken L
September 30th, 2017, 07:26
Update 1.61: Bug fix
- Fixed dropIter bug introduced awhile back when fixing another issue (several versions ago actually!)
- Fixed removed old debug, and made existing debug messages more useful to diagnose statblock issues.

If you're having issues with attack or spells being parsed, log level 3 has those details.

Also Keven, the statblock works fine and the bug wasn't due to FG's update, it was a bug introduced in an early version during a patch for dropIter's regex. The only thing I'd change is that the CR field should be on the same line as the name as when I generated it, It internally looks for a line with a CR field.

Check the github for the freshest update.

KevenSimmons
September 30th, 2017, 16:11
Thanks Ken. New update is working great. Thanks again for all your hard work.

AkiBishop
October 10th, 2017, 21:25
Yeah. The tool looks super helpful, but I can't figure out the Github thing. I'm going step by step but I just end up with a zip folder with a different name in my extensions. FG won't recognize it. Any suggestions?

dantedoom
October 10th, 2017, 21:30
Yeah. The tool looks super helpful, but I can't figure out the Github thing. I'm going step by step but I just end up with a zip folder with a different name in my extensions. FG won't recognize it. Any suggestions?

Just unzip and paste the full folder. It should work!

madman
October 10th, 2017, 23:31
re-zip all the files in the folder and name it Creaturegen.ext do not let your zip program name it .zip.
Madman..

raif11152
November 27th, 2017, 01:38
I get a lua error immediately after installing it and before i import any stat blocks if i go into the NPCs window and click "by Type"

Script Error: [string "scripts/data_library_35e.lua"] 48: attempt to index a nil value

Erin Righ
November 27th, 2017, 05:02
I would try checking other extensions. Start by disabling all extensions but this one and reenable them one by one until you get the error

Erin Righ
November 27th, 2017, 05:02
Oh, and welcome to he forums Gorgon

raif11152
November 29th, 2017, 01:46
Thanks for the suggestion! Before I posted I did disable everything. I have also created a new campaign where I only loaded this extension and got the same error.

Ken L
November 30th, 2017, 06:13
I get a lua error immediately after installing it and before i import any stat blocks if i go into the NPCs window and click "by Type"

Script Error: [string "scripts/data_library_35e.lua"] 48: attempt to index a nil value

That's not even related to CGen as it's not a script I control. It does seem related the The button however as I use Moon's library add button to hook into the NPC list which does some library manipulations. I however do not see this error at the current FG version, or prior ones.

madman
December 3rd, 2017, 02:12
It seems I am not getting the correct spell DC set for saves when importing.

I was not checking these for a project i am working on.

Example Stat block
https://paizo.com/pathfinderRPG/prd/bestiary2/agathion.html#agathion,-draconal

Am I missing something here.
It seems to parse the spell (DC 20) to the modifier box in the save field but it does not change it to fixed.

Or see attachment
Madman..

Ken L
December 3rd, 2017, 02:51
SLAs will be wrong due to the grouping of spells into level 'groups'. the Spell DCs may not be accurate at times as it relies on the 3.5/PF spell parser to process the spell text, I noted this when I added the spell parser to process the spells.

madman
December 3rd, 2017, 03:12
Thanks

Madman..

Ken L
December 3rd, 2017, 06:21
To understand what's happening, it's mostly due to the context of the spell wording. I've written a small natural language processor before, and I'm not going to do this in LUA for FG so I leave it to the built in spell parser than gleans surface information. The (DC 20) that is listed form the spell name is irrelevant to the actual calculated DC as it simply extracts the spell name and leaves outliers such as that out. Else it would be searching for a spell named "Circle of Death (DC 25)" as opposed to "Circle of Death". Those tags are left alone as they often provide some context to the spell that the GM reading it can surmise.

Originally I didn't perform any spell parsing if you look at earlier pages, the only reason CGen does it now is that SpellManager is left to perform the parsing to organize the spell actions.

The SLA DCs/Durations however are wrong due to level grouping. I was recently informed that I should be treating these as prepared spells as they don't pool their uses together. A single use of "7/day glitter dust" should not use a use from "7/day gust of wind" despite the similar pool-like notations. I'll fix that in time.

Ken L
December 28th, 2017, 07:55
Update 1.7: Expanded capability
- Fixed SLA bug that would override an at-will ability if it had constants
- Fixed SLA rework such that they're not considered spontaneous anymore, so one 7/day <spell A> would not expend uses from another 7/day <spell B>. They are still grouped together in 'levels' by their per-uses
- Added Support for 'Psychic Magic', it shall now parse these sections as spontaneous casters, placing all spells in a single group per 'PE' pool (in the event that they have multiple). The pooled uses are 'casts' so if you use a psychic magic that uses 6-PE then check off 6 uses
- Added Support for Meta-Magics at the basic level. It can now parse spells that had their name augmented by some kind of meta magic field. Prior it would ignore it and throw a warning, now it'll find the base spell to add to the NPC entry. Note that it does not apply the meta magic's effects to the spell. It can 'X-ray' through multiple layers of meta magics such as "Quickened Silenced Aquatic Aquatic Trail" where 'Aquatic Trail' is the base spell name augmented with the 'Quickened', 'Silenced' and 'Aquatic' meta-magics.


Check the github for the freshest update.

madman
December 28th, 2017, 16:19
Sweet, Thanks

Madman..

madman
December 29th, 2017, 03:21
So, any chance with this new update you added the class to modifier. i.e Cleric=Wis or SLA=Cha?
Or is that done with the 'SpellManager'

Madman..

Bidmaron
December 29th, 2017, 03:58
Ken L, thanks for continuing your wonderful work on this tool. I had forgotten you were doing this, and I take back my snide remark the other day about you not sharing your work. Forgive me, please.

Ken L
December 29th, 2017, 21:19
So, any chance with this new update you added the class to modifier. i.e Cleric=Wis or SLA=Cha?
Or is that done with the 'SpellManager'

Madman..

It doesn't have contextual class/mod connections. I don't really want to have to update or manage a database/massive-crappy-array of class/mod connections. Contextual information like that will have a huge number of exceptions and special cases, the main goal here was to have it reach the base spell to populate the entry for the GM, who can think contextually. That's why metas are done in the way they are.

Ken L
December 30th, 2017, 16:38
Update 1.75: Bug fix of 1.7
- Fixed Subscript/Superscript bug where if a spell name had subscripts it didn't strip them off properly to get at the base spell name. Some may have noticed that if the spell had UM/APG/UC/UI or some odd it wouldn't "find" the spell. This is what was up.
- Fixed Unnecessary retries removed for XML look up. Prior if a spell name didn't exist it would exhaust all 5 'safe' retries before giving up. This was due to a naming error on the escape condition. This would have made loading NPCs with multiple unknown spells process slower.
- Changed Psychic magic will now use the 'Psionic' caster type as I forgot FG has this casting class. It will sum all 'pools' of 'Psychic Magic' together into a singular pool. A vast majority of creatures with psychic magic only have 1 PE pool to cast from (ie 27 PE -- <various spells here>) but in-case there is the rare dual or multi-pool Psychic Magic user, then it will simply sum their pools together. Each spell will have the appropriate PE cost per cast so FG will tally up PE use.

See the Git Hub for the freshest update.

Ken L
December 31st, 2017, 21:58
Update 1.76: Bug fix of 1.7 (Spontaneous Sorcerers)
- Fixed There was an error if it parsed a sorcerer if it had any 0th level or 'at-will' spells. This is mainly due to a change in piping for counting spells-per-level that was needed for psionics. Didn't realize it broke an earlier behavior. This small fix resolves it.

Given this hidden bug, If there any other bugs, drop a message and I can take a look at it next weekend. I've run a good amount of the beastiary 5/6 heavy casters through it now, but given the piping change, it may act up, mainly for casters with strange layouts.

See the Git Hub for the freshest update.

Bidmaron
January 1st, 2018, 18:39
Man, KenL, thanks a lot....

Tash
February 2nd, 2018, 20:36
New to FG and extensions

I can't make this work... how do you "rename the .zip extension to a .ext, and put it in your extension folder" ?

LordEntrails
February 2nd, 2018, 21:10
New to FG and extensions

I can't make this work... how do you "rename the .zip extension to a .ext, and put it in your extension folder" ?
Welcome!

I'm guessing that file extensions are not being shown in your Windows Explorer? To turn on their display, (depending upon your version of Windows) you will want to want to uncheck the Folder Options (typically found in the View menu) that says something like "Hide extensions for known file types".

You will then see the extensions on your files, and this one will be something like extension.zip, just do a right mouse rename and change it to .mod.

To find your extensions folder, start FG, in the corner is a folder icon, click it, this will open up your FG Data folder, inside of their will be a folder (create it if needed) called "extensions". Just move the folder into their, exit and restart FG.

Tash
February 3rd, 2018, 13:47
Thanks for quick reply LordEntrails. I can now change the zip to .ext. I end up with a CreatureGen.ext file of 40 KB in the FG extension folder by following this steps.. "just download the repository as a zip, extract the folder 'CreatureGen-master' , rename it 'CreatureGen', re-zip just that folder (not the outer), rename the .zip extension to a .ext, and put it in your extension folder)" but it's not working :(

Erin Righ
February 3rd, 2018, 15:10
You have to make sure there are no subdirectories before the extension.xml file in the zip file, when you dload the zip it creates a zip file with a directory of CreatureGen-Master, you have to unzip that directory and zip it up again without the directory structure by selecting all files and folders in that directory and adding them to a zip by right clicking and selecting send to > Compressed (zipped) folder called CreatureGen.zip and renaming THAT zip file to .ext and move it into your extensions directory

Tash
February 3rd, 2018, 16:03
thanks Erin it is working now.. but only for PFRPG :/

LordEntrails
February 3rd, 2018, 21:20
thanks Erin it is working now.. but only for PFRPG :/
Is it supposed to work for anything but PF? I haven't read the first post, but I suspect it was written to only be used with PF...

damned
February 4th, 2018, 01:42
thanks Erin it is working now.. but only for PFRPG :/

It is a CreatureGen Import for Pathfinder....

Tash
February 4th, 2018, 12:29
It would be awesome if it also worked for 3.5E..

Bidmaron
February 4th, 2018, 13:20
Tash, you may find that this won’t be the last time you say that about something. It might be worth considering moving to Pathfinder. When I am at my computer I will try to find a link describing the minor differences.

Nylanfs
February 4th, 2018, 15:26
This is the best list of changes.

https://rpg.stackexchange.com/questions/1/differences-between-dd-3-5-and-pathfinder

Ken L
February 5th, 2018, 04:53
You're free to modify the script to work for 3.5 Tash. I won't as I don't actively use 3.5 nor do I have the familiarity or willingness to cover the special cases for it.

You'll first need to change the extension.xml to the 3.5 ruelset as it currently only registers for PF. Next you'll have to go through each of the parse functions to make the necessary adjustments. They should be minor given how the PF ruleset is pretty much a minor layer over the 3.5. It does require a little bit of monkey wrenching on your part. The workshop stickies should have information of how to edit extensions and such if you're willing to do this for yourself.

damned
February 5th, 2018, 05:19
As Ken L has posted the code in GitHub and given you the ok you can go Fork the code and massage it into a 3.5E friendly version...
https://github.com/FGKenL/CreatureGen
Do check in the repository in case Ken L has written any specific restrictions/requirements and have fun!

Erin Righ
February 6th, 2018, 01:53
Tash, you may find that this won’t be the last time you say that about something. It might be worth considering moving to Pathfinder. When I am at my computer I will try to find a link describing the minor differences.

I'm with Bid on this, I stayed with 3.5 until last year, and worked my last Campaign with FG for 3.5 but then I switched to PF last year, and I think the system is great, I have never looked back and haven't opened a 3.5 book in over a year. My wife still won't let me sell them however

Bidmaron
February 6th, 2018, 03:04
I have a butt-ton of 3.5 material, and I still use a lot of it. I am slowly buying the digital 3.5 library from DTRPG since it is so compatible (buy one book a month). I have the hard copies of everything, but it is such a pain to try to scan and OCR.

Tash
February 15th, 2018, 21:30
Thanks Ken L and damned but I have no idea how to convert the file to work in 3.5E since I don't have the skills. And you are probably right I just need to convince my party to change to Pathfinder or 5E. I appreciate the extensions you guys have made especially the Universal Module it's a life saver.

darthmask
February 22nd, 2018, 21:06
Ken L. It is SO good to see that you have made this for FG. I am currently the process of making the switch from roll20 (where I used your CGEN API plugin religiously) and the biggest thing I was dreading was having to create my NPCs from scratch again. Also this extension is very, very clean and easy to use so props!!!

However, I am currently attempting to import the attached statblock (with your spell library module loaded) and I am getting no spells in the spells section of the NPC that it creates. I am also attaching the log that is created on generation of the NPC (which isn't throwing any errors that I can see). I grabbed this statblock from a Paizo Iron Gods AP PDF (legally obtained and paid for...totally worth it) and everything else is parsing perfectly (after the obvious OCR fixes and alignment)...just the spells aren't which seems weird.

Any assistance would be appreciated. I obviously can still make serious use of this extension (and I plan to) but I would like to see about fixing this if possible.

EDIT: I forgot to mention that the CGEN does actually create the spellclass entries for the sorcerer spells known and spell-like abilities, however they are empty.

EDIT2: Hmm, on a whim I decided to grab a different spontaneous spellcaster from the PRD to ensure there wasn't an issue with my installation and it imported just fine so something tells me I may be missing an OCR error...but if so I can't see it...

KevenSimmons
February 22nd, 2018, 23:49
Hey Darthmask,
The separator after the "(#/day)" needs to be a double-dash, or the "long-dash" character (not sure what it is called). For example, either of these should parse correctly.

4th (5/day)--fire shield, freedom of movement, phantasmal killer (DC 18)
3rd (7/day)—fly, protection from energy, slow (DC 17), vampiric touch

Ken L
February 25th, 2018, 12:14
Keven looks to be correct here. The attached log is only showing level zero though. You could tick log level 3 or 4 as those tend to show some details about spell parsing (4 more for spell library lookup, 3 for only parsing). Either way from the statblock, it's an OCR copy paste difference. FG has a strange unicode format that Keven helped me debug earlier so I replace the long-dash with a double minus along with other pre-processing before the actual parse begins.

To be honest, Smiteworks should really look into UTF-8 support rather than sticking with iso-8859-1,

darthmask
February 26th, 2018, 03:22
Ye gods I agree...UTF-8 is almost universal now...but hey, I'm not a programmer, just a lowly DBA/database designer :P

anyway, that did in fact fix it for me. Would a double-minus work on the import statblock? That would be easier for me since my keyboard doesn't have the em-dash available as a single key and I can't remember the alt code all the time so I have to do a lot of character selection...

Ken L
February 26th, 2018, 21:10
Ye gods I agree...UTF-8 is almost universal now...but hey, I'm not a programmer, just a lowly DBA/database designer :P

anyway, that did in fact fix it for me. Would a double-minus work on the import statblock? That would be easier for me since my keyboard doesn't have the em-dash available as a single key and I can't remember the alt code all the time so I have to do a lot of character selection...

The pre-processor just substitutes the entity groupings that FG spits out into characters it can deal with.

Here's the list of subsitutions (https://github.com/FGKenL/CreatureGen/blob/master/cgen/lua/creaturegen.lua#L2219)

So "--" is literally what is substituted for the long dash and is safe to use, also it's unicode so unless you have a unicode keyboard, that's an alt+# thing.

KevenSimmons
February 27th, 2018, 11:37
I don't think I have ever seen a more accurate use of the word "literally" than when describing a literal :)

darthmask
February 27th, 2018, 15:02
Perfect, thanks guys. Also, I love the programmer humor.

Blackfoot
March 4th, 2018, 17:59
There is an issue with the concentration checks for casters created by the extension .. it doesn't set the caster stat (probably because it has no way to know what that is) and ends up adding a bonus for concentration that is too high... it probably should at least subtract out the caster level from the number in the stat block.. I'm not sure what it can do to figure the caster stat. You could pull it from a list.. but there are exceptions that would still make it wrong.

Ken L
March 6th, 2018, 01:22
I have no desire to maintain a class index to correct or check for correct levels of X class to resolve this issue. The spell section is there primarily to be populated with prepared uses and available casts, it's even noted earlier that the spell population CLs or DCs may be wrong as I rely on the 3.5 spell manager to perform the spell parse. In the grand scheme of things it's a minor piece of information that can be corrected post parse, especially as it already does a vast majority of the heavy lifting.

If you feel you're up to task, the script is all open source so you can freely edit and modify it.

Update 1.79: Case correction
- Fixed: Case sensitivity for 'At will' as 'At Will' was not being picked up. Case sensitivity remains in some of the parse logic as it remains a distinguishing feature to find labeled sections of the stat-block to differentiate it from similar text in descriptions or abilities.

See the git hub for the freshest update.

Blackfoot
March 6th, 2018, 03:21
Just reporting a bug here.
You are probably better off not putting anything into the Concentration box. Most of the time (unless the caster has some sort of special trait or feat) the 0 value in concentration will be correct.

Sam Elmore
November 4th, 2018, 20:26
Hello! Very newbie trying to install this extension on a Mac with a universal license running a 3.5e game. I think I got it set up correctly in the extensions folder but I'm not seeing it load into the program when I open up the program. What have I done wrong or will it only work while running a Pathfinder session? Thanks in advance for any and all suggestions!

Ken L
November 4th, 2018, 20:42
@Sam, just check the extension as on prior to loading your campaign. Note this is only for the PFRPG ruleset, not 3.5.

Sam Elmore
November 4th, 2018, 20:47
Hmmm, not showing up in my extension list prior to loading the campaign. I can see Theme Dungeon, Theme Simple Brown, Theme Simple Grey, and Wood but not CreatureGen...but doesn't matter if it won't work with a 3.5e campaign since that is what I'm running...any chance of it being tweaked to run a 3.5e character? Or even how I might tweak it to do that if I get it up and running?

Ken L
November 5th, 2018, 03:29
Did you extract it properly? You can skip the whole zip part and just drop the creature-gen-master folder in your /extensions folder uncompressed.

Sam Elmore
November 5th, 2018, 09:21
Must have done something wrong the first time...reloaded it and it shows up now in the PFRPG ruleset :) Too bad I'm running 3.5 :( Is there any way for me to make it work for 3.5? Probably not since I'm on a mac but felt it couldn't hurt to ask :)

LordEntrails
November 5th, 2018, 16:27
You can change the ruleset tag in the extension. But, doesn't mean it will actually work without you adjusting the code, but it does mean you can load the extension in a 3.5 campaign.

Nylanfs
November 5th, 2018, 17:33
It should' there isn't that much difference between the statblocks (depending on which one you talk aboit, Paizo has 5 different ones that I'm aware of.)

Sam Elmore
November 5th, 2018, 19:43
Thanks everyone for the help and suggestions! Got it up and running and have imported my first few characters into the 3.5 version! Works a treat :)

Nylanfs
November 5th, 2018, 22:24
Yea!

damned
December 26th, 2018, 00:00
If anyone has a copy of this can they please upload here including any accompanying license notices.

Dark_Soul
December 26th, 2018, 00:39
If anyone has a copy of this can they please upload here including any accompanying license notices.

Got it from GitHub on 12/12/2018

damned
December 26th, 2018, 01:03
Thanks Dark_Soul

https://github.com/fg-damned/KenL-CreatureGen-PF

MMOaddicted
December 26th, 2018, 06:55
Huh, whatever happened to the original creator if I may know? I was about to write a thank you note to him on here...

damned
December 26th, 2018, 07:13
Huh, whatever happened to the original creator if I may know? I was about to write a thank you note to him on here...

You can still write him and hopefully he will receive the message.
Ken L has an issue with the FG licensing agreement and decided to stop developing on/for FG.

dellanx
April 12th, 2019, 03:01
Any Idea if this wonderful extension will work with Unity?

Zacchaeus
April 12th, 2019, 10:40
Any Idea if this wonderful extension will work with Unity?

All existing content, including extensions should work with Unity

dellanx
April 13th, 2019, 00:05
All existing content, including extensions should work with Unity

Wonderful!!! Thanks!

Moon Wizard
December 28th, 2019, 02:40
Here is a slightly updated version that will work in FGU. It seems that CGEN looks for line breaks specifically between paragraph tags. The new XML serialization engine can't selectively write some tags with and some tags without as the FGC serialization did (without us writing our own complete serialization routines). Instead, I added a string:gsub to add a line break between <p> tags when running FGU; and that seems to fix the issue.

Please update the GitHub, first post, and other posts as needed.

Regards,
JPG

rakshasa
May 21st, 2020, 23:33
just bought it for the npc factory, there is no column icon on side bar. i've activated the module at startup and made sure it was loaded in the library. using unity.

Mortar
May 21st, 2020, 23:58
Click the NPCs button on the sidebar. At the top of the NPCs window the opens (left side iirc) there will be a button that is labeled "CGen"...click that. Been a long time since I have looked at this extension.

TheKurstOne
August 3rd, 2020, 20:20
Does this still work for Classic and Unity?

I would like to add it to my PF1e Game.

Thank you

dellanx
August 4th, 2020, 15:50
Does this still work for Classic and Unity?

I would like to add it to my PF1e Game.

Thank you

I believe so, but look here (https://www.fantasygrounds.com/forums/showthread.php?34199-CreatureGen-Extension-Import-Stat-blocks-on-the-fly-with-populated-spells/page21).

RobboNJ69
September 16th, 2020, 21:14
Is this still working for everyone? It was working for me a month or two ago, but now when I import the spells are not entered.

I tried importing this NPC from:
https://www.thegm.org/npcs_display.php?selected_npc=111

Everything else imported fine.

I Re-downloaded and disabled all other extensions and tried with no success.

Using PF 1st ed., updated FG (original) today. All the spell book modules are on. (Farnaby's, PFRPG Archive Spells, PFRPG Spells & PFSRD Complete Paizo Spells)

Thanks!

KevenSimmons
September 17th, 2020, 12:16
Is this still working for everyone? It was working for me a month or two ago, but now when I import the spells are not entered.

I tried importing this NPC from:
https://www.thegm.org/npcs_display.php?selected_npc=111

Everything else imported fine.

I Re-downloaded and disabled all other extensions and tried with no success.

Using PF 1st ed., updated FG (original) today. All the spell book modules are on. (Farnaby's, PFRPG Archive Spells, PFRPG Spells & PFSRD Complete Paizo Spells)

Thanks!

Something has changed in FG because the spells do not populate for me either - however: I ran into this issue early on when the extension was posted and the root cause was the character strings being looked for as a delimiter in the spell level listing. The work-around at the time, and one that still works now is to replace the "long-dash" after the spell level heading to a double-hyphen (minus sign):

Change this: 2nd (5/day)—detect thoughts (DC 16), invisibility, minor image (DC 16)
To This: 2nd (5/day) -- detect thoughts (DC 16), invisibility, minor image (DC 16)

RobboNJ69
October 27th, 2020, 13:27
Change this: 2nd (5/day)—detect thoughts (DC 16), invisibility, minor image (DC 16)
To This: 2nd (5/day) -- detect thoughts (DC 16), invisibility, minor image (DC 16)

I guess I didn't select the box to be notified on a reply. I just saw your response now. Thank you for that, I'll give that a try tonight.

Corun
February 8th, 2021, 20:11
I've created a MR/PR on damned's repo with quick fixes to this spell issue(and penalty dash used on AoN causing weird values):
https://github.com/fg-damned/KenL-CreatureGen-PF/pull/1/files
Also includes fixes by Moon Wizard.

RobboNJ69
February 9th, 2021, 01:00
Anyone else seeing this error:
Error while parsing Preliminary: [string "cgen/lua/creaturegen.lua"]:1070: No DEFENSE tag found

All other extensions off. 1Ed Pathfinder, FGU. Downloaded the version from the 27th labeled for Unity.
Thanks!

Corun
February 9th, 2021, 16:40
Anyone else seeing this error:
Error while parsing Preliminary: [string "cgen/lua/creaturegen.lua"]:1070: No DEFENSE tag found

All other extensions off. 1Ed Pathfinder, FGU. Downloaded the version from the 27th labeled for Unity.
Thanks!

This version of extension is for various reasons very picky about amount of empty lines before/after DEFENSE(bold part in quote) text. Try removing them and it should help.


Init +12; Senses Perception +26

DEFENSE

AC 36, touch 19, flat-footed 27 (+4 armor, +8 Dex, +1 dodge, +9 natural, +4 shield)


It might yell later about hp not being present or other tag. In that case there is chance that some typo or letter casing mismatch(example 'HP' instead of 'hp').

Probably the reason this happen is that you copy some invisible tag in text and as author rips value straight of the input(instead of asking for nice text). This leaves tag which then confuses CreatureGen.

I think after my fixes to spell issue it should be improved, so you can check if after my fixes it works better:
https://github.com/Corun-Kail/KenL-CreatureGen-PF/releases/tag/v1.82-alpha

RobboNJ69
February 9th, 2021, 17:50
I think after my fixes to spell issue it should be improved, so you can check if after my fixes it works better:
https://github.com/Corun-Kail/KenL-CreatureGen-PF/releases/tag/v1.82-alpha

Thank you very much! I should be able to try shortly.

RobboNJ69
February 16th, 2021, 20:40
Thanks, Corun! That did it. I'm going to open it up and see if I can figure out how to use the PFRPG - Spellbook by Farnaby/Tanor, instead of the PFRPG Archive Spells one. This will save from needing two spell mods.

KevenSimmons
February 16th, 2021, 20:56
Thanks, Corun! That did it. I'm going to open it up and see if I can figure out how to use the PFRPG - Spellbook by Farnaby/Tanor, instead of the PFRPG Archive Spells one. This will save from needing two spell mods.

That would be awesome Robbo !

Corun
February 16th, 2021, 22:13
I've considered implementing it, but for my purposes this extension was sufficient(however it does not fill descriptions):
PFRPG Upgrade NPC Actions (https://www.fantasygrounds.com/forums/showthread.php?63620-PFRPG-Upgrade-NPC-Actions-Extension)
I've skipped loading PFRPG Archive Spells completely, and it just created empty spells and single warning in chat. Empty spells then are upgraded by Upgrade NPC Actions to use PFRPG - Spellbook.


Library is set in lua/creature_gen.lua at line 74. This should be easy to replace. However there might be problem with [Y] tag that exists in PFRPG - Spellbook(at least in version by dllewell), and writing additional parser logic to replicate what Upgrade NPC Actions already provides made it not really worth it for me.

EDIT:
Maybe I will take a look on this, as missing descriptions can be annoying.

KevenSimmons
February 16th, 2021, 23:19
I’ve previously tried replacing the library reference, but it can’t find the spells even when the names seem to match exactly. I didn’t dig any further into figuring out why.

bmos
February 18th, 2021, 12:13
I've considered implementing it, but for my purposes this extension was sufficient(however it does not fill descriptions):
PFRPG Upgrade NPC Actions (https://www.fantasygrounds.com/forums/showthread.php?63620-PFRPG-Upgrade-NPC-Actions-Extension)
I've skipped loading PFRPG Archive Spells completely, and it just created empty spells and single warning in chat. Empty spells then are upgraded by Upgrade NPC Actions to use PFRPG - Spellbook.I never thought about using it in that manner! Neat!
I could push an update to PFRPG Upgrade NPC Actions (https://www.fantasygrounds.com/forums/showthread.php?63620-PFRPG-Upgrade-NPC-Actions-Extension) so that it does descriptions, but are you also using PFRPG Spell Formatting (https://www.fantasygrounds.com/forums/showthread.php?60120-PFRPG-Spell-Description-Formatting)? I think it might already 'patch' that issue, because when you open a spell for the first time that has no fully-formatted description, it auto-populates it with the description from the PFRPG Spellbook (https://www.fantasygrounds.com/forums/showthread.php?58962-PFRPG-Spellbook) module.

Corun
February 18th, 2021, 17:09
I've just tested it on v1.4. Spell formatting extension works when I manually drag and drop spells from libraries. When using Upgrade NPC Actions it does not trigger, and descriptions remain unchanged.

bmos
February 18th, 2021, 18:53
I've just tested it on v1.4. Spell formatting extension works when I manually drag and drop spells from libraries. When using Upgrade NPC Actions it does not trigger, and descriptions remain unchanged.
To confirm, you had the PFRPG Spellbook loaded?

Here is a test build I just made which searches PFRPG - Spellbook for any missing descriptions.

EDIT: removed in prep for real release

Corun
February 18th, 2021, 19:16
Yep, PFRPG - Spellbook was loaded, as Upgrade NPC Actions managed to add actions.

Test build works: (hope it renders, cause I am not sure ATTACH is the right tag for this, but advanced post GUI says otherwise) 43912

Obviously there is one more can of worms - remaining fields still need to be populated in the spell description, but I could have communicated this more clearly. Probably also outside of your extensions.

bmos
March 3rd, 2021, 21:03
I’ve previously tried replacing the library reference, but it can’t find the spells even when the names seem to match exactly. I didn’t dig any further into figuring out why.This should help (https://github.com/bmos/FG-PFRPG-Upgrade-NPC-Actions/blob/main/scripts/upgradespells.lua#L68).


there is one more can of worms - remaining fields still need to be populated in the spell description, but I could have communicated this more clearly. Probably also outside of your extensions.try this

EDIT: removed in prep for real release

Corun
March 3rd, 2021, 22:19
This should help (https://github.com/bmos/FG-PFRPG-Upgrade-NPC-Actions/blob/main/scripts/upgradespells.lua#L68).

try this
Thank you very much, works great.
I've tested this on https://aonprd.com/NPCDisplay.aspx?ItemName=Winter%20Witch%20Cold%20S ister NPC and it's all okay.
For other users I might want to mention that one has to remove all APG/UM etc. suffixes, but this is very minor thing, and can be done in notepad in matter of few seconds.

bmos
March 3rd, 2021, 22:42
Thank you very much, works great.
I've tested this on https://aonprd.com/NPCDisplay.aspx?ItemName=Winter%20Witch%20Cold%20S ister NPC and it's all okay.
For other users I might want to mention that one has to remove all APG/UM etc. suffixes, but this is very minor thing, and can be done in notepad in matter of few seconds.I can set it up to ignore that part in searching for the spell.
APG, ARG, UM... what am I missing?

EDIT: here is v1.7 (https://github.com/bmos/FG-PFRPG-Upgrade-NPC-Actions/releases/tag/v1.7) for public release. It skips only those three book abbreviations.

Corun
March 3rd, 2021, 22:56
I can set it up to ignore that part in searching for the spell.
APG, ARG, UM... what am I missing?
This is actually hard question, as there is huge potential for the sources of such things:
Hardcovers include:
Advanced Class Guide(ACG?) Horror Adventures(HA?), Monster/NPC/Villain Codex, Ultimate Wilderness(UW), Ultimate Intrigue(UI), Ultimate Combat?(UC). Mythic Adventures, Occult Adventures.

Planar adventures was quite late in development so probably can be skipped.
I am not aware if there exists comprehensive list of shortcuts.

Probably companion books such as Adventurers Armory 1/2(I saw stat block with AA2 spell I think, but could have confused with other edition), Campaign Settings. Book of the damned had it's own shortcut afair. Somewhere. Or maybe I am wrong.


Ah and Adventures Paths can refer to previous books in the series:D, but I've just checked and at least in Reign of Winter standard is to use * instead of shortcut.
I will do some googling and possibly try to compile some master list. Might take a while.

Final list based on https://docs.google.com/spreadsheets/d/1NK8JlpDYZSYtAH-Tumu8X0nlx99PsL1ddvhhVQIdY8c/edit#gid=0:

Abbreviation - Book
UM - Ultimate Magic
APG - Advanced Players Guide
OA - Occult Adventures
UI - Ultimate Intrigue
ISWG - Inner Sea World Guide
UW - Ultimate Wilderness
ARG - Advanced Race Guide
HA - Horror Adventures
UC - Ultimate Combat
MA - Mythic Adventures
ACG - Advanced Class Guide
AP75 - Adventure path #75, exists only once in this excel so might be problem with excel.
MC - Monster Codex
D - Domain
M - Mythic variant of a spell

KevenSimmons
March 4th, 2021, 23:32
{deleted}

tahl_liadon
April 17th, 2021, 15:49
.
can anyone help me figure out this extension...

i reviewed this thread up to post #215 (October 27th, 2020, 08:27 #215 - RobboNJ69, which was a reply to #214).

then i think after post #215, it switched to another topic, about another extension? (i'm so confused lol)

anyway, i was able to get the extension to populate spells, but the feedback in chat dialog is that it cannot match any spells from the spellbook (i.e. PFRPG - Spellbook).
as a result, it just populated spells with exact names from my imported text, and no spells' stats that would be included if dragged from PFRPG - Spellbook.

thx

bmos
April 17th, 2021, 17:03
.
can anyone help me figure out this extension...

i reviewed this thread up to post #215 (October 27th, 2020, 08:27 #215 - RobboNJ69, which was a reply to #214).

then i think after post #215, it switched to another topic, about another extension? (i'm so confused lol)

anyway, i was able to get the extension to populate spells, but the feedback in chat dialog is that it cannot match any spells from the spellbook (i.e. PFRPG - Spellbook).
as a result, it just populated spells with exact names from my imported text, and no spells' stats that would be included if dragged from PFRPG - Spellbook.

thx

Post 216 is talking about the same extension, but Corun made a new version that fixes some issues with Unity.
https://github.com/Corun-Kail/KenL-CreatureGen-PF/releases/tag/v1.82-alpha

It's the same extension, but Corun's 'version'.

Then I chimed in because Corun mentioned using my extension to fill the spell details. #224-231 include some discussion about a patch I made to my Upgrade NPC Actions extension to help with Corun's usecase.
This part probably should have been had in my thread.

KevenSimmons
April 17th, 2021, 17:04
My experience has been that the CreatureGen extension will only populate spell data from the "PFRGP Archive Spells" module.

bmos
April 17th, 2021, 17:56
My experience has been that the CreatureGen extension will only populate spell data from the "PFRGP Archive Spells" module.This is correct. You can use my extension after the fact to add automation from PFRPG - Spellbook, but this extension requires the module that KevenSimmons attached.

tahl_liadon
April 17th, 2021, 18:04
.
thx much @KevenSimmons & @bmos for the short-handed version clarification.

there are so many moving parts and extensions (and i do appreciate all the efforts from community members in making them)... it makes my head hurt X-D

i think i will simplify my life and stick with manually adding spells from the farnaby mod.

RobboNJ69
April 30th, 2021, 14:37
Hello,
Any one else getting an error message with the Creature Generator?

"Error when populating character record: [string "cgen/lua/creaturegen.lua"]:726: attempt to index field 'prepared' (a userdata value)"

I'm using the new version Corun uploaded
https://github.com/Corun-Kail/KenL-CreatureGen-PF/releases/tag/v1.82-alpha

Is this not the correct version to use? Thanks!

Corun
April 30th, 2021, 15:04
Hello,
Any one else getting an error message with the Creature Generator?

"Error when populating character record: [string "cgen/lua/creaturegen.lua"]:726: attempt to index field 'prepared' (a userdata value)"

I'm using the new version Corun uploaded
https://github.com/Corun-Kail/KenL-CreatureGen-PF/releases/tag/v1.82-alpha

Is this not the correct version to use? Thanks!

My version is just a bug fix for most recent version of this extension :P

What other extensions do you use with this? Could you provide me with monster statblock that has this problem?

RobboNJ69
April 30th, 2021, 15:18
Hey Corun,
Sorry for the sloppy post. I should have tried it with out the other extensions...

It was doing it with any spell caster from either the official SRD or d20PFSRD.

I disabled all other extensions and it is working, though it doesn't find some domain abilities (no biggie on that).

I'll go through and methodically turn on the others to figure out where the issue is. Thanks for the fast reply.

RobboNJ69
April 30th, 2021, 15:30
Well... that was easier than I thought. I started with "PFRPG Upgrade NPC Actions" since it deals with 'npc actions' (I know, crazy, right?)

That was it. I'll post this on that thread. Thanks Again!