Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Realm Works Forums > Realm Works Discussion

Notices

Reply
 
Thread Tools Display Modes
EightBitz
Senior Member
 
Join Date: May 2013
Posts: 1,458

Old February 21st, 2017, 03:25 PM
Quote:
Originally Posted by Acenoid View Post
Like he wrote in the 1st post: he reads the csv and creates an RW XML for import
probably it is being made especially for this task I wont be of much use, however I agree, it could be great to create all kinds of lists / topics / things via csv and import them.

Let's see what EightBlitz says
I'm doing my best to make the code easily adaptable, but you'll still have to be familiar with PowerShell scripting. That being said, there are a few pending issues.

1. There is currently a bug with RealmWorks where tag values assigned to snippets are instead assigned to topics. I'm told by Farling that this is a known bug which LWD says it's working on.

2. The CSV file I'm working is from pathfindercommunity.net, but I've had to clean it up a bit.

3. There's the issue with the view size limitation. I have yet to modify the code for the suggested workaround.

4. The CSV file has a column for a plain-text description and one for an HTML-formatted description. The formatted description is obviously preferable, but is giving me issues. At least one spell (#134 of ~2700) is giving me an error on import. I say at least one, because it stops there and doesn't go beyond.

5. I've had to modify the tags in the Pathfinder structure to add spell descriptors, schools and subschools. So if I distribute the code, I'd have to distribute it with my Pathfinder structure and my sanitized version of the CSV file, otherwise errors.

Once I get a clean, flawless import, I'll be willing to share. Right now, my copy of RW is supposedly deleting the imported spells so I can have a clean realm to start testing things again.

Except for the import error, all these things have workarounds. For example, I can clone the Spell category, and in the clone, replace the tag snippets with labeled text snippets. Or stick information in the annotation fields instead of assigning tags.

But that one import error, I gotta find out what's going on there, and right now, I'm clueless. I've submitted a support request.
EightBitz is offline   #11 Reply With Quote
HippyCraig
Member
 
Join Date: Jan 2015
Posts: 96

Old February 21st, 2017, 04:02 PM
Awesome looking forward to seeing the final result.
HippyCraig is offline   #12 Reply With Quote
daplunk
Senior Member
 
Join Date: Jan 2016
Location: Adelaide, Australia
Posts: 2,294

Old February 21st, 2017, 04:03 PM
Yeah this is bloody exciting.

Realm Works - Community Links
Realm Work and Hero Lab Videos
Ream Works Facebook User Group
CC3+ Facebook User Group

D&D 5e Community Pack - Contributor
General Hero Lab Support & Community Resources
D&D 5e Community Pack - Install Instructions / D&D 5e Community Pack - Log Fault / D&D 5e Community Pack - Editor Knowledge Base

Obsidian
Obsidian TTRPG Tutorials
daplunk is offline   #13 Reply With Quote
Farling
Senior Member
 
Join Date: Mar 2013
Location: Greater London, UK
Posts: 2,623

Old February 22nd, 2017, 09:06 AM
Quote:
Originally Posted by EightBitz View Post
5. I've had to modify the tags in the Pathfinder structure to add spell descriptors, schools and subschools. So if I distribute the code, I'd have to distribute it with my Pathfinder structure and my sanitized version of the CSV file, otherwise errors.
There is no need to modify the tags. All of these are already in the default Pathfinder structure.

I've got all the 4 CSV loading quite happily except for the tags issue. I decided to use the basic text instead of the HTML-ised text. I don't know if the HTML-ised text is from the raw PRD or someone has added from another source.

My solution uses XSLT scripts rather than PowerShell scripts.
Farling is offline   #14 Reply With Quote
EightBitz
Senior Member
 
Join Date: May 2013
Posts: 1,458

Old February 22nd, 2017, 10:11 AM
Descriptors in the spreadsheet that were not in the Pathfinder structure: Disease, Draconic, Meditative, Phantasm, Ruse, Travel

Spell Levels: Adept 0, 1, 2 and 3
Antipaladin 5 and 6
Bloodrager 5 and 6

Spell ranges: Several.
EightBitz is offline   #15 Reply With Quote
EightBitz
Senior Member
 
Join Date: May 2013
Posts: 1,458

Old February 22nd, 2017, 01:58 PM
Quote:
Originally Posted by Farling View Post
There is no need to modify the tags. All of these are already in the default Pathfinder structure.

I've got all the 4 CSV loading quite happily except for the tags issue. I decided to use the basic text instead of the HTML-ised text. I don't know if the HTML-ised text is from the raw PRD or someone has added from another source.

My solution uses XSLT scripts rather than PowerShell scripts.
I apologize if I'm a bit cranky today, my brother set me off by bringing up an old argument that I thought had been settled. Anyway ...

I'm wondering if we're using different spreadsheets or if maybe XSLT works differently than Powershell, or at least the way I'm using Powershell.

What I'm doing with tags, for example, is that when there's a value in "School" or "Subschool" (etc) in the spreadsheet, I search for that text in the tag domain, and I assign the corresponding tag_id for whatever is found. If there is no matching text, the tag_id ends up being an empty value, so the resulting value in the export file becomes:

tag_id=""

When I try to import that, it throws an error.

So then, I can do two things. I can open the CSV file in Excel, click on the "Data" tab, then click the "Filter" option.

That makes each header a drop-down list. So I can click the drop-down list for school, subschool, descriptor or range, and see all the values that exist in each column.

Or, I can tell Powershell that whenever it finds an empty tag_id, append the tag name to a file. When it's all done, I can open that file and see all the tags that weren't recognized as existing in the structure file.

I'm wondering if with XSLT, if it doesn't recognize a tag, it doesn't even try to assign a value, so you never get an error, and you end up with tags that are just missing.

I don't know for sure, but if we're using the same spreadsheet and the same software, there has to be something to explain the disparity of our experiences, and the only thing that's different (so far as I know) is Powershell vs. XSLT.
EightBitz is offline   #16 Reply With Quote
Farling
Senior Member
 
Join Date: Mar 2013
Location: Greater London, UK
Posts: 2,623

Old February 22nd, 2017, 02:06 PM
Quote:
Originally Posted by EightBitz View Post
I apologize if I'm a bit cranky today, my brother set me off by bringing up an old argument that I thought had been settled. Anyway ...

I'm wondering if we're using different spreadsheets or if maybe XSLT works differently than Powershell, or at least the way I'm using Powershell.

What I'm doing with tags, for example, is that when there's a value in "School" or "Subschool" (etc) in the spreadsheet, I search for that text in the tag domain, and I assign the corresponding tag_id for whatever is found. If there is no matching text, the tag_id ends up being an empty value, so the resulting value in the export file becomes:

tag_id=""

When I try to import that, it throws an error.

So then, I can do two things. I can open the CSV file in Excel, click on the "Data" tab, then click the "Filter" option.

That makes each header a drop-down list. So I can click the drop-down list for school, subschool, descriptor or range, and see all the values that exist in each column.

Or, I can tell Powershell that whenever it finds an empty tag_id, append the tag name to a file. When it's all done, I can open that file and see all the tags that weren't recognized as existing in the structure file.

I'm wondering if with XSLT, if it doesn't recognize a tag, it doesn't even try to assign a value, so you never get an error, and you end up with tags that are just missing.

I don't know for sure, but if we're using the same spreadsheet and the same software, there has to be something to explain the disparity of our experiences, and the only thing that's different (so far as I know) is Powershell vs. XSLT.
I have an <xsltherwise> clause for when there is no match, so that I can set the "Other" tag and then put the string into the <annotation> child element.
(The emoji is supposed to be a colon followed by the word 'otherwise'.)

Last edited by Farling; February 22nd, 2017 at 02:16 PM.
Farling is offline   #17 Reply With Quote
EightBitz
Senior Member
 
Join Date: May 2013
Posts: 1,458

Old February 22nd, 2017, 02:29 PM
Quote:
Originally Posted by Farling View Post
I have an <xsltherwise> clause for when there is no match, so that I can set the "Other" tag and then put the string into the <annotation> child element.
(The emoji is supposed to be a colon followed by the word 'otherwise'.)
Ah. I just went ahead and either entered the tags or corrected the spreadsheet. For example, for range, "Medium (100 ft. + 5 ft./level)" was entered about 5 or 6 different ways. Sometimes with different spacing around the +, sometimes with "levels" instead of "level", sometimes with "feet" instead of "ft.". I tried to make things as consistent as I could on both sides.

I'm still having an issue with Detect Evil. I'm getting it to load now, but the table headers on the last table are shifted one cell to the right. I don't see anything obvious in the HTML that would cause that. Again, not sure if this is a Realm Works bug, or if the HTML is still wonky. All I can say is that a few other tables I looked at seem OK.
EightBitz is offline   #18 Reply With Quote
kbs666
Senior Member
 
Join Date: Oct 2014
Location: Chicago, IL
Posts: 1,690

Old February 22nd, 2017, 04:08 PM
Quote:
Originally Posted by EightBitz View Post
I'm still having an issue with Detect Evil. I'm getting it to load now, but the table headers on the last table are shifted one cell to the right. I don't see anything obvious in the HTML that would cause that. Again, not sure if this is a Realm Works bug, or if the HTML is still wonky. All I can say is that a few other tables I looked at seem OK.
Can you post the HTML code here? I could take a look and see if I catch an issue.

my Realm Works videos
https://www.youtube.com/channel/UCZU...4DwXXkvmBXQ9Yw
kbs666 is offline   #19 Reply With Quote
EightBitz
Senior Member
 
Join Date: May 2013
Posts: 1,458

Old February 22nd, 2017, 04:35 PM
Quote:
Originally Posted by kbs666 View Post
Can you post the HTML code here? I could take a look and see if I catch an issue.
This includes the basic HTML from the spreadsheet, the resultant XML that my script creates, a screenshot of what the basic HTML looks like in IE (with everything properly lined up), and a screenshot of what it looks like after importing the XML into RW, with the headers shifted to the right.
Attached Files
File Type: zip tableanomaly.zip (56.9 KB, 8 views)
EightBitz is offline   #20 Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 05:58 PM.


Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.