Log in

View Full Version : Converting Notes into a Library Module?



Jingo
April 20th, 2016, 05:50
Hello fellow FG friends! Relative newbie here (been away from FG for several years...)

Anyway, I've been adding a bunch of RPG rules (from an Ars Magica Dungeon World Hak) into my campaign (ruleset is just a vanilla CoreRPG...) as a bunch of different Note entries.
After two days working on it, I now have a LARGE number of unwieldy notes. Hooray!

But now I'd like to organize them instead as a Library Module that the players can open.

How would I convert my notes into a format that I can export as a Library Module that my players can then access?

Is that even possible? From what I can see, if I do /export, Notes aren't even listed as an option.

I do have some xml/html experience, but if someone has some sort of converter or a better way, I'd love to do that first before mucking around in the code.

damned
April 20th, 2016, 08:36
Hi Jingo,
Notes are really intended as a player resource. They are generally made by players for themselves. As you note there is not even an export function.
Trenloe did write an extension to allow you to export notes.
Generally doing it as Story and exporting as a module and sharing that module with players would be how you would do this.

Jingo
April 21st, 2016, 07:16
Hi Damned. Thanks for pointing me in the right direction. I looked up one of Trenloe's threads and found what I needed.

The reason I went with "Notes" over "Story" is that the term "Story" seemed too specific for what's I expected should go in there. When I think of story entries, I think of encounter text, not Rules. So for rules, I thought Notes would be a better location. Ideally, and first, though, I went to Library and tried to manually add something there. That makes the most intuitive sense to me.

Anyway, after a fair bit of tweaking the db.xml, I've successfully converted my notes into Story Entries and from there Story Entries into a library module.

Here's what I did in case anyone else needs to do this:

First, I created a backup of my campaign folder.
Next, in Notepad++, I opened up db.xml and copied out the main <Notes></Notes> section into an placeholder Np++ file.
From this placeholder file, I removed the bounding <Notes></Notes> tags, so I was just looking at the innards.
Then I did find and replace on the innards so that they'd work inside of an <encounter></encounter> node:

I found and replaced instances of:

link class="notes"
with
link class="encounter"

recordname="notes.id
with
recordname="encounter.id


Inside db.xml, I then found the <encounter></encounter> node inside db.xml. Thankfully, it didn't have too many story entries there. Just a few. I copied the <encounter></encounter> section into its own Np++ placeholder file.
Then in the db.xml, I copied and pasted the reformatted note placeholder content into the <encounter></encounter> node.
Then I looked at the last id tag in my <encounter></encounter> node. It was <id-00173>.
Then in my encounter placeholder file, I made sure there ids there started with <id-00174> and incremented upwards.
Then I copied them back into the db.xml <encounter></encounter> node, after the previous encounters.
Finally, in db.xml, I removed the innards of the no-longer-necessary <notes></notes> node.


I did numerous restarts of the campaign to periodically test changes. I found that just doing /reload in the chat window wasn't enough and had to manually restart the campaign/software.

Then it was just a matter of exporting the story as a module into the library, enabling the module.... and viola! We have a library from notes! Thanks again.

Zacchaeus
April 21st, 2016, 09:02
Would it not have been easier just to copy the text in the notes and paste into story entries and then export?

damned
April 21st, 2016, 10:17
Hey Jingo that looks like a PbtA game... Which one?

Jingo
April 21st, 2016, 14:12
Would it not have been easier just to copy the text in the notes and paste into story entries and then export?

I had 173 notes. Copying and pasting those manually would have taken me much longer. If it were a short list then probably yes.

Jingo
April 21st, 2016, 14:15
Hey Jingo that looks like a PbtA game... Which one?

Hi Damned. It was from this list:
https://docs.google.com/spreadsheets/d/1whsN3C5e31CZfo8hqlJbiKTPBX9kkCDSEG_An9FlP5s/edit#gid=0

