PDA

View Full Version : Module Maker



Ikael
April 3rd, 2023, 20:47
Extension for any CoreRPG based rulesets that allow creating library modules using lightweight markdown language. The extension is available via Forge (https://forge.fantasygrounds.com/shop/items/1144/view)
Use this thread of discuss topics regarding the extension and report discovered issues.

This feature have been used to create official Savage Worlds modules such as Savage Worlds Adventure Edition, Deadlands: The Weird West, Savage Pathfinder and more but now the feature is available for any other CoreRPG based rulesets!

Start guide for beginners


Get the Forge item
Install Sublime Text (https://www.sublimetext.com/) editor (because there is markdown syntax highlight support for it)
Get the Module Maker Markdown Language (M3L) syntax file (https://bitbucket.org/aheikkinen/module-maker/raw/52cd6b8b80aa429390c9a04c886366073c188ffe/docs/05-M3L-example.txt) for Sublime Text editor
Go through documentation to learn the markdown



Markdown Basics (https://bitbucket.org/aheikkinen/module-maker/raw/52cd6b8b80aa429390c9a04c886366073c188ffe/docs/01-M3L-basics.txt)
Markdown Levels (https://bitbucket.org/aheikkinen/module-maker/raw/52cd6b8b80aa429390c9a04c886366073c188ffe/docs/02-M3L-levels.txt)
Attributes (https://bitbucket.org/aheikkinen/module-maker/raw/52cd6b8b80aa429390c9a04c886366073c188ffe/docs/03-M3L-attributes.txt)
Special Attributes (https://bitbucket.org/aheikkinen/module-maker/raw/52cd6b8b80aa429390c9a04c886366073c188ffe/docs/04-M3L-special-attributes.txt)
Reference Sheet (https://bitbucket.org/aheikkinen/module-maker/raw/52cd6b8b80aa429390c9a04c886366073c188ffe/docs/00-reference.md)


Convert PDF into M3L

Follow instructions in Forge (https://forge.fantasygrounds.com/shop/items/1144/view)

macDsinfo
April 3rd, 2023, 22:34
thanks for this; like I mentioned on discord, your update this am worked like a charm. is there a difference between /flushdb and /module flush?

damned
April 3rd, 2023, 22:42
Well done Ikael

Ikael
April 4th, 2023, 07:20
is there a difference between /flushdb and /module flush?

Yes,


/flushdb -- CoreRPG feature which resets database ownership
/module flush -- Module Maker feature which removes orphan database resources from generated library modules within your campaign database.

This flush is done automatically whenever you launch Fantasy Grounds session but this slash command allow you to run clean up manually

FrodoB
April 13th, 2023, 10:23
I got curious and randomly loaded a few rulesets to see how Module Maker handles, say, a Pathfinder NPC record. And I have to say: Marvelously!

However, I ran into a snack with OSR2:

Every NPC has notes, these are stored in an XML tag like this:


<notes type="formattedtext">
Some text about the NPC.
</notes>

If I enter it like this in M3L, everything works fine:



@@notes::"""
Some text about the NPC.
"""


However, when I use the exporter, it generates this Markdown:


###The Name of the NPC

Some text about the NPC

@@alignment_dropdown::Any
...


And when creating an NPC from this, the notes-tag is empty, but instead it creates this tag (which does nothing in the actual campaign):


<text type="formattedtext">
Some text about the NPC.
</text>


I'm not sure if this is an OSR specific thing or if there is special treatment in the Module Maker code for the "notes"-Tag, but this might show up in other rulesets as well.

Ikael
April 13th, 2023, 13:36
I got curious and randomly loaded a few rulesets to see how Module Maker handles, say, a Pathfinder NPC record. And I have to say: Marvelously!

However, I ran into a snack with OSR2:

Every NPC has notes, these are stored in an XML tag like this:


<notes type="formattedtext">
Some text about the NPC.
</notes>

If I enter it like this in M3L, everything works fine:



@@notes::"""
Some text about the NPC.
"""


However, when I use the exporter, it generates this Markdown:


###The Name of the NPC

Some text about the NPC

@@alignment_dropdown::Any
...


And when creating an NPC from this, the notes-tag is empty, but instead it creates this tag (which does nothing in the actual campaign):


<text type="formattedtext">
Some text about the NPC.
</text>


I'm not sure if this is an OSR specific thing or if there is special treatment in the Module Maker code for the "notes"-Tag, but this might show up in other rulesets as well.

This is because in CoreRPG NPC's description is stored in text field and OSR has overriden that to notes. Module Maker can be taught to respect different record schemas which would resolve the issue. So far I have added SavageWorlds, 5E, Pathfinder 2e and CoreRPG schemas. I can add OSR schema as well especially regarding NPC "notes" but I do not have the ruleset so I don't know if there is something else different.

You can find supported schemas from here https://bitbucket.org/aheikkinen/module-maker/src/main/extensions/Module%20Maker/data/

FrodoB
April 13th, 2023, 14:24
Thanks for the quick answer!
I'm a dingus and wrote "OSR" when I meant to write "OSE". Honestly, I just randomly picked a few rulesets I had to check it out and did not notice that OSE is not included in baseline FGU, but that I got it from the Forge (https://forge.fantasygrounds.com/shop/items/199/view). Know how to approach it the next time I use MM with another ruleset and something doesn't show up, thanks!

EDIT: Wrote OSR instead of OSE again, fml

Ikael
April 13th, 2023, 15:56
OSE2 ruleset data support added in Module Maker v0.7.1. This includes new records such as Races, Magic, Classes and Skills. In addition npc and item record sheet used different field for description.

Ikael
April 14th, 2023, 20:59
Module Maker v0.8.0 released in test channel. This update introduces new slash command:

/schema analyze

It will analyze if ruleset defined records are currently supported by Module Maker and will report issues and propose LUA code how to fix it.

Ikael
April 25th, 2023, 15:21
I have provided Google Apps Script which can convert content in Google Document into M3L. You could use this to convert PDF content into Fantasy Grounds reference manual -- all you need to do is to identify and provide few information about the PDF for the script and run it.

Read more about this feature from the first post.

Jiminimonka
April 25th, 2023, 17:01
Gonna test this Google script tonight!

Ikael
April 25th, 2023, 21:51
Beta testing is finally over and the first live release of Module Maker is finally here (https://forge.fantasygrounds.com/shop/items/1144/view)!

YggBjorn
April 27th, 2023, 09:48
Hello!

I grabbed this from the Forge and updated my FGU (v4.3.8 ULTIMATE 2023-04-25). I had the deprecated SW Maker_v2.0.1.ext in my extensions folder but have since removed it. Perusing the extension folder I don't see anything that looks like Module Maker. Does it install into the extensions folder like the deprecated version did? I grabbed a few other things and they all seem to have updated and appear in my extensions folder.

Any help is appreciated and thank you for your time!

Jiminimonka
April 27th, 2023, 09:52
Hello!

I grabbed this from the Forge and updated my FGU (v4.3.8 ULTIMATE 2023-04-25). I had the deprecated SW Maker_v2.0.1.ext in my extensions folder but have since removed it. Perusing the extension folder I don't see anything that looks like Module Maker. Does it install into the extensions folder like the deprecated version did? I grabbed a few other things and they all seem to have updated and appear in my extensions folder.

Any help is appreciated and thank you for your time!

Its in the vault.

In the extension list its called Module Maker

Jiminimonka
April 29th, 2023, 08:25
First post updated. Take a look.

Ikael
April 29th, 2023, 11:57
Instructions how to convert PDF content into M3L were streamlined. See the first post

celebrindal
May 19th, 2023, 17:53
What does it mean when you get script error with generator_module.lua:52 attempt to index local rRecordSet (a nil value). Thanks.

Using the /module make command after getting the document converted using the apps script?

P.S. do I have to manually go into the text file and add things like chapter, dice roll, dialog flags etc?

Jiminimonka
May 19th, 2023, 17:59
What does it mean when you get script error with generator_module.lua:52 attempt to index local rRecordSet (a nil value). Thanks.

Without context it means norhing :) Provide some details of what you were doing when ot happened

YggBjorn
May 31st, 2023, 21:44
Having an issue with Mundane Items. If I export the module with the rectangular export button, the items don't appear in the module. If I export the module from the blue export button then the Items do appear in the module. Is there a record reference for making Mundane Items?

The rest of the module exports as expected. I added the list of Items to a record at the end of the reference manual .m3l file. Here is a snippet of the code I am using for Mundane Items:

============================================
#### Mundane Item :: Scavenged Items
@@group::Scavenged Items

--------------------------------------------
### 50' Garden Hose
Medium Duty garden hose.

@@catname::Mundane Item
@@group::Scavenged Items
@@notes::
@@weight::#10

--------------------------------------------
### 50' Extension Cord
Medium Duty extension cord.

@@catname::Mundane Item
@@group::Scavenged Items
@@notes::
@@weight::#4

YggBjorn
June 14th, 2023, 05:43
With v4.4.0 released for FGU, it appears Module Maker is broken. I am getting an error whenever I open the Module window, some of the MM buttons are out of place (specifically the blue radial buttons), and the information from the M3L file I imported wasn't showing 90% of the text. The images came in just fine though.

https://www.fantasygrounds.com/forums/attachment.php?attachmentid=57708&stc=1&d=1686717682

https://www.fantasygrounds.com/forums/attachment.php?attachmentid=57709&stc=1&d=1686717689

Doswelk
June 14th, 2023, 07:37
Having an issue with Mundane Items. If I export the module with the rectangular export button, the items don't appear in the module. If I export the module from the blue export button then the Items do appear in the module. Is there a record reference for making Mundane Items?

The rest of the module exports as expected. I added the list of Items to a record at the end of the reference manual .m3l file. Here is a snippet of the code I am using for Mundane Items:

============================================
#### Mundane Item :: Scavenged Items
@@group::Scavenged Items

--------------------------------------------
### 50' Garden Hose
Medium Duty garden hose.

@@catname::Mundane Item
@@group::Scavenged Items
@@notes::
@@weight::#10

--------------------------------------------
### 50' Extension Cord
Medium Duty extension cord.

@@catname::Mundane Item
@@group::Scavenged Items
@@notes::
@@weight::#4

You need the @@catname entry not the @@group entry under #### Mundane Item :: Scavenged Items

Doswelk
June 14th, 2023, 07:38
I am getting the console error, the missing reference manual text was a hotfix released by MoonWizard.

Builder appears borked by update so not surprised that Maker is having issues.

Ikael
June 14th, 2023, 19:55
v1.0.7 update is available which makes it CoreRPG 4.4 compatible

YggBjorn
June 18th, 2023, 17:39
You need the @@catname entry not the @@group entry under #### Mundane Item :: Scavenged Items

That fixed it. Thanks!

hawkwind
September 4th, 2023, 13:18
i tried to convert a pdf following the steps on the forge and i got the following message. I can DM the google docs file if that helps

Stargrove
November 22nd, 2023, 18:01
I am not really a scripter/programmer and need help. I have a PDF with lots of things that need to be added to the remove section. How do I structure the script to add more than one at a time? Or do I just add one at a time and re-run the script? Also, there may be things I don't want to remove for a particular font size and some that I do.

For example:


10:40:17 AM Info Font size(s): 10 (NOT INCLUDED IN DEFINITIONS: 10)
Occurrences: 11876
Recommendation(s):
- This is probably body text. Add 10 to convert.content.bodyText.fontSizes
- Add following to convert.content.remove:
{
description: "Remove page numbers",
regex: "[\\d\\s]+",
fontSizes: [10],
apply: true
}
Examples:
- 2
- 04
- AKI
- 172
- THE LEGEND OF TWILIGHT’S PEAK
- 09
- RUNNING WITH THE WOLVES
- 200
- WHO AND WHAT WERE THE ANCIENTS?
- 14
- MERCEDES
- 214
- ANCIENTS HUNTING
- 17
- TWILIGHT’S PEAK
- 227
- OMICRON DIVISION
- 24
- TSYAMOYKYO, LEAST OF THE ANCIENTS
- 230



10:40:17 AM Info Font size(s): 14 (NOT INCLUDED IN DEFINITIONS: 14)
Occurrences: 857
Recommendation(s):
- If you want to remove these, add following to convert.content.remove:
{
description: "Remove unused",
content: ".*",
fontSizes: [14],
apply: true
}
Examples:
- A PACKAGE FROM SORREL
- ANCIENTS HUNTERS
- IN FLEETING MEMORIAM
- T R A V E L L E R
- HELL AT PERIHELION
- YUSOTE
- THE CONFERENCE OF AKI
- MERCEDES
- TWILIGHT’S PEAK
- INVOLVING THE TRAVELLERS
- REFEREEING THE CAMPAIGN
- T R A V E L L E R
- T R A V E L L E R
- PUBLICATION AND FOLLOWING
- THE REALITY
- T R A V E L L E R
- T R A V E L L E R
- T R A V E L L E R
- T R A V E L L E R
- T R A V E L L E R


I both of those examples there is info I want to keep and info I want to throw away.

Jiminimonka
November 22nd, 2023, 20:52
If you don't explicitly tell it to remove a certain font size it will not, the text will remain in the M3L code just it won't be "wrapped" in the syntax needed to make it appear in FG, so manual editing is required. Basically it comes down to practice but it does speed up the conversion time a great deal.

Jiminimonka
December 28th, 2023, 14:47
Making a module and used /markdown export builder with the fine but in need of editing reference manual - and the text generated by module maker when Preview is used generates this error (and the ref manual pages produced are empty or incorrect)


[12/28/2023 2:31:53 PM] [ERROR] windowcontrol: Database type mismatch on path (text) in control (header) in class (referencemanualtextblock)
[12/28/2023 2:31:53 PM] [ERROR] Script execution error: [string "CoreRPG:scripts/manager_referencemanual.lua"]:1343: attempt to index local 'cHeader' (a nil value)

I am running the latest version of everything.