Lone Wolf Development Forums  

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

Notices

Reply
 
Thread Tools Display Modes
Farling
Senior Member
 
Join Date: Mar 2013
Location: Greater London, UK
Posts: 2,346

Old June 1st, 2020, 01:14 AM
Version 2.14 is available

The tool now presents a list of the available top-level arrays in a JSON file, so that the user can choose which array is to be used as the data source for the data import.

(This fixes the problem reported by apoca6 in http://forums.wolflair.com/showpost....&postcount=548 )

Farling

Author of the Realm Works Import (http://forums.wolflair.com/showthread.php?t=58156) and Output tools (http://forums.wolflair.com/showthread.php?t=59981)
Farling is offline   #551 Reply With Quote
apoca6
Junior Member
 
Join Date: Jun 2011
Posts: 13

Old June 1st, 2020, 01:28 AM
You are a Legend thank you
apoca6 is offline   #552 Reply With Quote
Farling
Senior Member
 
Join Date: Mar 2013
Location: Greater London, UK
Posts: 2,346

Old June 1st, 2020, 01:34 AM
Quote:
Originally Posted by apoca6 View Post
You are a Legend
I'm not Will Smith ;-)

Farling

Author of the Realm Works Import (http://forums.wolflair.com/showthread.php?t=58156) and Output tools (http://forums.wolflair.com/showthread.php?t=59981)
Farling is offline   #553 Reply With Quote
apoca6
Junior Member
 
Join Date: Jun 2011
Posts: 13

Old June 1st, 2020, 01:56 AM
Quote:
Originally Posted by Farling View Post
I'm not Will Smith ;-)
lol, would you want to be?

Next question, looking at my data, some of the fields were split so instead of alignment, i have a 4 or 5 columns with variations, some for C some for G (in the case of CG), is it possible to add multiple items to one field and have them concatenate? so 'C' 'blank' 'blank' 'blank' 'G' in the alignment field would parse as 'CG' into RW?

Hope that makes sense? I can work around it if not.
apoca6 is offline   #554 Reply With Quote
Farling
Senior Member
 
Join Date: Mar 2013
Location: Greater London, UK
Posts: 2,346

Old June 1st, 2020, 02:11 AM
Quote:
Originally Posted by apoca6 View Post
Next question, looking at my data, some of the fields were split so instead of alignment, i have a 4 or 5 columns with variations, some for C some for G (in the case of CG), is it possible to add multiple items to one field and have them concatenate? so 'C' 'blank' 'blank' 'blank' 'G' in the alignment field would parse as 'CG' into RW?
You can use the new "custom columns" function. You create a new column, and write some javascript which defines how the value will be generated for this new column.

So you could write a function which will examine various other columns and decide what the single new combined value should be.

For example, the following javascript for a custom column merges several columns into a single D&D 5E spell duration field

Quote:
row.column('duration/1/duration/amount') + ' ' + row.column('duration/1/duration/type') + ((row.column('duration/1/concentration') == 'true') ? ' (C)' : '')
and for the time field we have a more complex expression

Quote:
var r = row.column('time/1/number') + ' ' + row.column('time/1/unit')

if (row.column('time/1/condition') != '')
r += ' (' + row.column('time/1/condition') + ')'

if (row.column('meta/ritual') != '')
r += ' (R)'

r
and for the description, we need to merge several fields including some HTML:

Quote:
var a = row.column('entries/1')
var b = row.column('entries/2')
var c = row.column('entries/3')

var d = ''
if (a != ' ') d += '<p>' + a + '</p>'
if (b != ' ') d += '<p>' + b + '</p>'
if (c != ' ') d += '<p>' + c + '</p>'

d
Note that I'm a complete amateur at javascript, so there could be easier ways to do the above things.

Farling

Author of the Realm Works Import (http://forums.wolflair.com/showthread.php?t=58156) and Output tools (http://forums.wolflair.com/showthread.php?t=59981)

Last edited by Farling; June 1st, 2020 at 02:24 AM.
Farling is offline   #555 Reply With Quote
apoca6
Junior Member
 
Join Date: Jun 2011
Posts: 13

Old June 1st, 2020, 02:30 AM
I keep trying to avoid Javascript, but guess i will have to look into it

It has Java in the name so i guess i am halfway there with my basic level of Java?!

Thanks for taking the time to reply, it is appreciated!
apoca6 is offline   #556 Reply With Quote
Farling
Senior Member
 
Join Date: Mar 2013
Location: Greater London, UK
Posts: 2,346

Old June 1st, 2020, 02:36 AM
Quote:
Originally Posted by apoca6 View Post
It has Java in the name so i guess i am halfway there with my basic level of Java?!
From what I've read, this is a very misleading name :-)

Farling

Author of the Realm Works Import (http://forums.wolflair.com/showthread.php?t=58156) and Output tools (http://forums.wolflair.com/showthread.php?t=59981)
Farling is offline   #557 Reply With Quote
apoca6
Junior Member
 
Join Date: Jun 2011
Posts: 13

Old June 1st, 2020, 02:49 AM
well i am hacking it together, ok.
The two existing custom columns were all i needed really; where the data was split into several columns, they just needed combining into one, similar to the derived example field.

It will take a bit to do, but means i can import everything easily now without going back in to adjust everything individually you are a life/sanity saver with this program
apoca6 is offline   #558 Reply With Quote
Farling
Senior Member
 
Join Date: Mar 2013
Location: Greater London, UK
Posts: 2,346

Old June 18th, 2020, 02:21 AM
Version 2.16 is now available

This version adds a new javascript function for derived columns.

row.hasColumn(name) will return true only if a column called "name" exists in the model.

This allows you to use the same javascript for multiple different data sets which might merely have a different number of named columns, e.g. (entries/1, entries/2 in one file, and entries/1, entries/2, entries/3 in another file; or perhaps entries/3/caption might exist, but no entries/1/caption or entries/2/caption).

Farling

Author of the Realm Works Import (http://forums.wolflair.com/showthread.php?t=58156) and Output tools (http://forums.wolflair.com/showthread.php?t=59981)
Farling is offline   #559 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 01:28 AM.


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