It's a free PDF called Wizard World (an Ars Magica inspired hak for Dungeon World). I've always loved the depth of Ars Magica (never really played it, just imagined it), but couldn't get around the overly complex and combat. So it seemed a good fit.

Jingo
April 21st, 2016, 20:02
Hey Damned or whomever knows, another question. I'm interested in trying my hand at creating a character sheet for this. Are there any video tutorials out there on how to create character sheets etc? I saw the Anatomy of Ruleset PDF from a wiki, but I'm wondering if there's something more up to date that shows via step by step videos how things work and fit together?

damned
April 22nd, 2016, 04:47
Have a look at the MoreCore extension. It adds a new Tab and a couple of new fields to the Char Sheet. It should give you some ideas how to proceed.
You can of course look at the 3.5e/4e/5e sheets too but they have so many more changes they may confuse...

Jingo
April 22nd, 2016, 23:58
Thanks. I saw one of your posts on MoreCore and tried to figure it out. Can you point me where you define the new tab and fields? I looked last night but couldn't see it. I'd like to add my own tabs, own fields, and make the character sheet drag-expandable if possible.
But can an extension do all that?

damned
April 23rd, 2016, 00:50
Generally all of these things are defined in 2 or 3 places.
Getting notepad++ and using the Find In Files search feature is going to be your friend here.

\extension.xml introduces all your files
\campaign\record_char.xml introduces the new tab


<!-- Added new MoreCore Tab to the Character Sheet -->
<!-- "more" is a reference only. charsheet_more refers to <windowclass name="charsheet_more"> which is found in the \campaign\record_char_more.xml file -->
<subwindow name="more">
<bounds>0,65,-1,-20</bounds>
<class>charsheet_more</class>
</subwindow>

you would then do searches on more abd charsheet_more
you would find
\campaign\record_char.xml which defines the new tab/sheet and has several fields dfined within.
its fairly well commented


<?xml version="1.0" encoding="iso-8859-1"?>

<!--
Please see the license.html file included with this distribution for
attribution and copyright information.
-->

<root>
<!-- New WindowClass "charsheet_more" -->
<windowclass name="charsheet_more">
<sheetdata>
<!-- New Frame taken from the record_char_notes.xml file -->
<frame_char name="detailframe">
<bounds>15,0,-29,45</bounds>
</frame_char>
<string_labeled name="race">
<anchored to="detailframe" position="insidetopleft" offset="15,10" width="150" height="20" />
<labelres>char_label_race</labelres>
</string_labeled>
<string_labeled name="gender">
<anchored to="race" position="right" offset="5,0" width="70" />
<labelres>char_label_gender</labelres>
</string_labeled>
<string_labeled name="age">
<anchored to="gender" position="right" offset="5,0" width="70" />
<labelres>char_label_age</labelres>
</string_labeled>
<string_labeled name="height">
<anchored to="age" position="right" offset="5,0" width="70" />
<labelres>char_label_height</labelres>
</string_labeled>
<string_labeled name="weight">
<anchored to="height" position="right" offset="5,0" width="70" />
<labelres>char_label_weight</labelres>
</string_labeled>

<!-- New Frame for recording Attack Strings. 5 lines long, will scroll to more than 5 lines but cant double-click them if they go over 5 lines as it loses focus between clicks on lines 6+ -->
<!-- Attack Frame by damned -->
<!-- Frame Co-ordinates -->
<frame_char name="attackframe">
<bounds>15,45,320,170</bounds>
</frame_char>
<!-- Frame Anchor point and Label -->
<label_frametop>
<anchored to="attackframe" />
<!-- Label Text is found in /strings/strings_morecore.xml -->
<static textres="pc_label_attack" />
</label_frametop>
<!-- Blank lines for recording your attack strings -->
<!-- My suggestions for attack and damage strings are:
Fit Attack and Damage on one line
Use Syntax: [A] Weapon Dice, [D] Weapon Dice,
You can only use standard dice (d4, d6, d8, d10, d12, d20 and modifiers -->
<stringu name="attacks" source="attacks">
<anchored to="attackframe">
<top offset="30" />
<left offset="15" />
<right offset="-20" />
<bottom offset="-5" />
</anchored>
<multilinespacing>20</multilinespacing>
<!-- npc_attack.lua allows us to introduce the Attacker and Targets names to the Chat Window Result -->
<script file="campaign/scripts/npc_attack.lua" />
</stringu>
<scrollbar_list>
<anchored to="attacks" />
<target>attacks</target>
</scrollbar_list>
<!-- End Attack Frame by damned -->
<!-- New Frame for recording Attack Strings. 5 lines long, will scroll to more than 5 lines but cant double-click them if they go over 5 lines as it loses focus between clicks on lines 6+ -->
<!-- Combat Frame by damned -->
<!-- Frame Co-ordinates -->
<frame_char name="combatframe">
<bounds>335,45,-29,170</bounds>
</frame_char>
<!-- Frame Anchor point and Label -->
<label_frametop>
<anchored to="combatframe" />
<!-- Label Text is found in /strings/strings_morecore.xml -->
<static textres="pc_label_combat" />
</label_frametop>
<!-- This field is linked to Column 1 (health) field in MoreCore CT -->
<!-- Label Text is found in /strings/strings_morecore.xml -->
<!-- CombatTracker files are /ct/ct_client.xml and /ct/ct_host.xml -->
<!-- Script to Link this field to CT field is in /ct/scripts/ct_entry.lua
function linkPCFields()
specific line is: health.setLink(nodeChar.createChild("health", "number"), true);
-->
<number_ctlink name="health" source="health">
<anchored to="combatframe" position="insidetopleft" offset="110,28" />
<tooltip textres="pc_tooltip_health" />
</number_ctlink>
<!-- Label Text is found in /strings/strings_morecore.xml -->
<string_useredit name="pc_label_health">
<anchored to="combatframe" position="insidetopleft" offset="10,31" />
<default>Health</default>
<tooltip textres="label_editable" />
</string_useredit>

<!-- This field is linked to Column 2 (defence) field in MoreCore CT -->
<!-- Label Text is found in /strings/strings_morecore.xml -->
<!-- CombatTracker files are /ct/ct_client.xml and /ct/ct_host.xml -->
<!-- Script to Link this field to CT field is in /ct/scripts/ct_entry.lua
function linkPCFields()
specific line is: health.setLink(nodeChar.createChild("health", "number"), true);
-->
<number_ctlink name="defence" source="defence">
<anchored to="combatframe" position="insidetopleft" offset="110,49" />
<tooltip textres="pc_tooltip_defence" />
</number_ctlink>
<!-- Label Text is found in /strings/strings_morecore.xml -->
<string_useredit name="pc_label_defence">
<anchored to="combatframe" position="insidetopleft" offset="10,52" />
<default>Defence</default>
<tooltip textres="label_editable" />
</string_useredit>

<!-- This field is linked to Wounds (User Defineable) field in MoreCore CT -->
<!-- Label Text is found in /strings/strings_morecore.xml -->
<!-- CombatTracker files are /ct/ct_client.xml and /ct/ct_host.xml -->
<!-- Script to Link this field to CT field is in /ct/scripts/ct_entry.lua
function linkPCFields()
specific line is: wounds.setLink(nodeChar.createChild("wounds", "number"), true);
<number_charwounds name="wounds" source="wounds">
<anchored to="combatframe" position="insidetopleft" offset="110,70" />
<tooltip textres="pc_tooltip_four" />
</number_charwounds>
-->
<!-- Label Text is found in /strings/strings_morecore.xml -->
<string_useredit name="pc_label_wounds">
<anchored to="combatframe" position="insidetopleft" offset="10,73" />
<default>Wounds</default>
<tooltip textres="label_editable" />
</string_useredit>

<!-- This field is linked to Column 4 (User Defineable) field in MoreCore CT -->
<!-- Label Text is found in /strings/strings_morecore.xml -->
<!-- CombatTracker files are /ct/ct_client.xml and /ct/ct_host.xml -->
<!-- Script to Link this field to CT field is in /ct/scripts/ct_entry.lua
function linkPCFields()
specific line is: health.setLink(nodeChar.createChild("health", "number"), true);
-->
<number_ctlink name="four" source="four">
<anchored to="combatframe" position="insidetopleft" offset="110,91" />
<tooltip textres="pc_tooltip_four" />
</number_ctlink>
<!-- Label Text is found in /strings/strings_morecore.xml -->
<string_useredit name="pc_label_four">
<anchored to="combatframe" position="insidetopleft" offset="10,94" />
<default>C4</default>
<tooltip textres="label_editable" />
</string_useredit>

<!-- This field is linked to Column 5 (User Defineable) field in MoreCore CT -->
<!-- Label Text is found in /strings/strings_morecore.xml -->
<!-- CombatTracker files are /ct/ct_client.xml and /ct/ct_host.xml -->
<!-- Script to Link this field to CT field is in /ct/scripts/ct_entry.lua
function linkPCFields()
specific line is: health.setLink(nodeChar.createChild("health", "number"), true);
-->
<number_ctlink name="five" source="five">
<anchored to="combatframe" position="insidetopleft" offset="110,112" />
<tooltip textres="pc_tooltip_five" />
</number_ctlink>
<!-- Label Text is found in /strings/strings_morecore.xml -->
<string_useredit name="pc_label_five">
<anchored to="combatframe" position="insidetopleft" offset="10,115" />
<default>C5</default>
<tooltip textres="label_editable" />
</string_useredit>

<!-- This field is linked to Order field in MoreCore CT -->
<!-- Label Text is found in /strings/strings_morecore.xml -->
<!-- CombatTracker files are /ct/ct_client.xml and /ct/ct_host.xml -->
<!-- Players can roll and update their INIT/Order here - they do not have rights to edit CT direct -->
<number_ctlink name="initresult" source="initresult">
<anchored to="combatframe" position="insidetopleft" offset="110,133" />
<tooltip textres="pc_tooltip_order" />
</number_ctlink>
<!-- Label Text is found in /strings/strings_morecore.xml -->
<string_useredit name="pc_label_order">
<anchored to="combatframe" position="insidetopleft" offset="10,136" />
<default>Order</default>
<tooltip textres="label_editable" />
</string_useredit>

<!-- End Combat Frame by damned -->





<!-- New Frame for recording Additional (most commonly used) Abilities similar to char_record_main.xml.
WIP as at 20150308 -->
<!-- PrimarySttributes Frame by damned -->
<!-- Frame Co-ordinates -->
<frame_char name="primaryattributesframe">
<bounds>15,215,-29,-5</bounds>
</frame_char>
<label_frametop>
<anchored to="primaryattributesframe" />
<static textres="char_label_primaryattributes" />
</label_frametop>



</sheetdata>
</windowclass>
</root>

damned
April 23rd, 2016, 00:51
Do you want the CharSheet to be expandable or make it bigger to start with (this is usually better for CharSheets)?

\campaign\record_char.xml includes the following code that sets the size


<windowclass name="charsheet">
<frame>charsheet</frame>
<placement>
<size width="525" height="568" />
</placement>


I hope that gets you started on the right road...

Jingo
April 23rd, 2016, 05:53
Well, I think I'm figuring it out... more or less. I was able to modify the charsheet size and also made it expandable. I was feeling very claustrophobic before.
I'm currently trying my hand at my own tab using your MoreCore extension as a guide.
Thanks again.

damned
April 23rd, 2016, 06:38
Having an expandable Story or Tables or Image frame makes sense.
But the CharSheet has so many specifically positioned elements that I think you will find having a set size is a better option.
Just my 2c worth.